Function: mh-delete-a-msg

mh-delete-a-msg is an autoloaded and byte-compiled function defined in mh-folder.el.gz.

Signature

(mh-delete-a-msg MESSAGE)

Documentation

Delete MESSAGE.

If MESSAGE is nil then the message at point is deleted. The hook mh-delete-msg-hook is called after you mark a message for deletion. For example, a past maintainer of MH-E used this once when he kept statistics on his mail usage.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-folder.el.gz
;;;###mh-autoload
(defun mh-delete-a-msg (message)
  "Delete MESSAGE.
If MESSAGE is nil then the message at point is deleted.
The hook `mh-delete-msg-hook' is called after you mark a message
for deletion. For example, a past maintainer of MH-E used this
once when he kept statistics on his mail usage."
  (save-excursion
    (if (numberp message)
        (mh-goto-msg message nil t)
      (beginning-of-line)
      (setq message (mh-get-msg-num t)))
    (if (looking-at mh-scan-refiled-msg-regexp)
        (error "Message %d is refiled; undo refile before deleting" message))
    (if (looking-at mh-scan-blocklisted-msg-regexp)
        (error "Message %d is blocklisted; undo before deleting" message))
    (if (looking-at mh-scan-allowlisted-msg-regexp)
        (error "Message %d is allowlisted; undo before deleting" message))
    (if (looking-at mh-scan-deleted-msg-regexp)
        nil
      (mh-set-folder-modified-p t)
      (setq mh-delete-list (cons message mh-delete-list))
      (mh-notate nil mh-note-deleted mh-cmd-note)
      (run-hooks 'mh-delete-msg-hook))))