Function: rmail-duplicate-message

rmail-duplicate-message is a byte-compiled function defined in rmail.el.gz.

Signature

(rmail-duplicate-message)

Documentation

Create a duplicated copy of the current message.

The duplicate copy goes into the Rmail file just after the original.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
(defun rmail-duplicate-message ()
  "Create a duplicated copy of the current message.
The duplicate copy goes into the Rmail file just after the original."
  ;; If we are in a summary buffer, switch to the Rmail buffer.
  ;; FIXME simpler to swap the contents, not the buffers?
  (set-buffer rmail-buffer)
  (rmail-modify-format)
  (let ((buff (current-buffer))
        (n rmail-current-message)
        (beg (rmail-msgbeg rmail-current-message))
        (end (rmail-msgend rmail-current-message)))
    (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer))
      (widen)
      (let ((buffer-read-only nil)
          (string (buffer-substring-no-properties beg end)))
      (goto-char end)
      (insert string))
    (set-buffer buff)
    (rmail-swap-buffers-maybe)
    (goto-char (point-max))
    (rmail-set-message-counters)
    (set-buffer-modified-p t)
    (rmail-show-message-1 n))
  (if (rmail-summary-exists)
      (rmail-select-summary (rmail-update-summary)))
  (message "Message duplicated"))