From: yamaoka Date: Tue, 7 Dec 1999 09:20:12 +0000 (+0000) Subject: (font-lock-after-change-function): Don't use `compile' for the arg of X-Git-Tag: t-gnus-6_14_0-04~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac35181c2920c7e03c1e5a7cbed950a47c4ffa93;p=elisp%2Fgnus.git- (font-lock-after-change-function): Don't use `compile' for the arg of `defadvice'. ;; From KEIICHI-san. (message-yank-add-new-references): New option value `message-id-only'. (message-yank-original): Likewise. (message-list-references-add-position): New user option. (message-list-references): When `message-list-references-add-position' is integer value, the order of designate number message-ids is kept. --- diff --git a/lisp/message.el b/lisp/message.el index 9a9ab93..9d607ea 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -643,7 +643,16 @@ The function `message-supersede' runs this hook." (defcustom message-yank-add-new-references t "*Non-nil means new IDs will be added to \"References\" field when an article is yanked by the command `message-yank-original' interactively." - :type 'boolean + :type '(radio (const :tag "Do not add anything" nil) + (const :tag "From Message-Id, References and In-Reply-To fields" t) + (const :tag "From only Message-Id field." message-id-only)) + :group 'message-insertion) + +(defcustom message-list-references-add-position nil + "*Integer value means position for adding to \"References\" field when +an article is yanked by the command `message-yank-original' interactively." + :type '(radio (const :tag "Add to last" nil) + (integer :tag "Position from last ID")) :group 'message-insertion) (defcustom message-indentation-spaces 3 @@ -1032,7 +1041,7 @@ before fontifying.") (eval-after-load "font-lock" '(defadvice font-lock-after-change-function - (before message-font-lock-save-last-position activate compile) + (before message-font-lock-save-last-position activate) "Save last cursor position before fontifying." (if (eq 'message-mode major-mode) (setq message-font-lock-last-position (point))))) @@ -2227,7 +2236,15 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (defun message-list-references (refs-list &rest refs-strs) "Add `Message-ID's which appear in REFS-STRS but not in REFS-LIST, to REFS-LIST." - (let (refs ref id) + (let (refs ref id saved-id) + (when (and refs-list + (integerp message-list-references-add-position)) + (let ((pos message-list-references-add-position)) + (while (and refs-list + (> pos 0)) + (setq saved-id (cons (car refs-list) saved-id) + refs-list (cdr refs-list) + pos (1- pos))))) (while refs-strs (setq refs (car refs-strs) refs-strs (cdr refs-strs)) @@ -2244,6 +2261,9 @@ to REFS-LIST." ">")) (or (member id refs-list) (push id refs-list)))))) + (while saved-id + (setq refs-list (cons (car saved-id) refs-list) + saved-id (cdr saved-id))) refs-list)) (defvar gnus-article-copy) @@ -2260,7 +2280,8 @@ prefix, and don't delete any headers. In addition, if `message-yank-add-new-references' is non-nil and this command is called interactively, new IDs from the yanked article will -be added to \"References\" field." +be added to \"References\" field. +\(See also `message-yank-add-new-references'.)" (interactive "P") (let ((modified (buffer-modified-p)) (buffer (message-eval-parameter message-reply-buffer)) @@ -2285,8 +2306,10 @@ be added to \"References\" field." (std11-narrow-to-header) (when (setq refs (message-list-references refs - (or (message-fetch-field "References") - (message-fetch-field "In-Reply-To")) + (unless (eq message-yank-add-new-references + 'message-id-only) + (or (message-fetch-field "References") + (message-fetch-field "In-Reply-To"))) (message-fetch-field "Message-ID"))) (widen) (message-narrow-to-headers)