From: ShengHuo ZHU Date: Sat, 1 Dec 2001 20:17:51 +0000 (+0000) Subject: 2001-12-01 15:00:00 ShengHuo ZHU X-Git-Url: https://cgit.sxemacs.org/?a=commitdiff_plain;h=2defda18df6afa6623ee84a4f66386a89c6abc3f;p=gnus 2001-12-01 15:00:00 ShengHuo ZHU * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e6c26bc9..3d3f816ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2001-12-01 15:00:00 ShengHuo ZHU + + * 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 * message.el (message-make-mft): Fix the m-s-a-file regexp. diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 952e06b49..88b4100fc 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -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 diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 1f9a1812d..dd14328c5 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -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)