2001-12-01 15:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 1 Dec 2001 20:17:51 +0000 (20:17 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 1 Dec 2001 20:17:51 +0000 (20:17 +0000)
* gnus-sum.el (gnus-summary-save-article): Nix
gnus-display-mime-function and gnus-article-prepare-hook.

* gnus-spec.el (gnus-parse-complex-format): Properly handle %C at
the beginning of lines.
(gnus-complex-form-to-spec): Ditto.

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

index 5e6c26b..3d3f816 100644 (file)
@@ -1,3 +1,12 @@
+2001-12-01 15:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-sum.el (gnus-summary-save-article): Nix
+       gnus-display-mime-function and gnus-article-prepare-hook.
+
+       * gnus-spec.el (gnus-parse-complex-format): Properly handle %C at
+       the beginning of lines.
+       (gnus-complex-form-to-spec): Ditto.
+
 2001-12-01 08:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-make-mft): Fix the m-s-a-file regexp.
index 952e06b..88b4100 100644 (file)
@@ -382,47 +382,53 @@ characters when given a pad value."
       (gnus-parse-simple-format format spec-alist insert))))
 
 (defun gnus-parse-complex-format (format spec-alist)
-  (save-excursion
-    (gnus-set-work-buffer)
-    (insert format)
-    (goto-char (point-min))
-    (while (re-search-forward "\"" nil t)
-      (replace-match "\\\"" nil t))
-    (goto-char (point-min))
-    (insert "(\"")
-    ;; Convert all font specs into font spec lists.
-    (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
-      (let ((number (if (match-beginning 1)
-                       (match-string 1) "0"))
-           (delim (aref (match-string 2) 0)))
-       (if (or (= delim ?\()
-               (= delim ?\{)
-               (= delim ?\«))
-           (replace-match (concat "\"("
-                                  (cond ((= delim ?\() "mouse")
-                                        ((= delim ?\{) "face")
-                                        (t "balloon"))
-                                  " " number " \"")
-                          t t)
-         (replace-match "\")\""))))
-    (goto-char (point-max))
-    (insert "\")")
-    ;; Convert point position commands.
-    (goto-char (point-min))
-    (let ((case-fold-search nil))
-      (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))))
-      ;; If the first element is '(point), we just remove it.
-      (when (equal (car form) '(point))
-       (pop form))
-      (cons 'progn (gnus-complex-form-to-spec form spec-alist)))))
+  (let (found-C)
+    (save-excursion
+      (gnus-set-work-buffer)
+      (insert format)
+      (goto-char (point-min))
+      (while (re-search-forward "\"" nil t)
+       (replace-match "\\\"" nil t))
+      (goto-char (point-min))
+      (insert "(\"")
+      ;; Convert all font specs into font spec lists.
+      (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
+       (let ((number (if (match-beginning 1)
+                         (match-string 1) "0"))
+             (delim (aref (match-string 2) 0)))
+         (if (or (= delim ?\()
+                 (= delim ?\{)
+                 (= delim ?\«))
+             (replace-match (concat "\"("
+                                    (cond ((= delim ?\() "mouse")
+                                          ((= delim ?\{) "face")
+                                          (t "balloon"))
+                                    " " number " \"")
+                            t t)
+           (replace-match "\")\""))))
+      (goto-char (point-max))
+      (insert "\")")
+      ;; Convert point position commands.
+      (goto-char (point-min))
+      (let ((case-fold-search nil))
+       (while (re-search-forward "%\\([-0-9]+\\)?C" nil t)
+         (replace-match "\"(point)\"" t t)
+         (setq found-C 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))))
+       (if found-C
+           `(let (gnus-position)
+              ,@(gnus-complex-form-to-spec form spec-alist)
+              (if gnus-position
+                  (gnus-put-text-property gnus-position (1+ gnus-position) 
+                                          'gnus-position t)))
+         `(progn
+            ,@(gnus-complex-form-to-spec form spec-alist)))))))
 
 (defun gnus-complex-form-to-spec (form spec-alist)
   (delq nil
@@ -432,7 +438,7 @@ characters when given a pad value."
            ((stringp sform)
             (gnus-parse-simple-format sform spec-alist t))
            ((eq (car sform) 'point)
-            `(gnus-put-text-property (1- (point)) (point) 'gnus-position t))
+            '(setq gnus-position (point)))
            ((eq (car sform) 'tab)
             (gnus-spec-tab (cadr sform)))
            (t
index 1f9a181..dd14328 100644 (file)
@@ -9840,7 +9840,9 @@ The variable `gnus-default-article-saver' specifies the saver function."
            (gnus-message 1 "Article %d is unsaveable" article))
        ;; This is a real article.
        (save-window-excursion
-         (gnus-summary-select-article t nil nil article))
+         (let ((gnus-display-mime-function nil)
+               (gnus-article-prepare-hook nil))
+           (gnus-summary-select-article t nil nil article)))
        (save-excursion
          (set-buffer save-buffer)
          (erase-buffer)