2001-09-10 Simon Josefsson <jas@extundo.com>
authorSimon Josefsson <jas@extundo.com>
Mon, 10 Sep 2001 09:24:06 +0000 (09:24 +0000)
committerSimon Josefsson <jas@extundo.com>
Mon, 10 Sep 2001 09:24:06 +0000 (09:24 +0000)
From Daniel Pittman <daniel@rimspace.net>

* gnus-spec.el (gnus-correct-pad-form): Fix.

lisp/ChangeLog
lisp/gnus-spec.el

index c474d63..ef6f168 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-10  Simon Josefsson  <jas@extundo.com>
+       From Daniel Pittman <daniel@rimspace.net>
+
+       * gnus-spec.el (gnus-correct-pad-form): Fix.
+
 2001-09-09  Simon Josefsson  <jas@extundo.com>
 
        * mm-decode.el (mm-inline-media-tests): Add
index 91d6069..fbff185 100644 (file)
   "Return a form that pads EL to PAD-WIDTH accounting for multi-column
 characters correctly. This is because `format' may pad to columns or to
 characters when given a pad value."
-  (let ((pad (abs pad-width)))
+  (let ((pad (abs pad-width))
+       (side (< 0 pad-width)))
     (if (symbolp el)
        `(let ((need (- ,pad (gnus-correct-length ,el))))
           (if (> need 0)
-              (concat ,el (make-string need ?\ ))
+              (concat ,(when side '(make-string need ?\ ))
+                      ,el
+                      ,(when (not side) '(make-string need ?\ )))
             ,el))
       `(let* ((val (eval ,el))
              (need (- ,pad (gnus-correct-length ,el))))
         (if (> need 0)
-            (concat ,el (make-string need ?\ ))
+            (concat ,(when side '(make-string need ?\ ))
+                    ,el
+                    ,(when (not side) '(make-string need ?\ )))
           ,el)))))
 
 (defun gnus-parse-format (format spec-alist &optional insert)