Function: mh-notate

mh-notate is an autoloaded and byte-compiled function defined in mh-seq.el.gz.

Signature

(mh-notate MSG NOTATION OFFSET)

Documentation

Mark MSG with the character NOTATION at position OFFSET.

Null MSG means the message at cursor. If NOTATION is nil then no change in the buffer occurs.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-seq.el.gz
;;; Notation

;;;###mh-autoload
(defun mh-notate (msg notation offset)
  "Mark MSG with the character NOTATION at position OFFSET.
Null MSG means the message at cursor.
If NOTATION is nil then no change in the buffer occurs."
  (save-excursion
    (if (or (null msg)
            (mh-goto-msg msg t t))
        (with-mh-folder-updating (t)
          (beginning-of-line)
          (forward-char offset)
          (let* ((change-stack-flag
                  (and (equal offset
                              (+ mh-cmd-note mh-scan-field-destination-offset))
                       (not (eq notation mh-note-seq))))
                 (msg (and change-stack-flag (or msg (mh-get-msg-num nil))))
                 (stack (and msg (gethash msg mh-sequence-notation-history)))
                 (notation (or notation (char-after))))
            (if stack
                ;; The presence of the stack tells us that we don't need to
                ;; notate the message, since the notation would be replaced
                ;; by a sequence notation. So we will just put the notation
                ;; at the bottom of the stack. If the sequence is deleted,
                ;; the correct notation will be shown.
                (setf (gethash msg mh-sequence-notation-history)
                      (reverse (cons notation (cdr (reverse stack)))))
              ;; Since we don't have any sequence notations in the way, just
              ;; notate the scan line.
              (delete-char 1)
              (insert notation))
            (when change-stack-flag
              (mh-thread-update-scan-line-map msg notation offset)))))))