2001-12-07 01:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 7 Dec 2001 06:22:11 +0000 (06:22 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 7 Dec 2001 06:22:11 +0000 (06:22 +0000)
* gnus-sum.el (gnus-summary-print-truncate-and-quote): New.
(gnus-summary-print-article): Use it.

* gnus-util.el (gnus-replace-in-string): Typo.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/gnus-util.el

index f916d08..e930ac7 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 dd14328..5c8a6a7 100644 (file)
@@ -7814,6 +7814,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.
 
@@ -7843,9 +7850,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 ec4f490..4f426d1 100644 (file)
@@ -57,7 +57,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))))