* gnus-spec.el (gnus-parse-complex-format): React to ?=.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 19 Aug 2001 16:54:11 +0000 (16:54 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 19 Aug 2001 16:54:11 +0000 (16:54 +0000)
(gnus-complex-form-to-spec): Insert tab.
(gnus-spec-tab): New function.

lisp/ChangeLog
lisp/gnus-spec.el

index 86499e5..8252248 100644 (file)
@@ -1,5 +1,9 @@
 2001-08-19 16:14:41  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-spec.el (gnus-parse-complex-format): React to ?=.
+       (gnus-complex-form-to-spec): Insert tab.
+       (gnus-spec-tab): New function.
+
        * gnus-sum.el (gnus-select-newsgroup): Set the marks before
        entering the group.
 
index ffdec0f..4be7ef3 100644 (file)
     'balloon-help
     ,(intern (format "gnus-balloon-face-%d" type))))
 
+(defun gnus-spec-tab (column)
+  (if (> column 0)
+      `(insert (make-string (max (- ,column (current-column)) 0) ? ))
+    `(progn
+       (if (> (current-column) ,(abs column))
+          (delete-region (point)
+                         (- (point) (- (current-column) ,(abs column))))
+        (insert (make-string (max (- ,(abs column) (current-column)) 0)
+                             ? ))))))
+
 (defun gnus-correct-length (string)
   "Return the correct width of STRING."
   (let ((length 0))
     (goto-char (point-min))
     (while (re-search-forward "%\\([-0-9]+\\)?C" nil t)
       (replace-match "\"(point)\"" t t))
+    ;; Convert TAB commands.
+    (goto-char (point-min))
+    (while (re-search-forward "%\\([-0-9]+\\)=" nil t)
+      (replace-match (format "\"(tab %s)\"" (match-string 1)) t t))
     ;; Convert the buffer into the spec.
     (goto-char (point-min))
     (let ((form (read (current-buffer))))
             (gnus-parse-simple-format sform spec-alist t))
            ((eq (car sform) 'point)
             `(gnus-put-text-property (1- (point)) (point) 'gnus-position t))
+           ((eq (car sform) 'tab)
+            (gnus-spec-tab (cadr sform)))
            (t
             (funcall (intern (format "gnus-%s-face-function" (car sform)))
                      (gnus-complex-form-to-spec (cddr sform) spec-alist)