From d2c27938259567a6f0fbf5ce425d53a577d6af9f Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 8 Aug 2005 22:58:24 +0000 Subject: [PATCH] Synch to No Gnus 200508082009. --- lisp/ChangeLog | 6 +++ lisp/message.el | 108 ++++++++++++++++++++++++++++++-------------------- texi/ChangeLog | 6 +++ texi/message-ja.texi | 16 ++++++-- texi/message.texi | 26 +++++++----- 5 files changed, 107 insertions(+), 55 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c57dead..c3b8be3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-08-08 Romain Francoise + + * message.el (message-yank-empty-prefix): New variable. + (message-indent-citation): Use it. + (message-cite-original-without-signature): Respect X-No-Archive. + 2005-08-08 Simon Josefsson * pgg.el: Autoload url-insert-file-contents instead of loading diff --git a/lisp/message.el b/lisp/message.el index 9d7cecc..f6c334a 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1040,33 +1040,23 @@ configuration. See the variable `gnus-cite-attribution-suffix'." (defcustom message-yank-prefix "> " "*Prefix inserted on the lines of yanked messages. Fix `message-cite-prefix-regexp' if it is set to an abnormal value. -See also `message-yank-cited-prefix'." +See also `message-yank-cited-prefix' and `message-yank-empty-prefix'." :type 'string :link '(custom-manual "(message)Insertion Variables") :group 'message-insertion) -(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. -If it is a symbol `message-id-only', only an ID from \"Message-ID\" field -is used, otherwise IDs extracted from \"References\", \"In-Reply-To\" and -\"Message-ID\" fields are used." - :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-yank-cited-prefix ">" - "*Prefix inserted on cited or empty lines of yanked messages. + "*Prefix inserted on cited lines of yanked messages. Fix `message-cite-prefix-regexp' if it is set to an abnormal value. -See also `message-yank-prefix'." +See also `message-yank-prefix' and `message-yank-empty-prefix'." + :version "22.1" + :type 'string + :link '(custom-manual "(message)Insertion Variables") + :group 'message-insertion) + +(defcustom message-yank-empty-prefix ">" + "*Prefix inserted on empty lines of yanked messages. +See also `message-yank-prefix' and `message-yank-cited-prefix'." :version "22.1" :type 'string :link '(custom-manual "(message)Insertion Variables") @@ -1094,6 +1084,16 @@ Note that `message-cite-original' uses `mail-citation-hook' if that is non-nil." :group 'message-insertion) ;;;###autoload +(defcustom message-indent-citation-function 'message-indent-citation + "*Function for modifying a citation just inserted in the mail buffer. +This can also be a list of functions. Each function can find the +citation between (point) and (mark t). And each function should leave +point and mark around the citation text as modified." + :type 'function + :link '(custom-manual "(message)Insertion Variables") + :group 'message-insertion) + +;;;###autoload (defcustom message-suspend-font-lock-when-citing nil "Non-nil means suspend font-lock'ing while citing an original message. Some lazy demand-driven fontification tools (or Emacs itself) have a @@ -1104,14 +1104,23 @@ even if it is an add-hoc expedient." :type 'boolean :group 'message-insertion) -;;;###autoload -(defcustom message-indent-citation-function 'message-indent-citation - "*Function for modifying a citation just inserted in the mail buffer. -This can also be a list of functions. Each function can find the -citation between (point) and (mark t). And each function should leave -point and mark around the citation text as modified." - :type 'function - :link '(custom-manual "(message)Insertion Variables") +(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. +If it is a symbol `message-id-only', only an ID from \"Message-ID\" field +is used, otherwise IDs extracted from \"References\", \"In-Reply-To\" and +\"Message-ID\" fields are used." + :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) ;;;###autoload @@ -3501,9 +3510,12 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (save-excursion (goto-char start) (while (< (point) (mark t)) - (if (or (looking-at ">") (looking-at "^$")) - (insert message-yank-cited-prefix) - (insert message-yank-prefix)) + (cond ((looking-at ">") + (insert message-yank-cited-prefix)) + ((looking-at "^$") + (insert message-yank-empty-prefix)) + (t + (insert message-yank-prefix))) (forward-line 1)))) (goto-char start))) @@ -3637,10 +3649,13 @@ be added to the \"References\" field." (push (buffer-name buffer) buffers)))) (nreverse buffers))) +;; FIXME: the following function duplicates `message-cite-original' +;; almost in entirety, merging the two would be nice. (defun message-cite-original-without-signature () - "Cite function in the standard Message manner." + "Cite function in the standard Message manner, excluding the signature." (let ((start (point)) (end (mark t)) + (x-no-archive nil) (functions (when message-indent-citation-function (if (listp message-indent-citation-function) @@ -3648,15 +3663,15 @@ be added to the \"References\" field." (list message-indent-citation-function)))) (message-reply-headers (or message-reply-headers (make-mail-header)))) - (mail-header-set-from message-reply-headers - (save-restriction - (narrow-to-region - (point) - (if (search-forward "\n\n" nil t) - (1- (point)) - (point-max))) - (or (message-fetch-field "from") - "unknown sender"))) + (mail-header-set-from + message-reply-headers + (save-restriction + (narrow-to-region (point) (if (search-forward "\n\n" nil t) + (1- (point)) + (point-max))) + (setq x-no-archive (message-fetch-field "x-no-archive")) + (or (message-fetch-field "from") + "unknown sender"))) ;; Allow undoing. (undo-boundary) (goto-char end) @@ -3675,7 +3690,14 @@ be added to the \"References\" field." (when message-citation-line-function (unless (bolp) (insert "\n")) - (funcall message-citation-line-function)))) + (funcall message-citation-line-function)) + (when (and x-no-archive + (not message-cite-articles-with-x-no-archive) + (string-match "yes" x-no-archive)) + (undo-boundary) + (delete-region (point) (mark t)) + (insert "> [Quoted text removed due to X-No-Archive]\n") + (forward-line -1)))) (eval-when-compile (defvar mail-citation-hook)) ;Compiler directive (defun message-cite-original () diff --git a/texi/ChangeLog b/texi/ChangeLog index aec41b5..fe2724e 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2005-08-08 Romain Francoise + + * message.texi (Insertion Variables): Mention new variable + `message-yank-empty-prefix'. Change `message-yank-cited-prefix' + documentation accordingly. + 2005-07-27 Reiner Steib * gnus.texi (Startup Files): Fix name of gnus-site-init-file. diff --git a/texi/message-ja.texi b/texi/message-ja.texi index 33f4a14..c473649 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -1766,7 +1766,8 @@ Manual}, にあります。 @cindex quoting 記事に返答かフォローアップをするときは、普通はあなたが応答している人のも のに引用符を付けたいでしょう。引用文の挿入は @dfn{貼り付け} によってなさ -れ (すでに引用符が付いているものと空行は対象外、 +れ (すでに @code{message-yank-cited-prefix} を使って引用符が付いている行 +と、@code{message-yank-empty-prefix} が付けられた空行は対象外; @code{message-yank-cited-prefix} を参照のこと)、それぞれの貼り付けられた 行はその前に @code{message-yank-prefix} を付けられます。初期値 は @samp{> } です。 @@ -1776,8 +1777,17 @@ Manual}, にあります。 @cindex yanking @cindex cited @cindex quoting -記事から引用されたテキストがすでに引用されたものだったり空だった場合、そ -れぞれの行にはこの変数の値が前置されます。初期値は @samp{>} です。 +記事から引用されたテキストがすでに引用されたものだった場合、それぞれの行 +にはこの変数の値が前置されます。初期値は @samp{>} です。 +@code{message-yank-prefix} も参照して下さい。 + +@item message-yank-empty-prefix +@vindex message-yank-empty-prefix +@cindex yanking +@cindex quoting +記事からテキストを引用するとき、それぞれの空行にこの変数の値が前置されま +す。初期値は @samp{>} です。この変数を空文字に設定することによって、引用 +されたテキストを自動的に段落分けすることができます。 @code{message-yank-prefix} も参照して下さい。 @item message-yank-add-new-references diff --git a/texi/message.texi b/texi/message.texi index 1b01cdf..250d8c3 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1789,21 +1789,29 @@ Article Highlighting, gnus, The Gnus Manual}, for details. @cindex yanking @cindex quoting When you are replying to or following up an article, you normally want -to quote the person you are answering. Inserting quoted text is done -by @dfn{yanking}, and each line you yank will have -@code{message-yank-prefix} prepended to it (except for quoted and -empty lines which uses @code{message-yank-cited-prefix}). The default -is @samp{> }. +to quote the person you are answering. Inserting quoted text is done by +@dfn{yanking}, and each line you yank will have +@code{message-yank-prefix} prepended to it (except for quoted lines +which use @code{message-yank-cited-prefix} and empty lines which use +@code{message-yank-empty-prefix}). The default is @samp{> }. @item message-yank-cited-prefix @vindex message-yank-cited-prefix @cindex yanking @cindex cited @cindex quoting -When yanking text from an article which contains no text or already -cited text, each line will be prefixed with the contents of this -variable. The default is @samp{>}. See also -@code{message-yank-prefix}. +When yanking text from an article which contains already cited text, +each line will be prefixed with the contents of this variable. The +default is @samp{>}. See also @code{message-yank-prefix}. + +@item message-yank-empty-prefix +@vindex message-yank-empty-prefix +@cindex yanking +@cindex quoting +When yanking text from an article, each empty line will be prefixed with +the contents of this variable. The default is @samp{>}. You can set +this variable to an empty string to split the cited text into paragraphs +automatically. See also @code{message-yank-prefix}. @item message-yank-add-new-references @vindex message-yank-add-new-references -- 1.7.10.4