Synch with Oort Gnus.
authoryamaoka <yamaoka>
Fri, 7 Dec 2001 13:31:59 +0000 (13:31 +0000)
committeryamaoka <yamaoka>
Fri, 7 Dec 2001 13:31:59 +0000 (13:31 +0000)
lisp/ChangeLog
lisp/gnus-sum.el
lisp/gnus-util.el

index daf23cc..d728874 100644 (file)
@@ -1,3 +1,10 @@
+2001-12-07 01:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-sum.el (gnus-summary-print-truncate-and-quote): New.
+       (gnus-summary-print-article): Use it.
+       
+       * gnus-util.el (gnus-replace-in-string): Typo.
+
 2001-12-06 10:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * nnweb.el (nnweb-replace-in-string): Removed.
index 1a9e778..4413b19 100644 (file)
@@ -7955,6 +7955,13 @@ article.  If BACKWARD (the prefix) is non-nil, search backward instead."
     (when gnus-page-broken
       (gnus-narrow-to-page))))
 
+(defun gnus-summary-print-truncate-and-quote (string &optional len)
+  "Truncate to LEN and quote all \"(\"'s in STRING."
+  (gnus-replace-in-string (if (and len (> (length string) len))
+                             (substring string 0 len) 
+                           string)
+                         "[()]" "\\\\\\&"))
+
 (defun gnus-summary-print-article (&optional filename n)
   "Generate and print a PostScript image of the N next (mail) articles.
 
@@ -7984,9 +7991,13 @@ to save in."
              (let ((ps-left-header
                     (list
                      (concat "("
-                             (mail-header-subject gnus-current-headers) ")")
+                             (gnus-summary-print-truncate-and-quote
+                              (mail-header-subject gnus-current-headers) 
+                              66) ")")
                      (concat "("
-                             (mail-header-from gnus-current-headers) ")")))
+                             (gnus-summary-print-truncate-and-quote
+                              (mail-header-from gnus-current-headers) 
+                              45) ")")))
                    (ps-right-header
                     (list
                      "/pagenumberstring load"
index d930ba2..8b4f687 100644 (file)
@@ -60,7 +60,7 @@
       (let ((start 0) tail)
        (while (string-match regexp string start)
          (setq tail (- (length string) (match-end 0)))
-         (setq string (replace-match newtext t t string))
+         (setq string (replace-match newtext nil literal string))
          (setq start (- (length string) tail))))
       string))))