Function: mail-yank-region

mail-yank-region is an interactive and byte-compiled function defined in sendmail.el.gz.

Signature

(mail-yank-region ARG)

Documentation

Insert the selected region from the message being replied to.

Puts point after the text and mark before. Normally, indents each nonblank line ARG spaces (default 3). However, if mail-yank-prefix is non-nil, insert that prefix on each line.

Just C-u (universal-argument) as argument means don't indent, insert no prefix, and don't delete any header fields.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mail/sendmail.el.gz
(defun mail-yank-region (arg)
  "Insert the selected region from the message being replied to.
Puts point after the text and mark before.
Normally, indents each nonblank line ARG spaces (default 3).
However, if `mail-yank-prefix' is non-nil, insert that prefix on each line.

Just \\[universal-argument] as argument means don't indent, insert no prefix,
and don't delete any header fields."
  (interactive "P")
  (and (consp mail-reply-action)
       (memq (car mail-reply-action)
	     '(rmail-yank-current-message insert-buffer))
       (with-current-buffer (nth 1 mail-reply-action)
	 (or (mark t)
	     (error "No mark set: %S" (current-buffer))))
       (let ((buffer (nth 1 mail-reply-action))
	     (start (point))
	     ;; Avoid error in Transient Mark mode
	     ;; on account of mark's being inactive.
	     (mark-even-if-inactive t))
	 ;; Insert the citation text.
	 (insert (with-current-buffer buffer
		   (buffer-substring-no-properties (point) (mark))))
	 (push-mark start)
	 ;; Indent or otherwise annotate the citation text.
	 (if (consp arg)
	     nil
	   (let ((mail-indentation-spaces (if arg (prefix-numeric-value arg)
					    mail-indentation-spaces)))
	     (if mail-citation-hook
		 ;; Bind mail-citation-header to the original message's header.
		 (let ((mail-citation-header
			(with-current-buffer buffer
			  (buffer-substring-no-properties
			   (point-min)
			   (save-excursion
			     (goto-char (point-min))
			     (rfc822-goto-eoh)
			     (point))))))
		   (run-hooks 'mail-citation-hook))
	       (mail-indent-citation)))))))