(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")
: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
: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
(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)))
(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)
(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)
(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 ()
@cindex quoting
\e$B5-;v$KJVEz$+%U%)%m!<%"%C%W$r$9$k$H$-$O!"IaDL$O$"$J$?$,1~Ez$7$F$$$k?M$N$b\e(B
\e$B$N$K0zMQId$rIU$1$?$$$G$7$g$&!#0zMQJ8$NA^F~$O\e(B @dfn{\e$BE=$jIU$1\e(B} \e$B$K$h$C$F$J$5\e(B
-\e$B$l\e(B (\e$B$9$G$K0zMQId$,IU$$$F$$$k$b$N$H6u9T$OBP>]30!"\e(B
+\e$B$l\e(B (\e$B$9$G$K\e(B @code{message-yank-cited-prefix} \e$B$r;H$C$F0zMQId$,IU$$$F$$$k9T\e(B
+\e$B$H!"\e(B@code{message-yank-empty-prefix} \e$B$,IU$1$i$l$?6u9T$OBP>]30\e(B;
@code{message-yank-cited-prefix} \e$B$r;2>H$N$3$H\e(B)\e$B!"$=$l$>$l$NE=$jIU$1$i$l$?\e(B
\e$B9T$O$=$NA0$K\e(B @code{message-yank-prefix} \e$B$rIU$1$i$l$^$9!#=i4|CM\e(B
\e$B$O\e(B @samp{> } \e$B$G$9!#\e(B
@cindex yanking
@cindex cited
@cindex quoting
-\e$B5-;v$+$i0zMQ$5$l$?%F%-%9%H$,$9$G$K0zMQ$5$l$?$b$N$@$C$?$j6u$@$C$?>l9g!"$=\e(B
-\e$B$l$>$l$N9T$K$O$3$NJQ?t$NCM$,A0CV$5$l$^$9!#=i4|CM$O\e(B @samp{>} \e$B$G$9!#\e(B
+\e$B5-;v$+$i0zMQ$5$l$?%F%-%9%H$,$9$G$K0zMQ$5$l$?$b$N$@$C$?>l9g!"$=$l$>$l$N9T\e(B
+\e$B$K$O$3$NJQ?t$NCM$,A0CV$5$l$^$9!#=i4|CM$O\e(B @samp{>} \e$B$G$9!#\e(B
+@code{message-yank-prefix} \e$B$b;2>H$7$F2<$5$$!#\e(B
+
+@item message-yank-empty-prefix
+@vindex message-yank-empty-prefix
+@cindex yanking
+@cindex quoting
+\e$B5-;v$+$i%F%-%9%H$r0zMQ$9$k$H$-!"$=$l$>$l$N6u9T$K$3$NJQ?t$NCM$,A0CV$5$l$^\e(B
+\e$B$9!#=i4|CM$O\e(B @samp{>} \e$B$G$9!#$3$NJQ?t$r6uJ8;z$K@_Dj$9$k$3$H$K$h$C$F!"0zMQ\e(B
+\e$B$5$l$?%F%-%9%H$r<+F0E*$KCJMnJ,$1$9$k$3$H$,$G$-$^$9!#\e(B
@code{message-yank-prefix} \e$B$b;2>H$7$F2<$5$$!#\e(B
@item message-yank-add-new-references
@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