Function: mh-delete-msg-from-seq

mh-delete-msg-from-seq is an autoloaded, interactive and byte-compiled function defined in mh-seq.el.gz.

Signature

(mh-delete-msg-from-seq RANGE SEQUENCE &optional INTERNAL-FLAG)

Documentation

Delete RANGE from SEQUENCE.

Check the documentation of mh-interactive-range to see how RANGE is read in interactive use.

In a program, non-nil INTERNAL-FLAG means do not inform MH of the change.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-seq.el.gz
;;;###mh-autoload
(defun mh-delete-msg-from-seq (range sequence &optional internal-flag)
  "Delete RANGE from SEQUENCE.

Check the documentation of `mh-interactive-range' to see how
RANGE is read in interactive use.

In a program, non-nil INTERNAL-FLAG means do not inform MH of the
change."
  (interactive (list (mh-interactive-range "Delete")
                     (mh-read-seq-default "Delete from" t)
                     nil))
  (let ((entry (mh-find-seq sequence))
        (user-sequence-flag (not (mh-internal-seq sequence)))
        (folders-changed (list mh-current-folder))
        (msg-list ()))
    (when entry
      (mh-iterate-on-range msg range
        (push msg msg-list)
        ;; Calling "mark" repeatedly takes too long. So we will pretend here
        ;; that we are just modifying an internal sequence...
        (when (memq msg (cdr entry))
          (mh-remove-sequence-notation msg (not user-sequence-flag)))
        (mh-delete-a-msg-from-seq msg sequence t))
      ;; ... and here we will "mark" all the messages at one go.
      (unless internal-flag (mh-undefine-sequence sequence msg-list))
      (when (and mh-index-data (not internal-flag))
        (setq folders-changed
              (append folders-changed
                      (mh-index-delete-from-sequence sequence msg-list))))
      (when (and (eq sequence mh-unseen-seq) (mh-speed-flists-active-p))
        (apply #'mh-speed-flists t folders-changed)))))