Function: with-mh-folder-updating

with-mh-folder-updating is an autoloaded macro defined in mh-acros.el.

Signature

(with-mh-folder-updating SAVE-MODIFICATION-FLAG &rest BODY)

Documentation

Format is (with-mh-folder-updating (SAVE-MODIFICATION-FLAG) &body BODY).

Execute BODY, which can modify the folder buffer without having to worry about file locking or the read-only flag, and return its result. If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification flag is unchanged, otherwise it is cleared.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-acros.el
;;;###mh-autoload
(defmacro with-mh-folder-updating (save-modification-flag &rest body)
  "Format is (with-mh-folder-updating (SAVE-MODIFICATION-FLAG) &body BODY).
Execute BODY, which can modify the folder buffer without having to
worry about file locking or the read-only flag, and return its result.
If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification flag
is unchanged, otherwise it is cleared."
  (declare (debug t) (indent defun))
  (setq save-modification-flag (car save-modification-flag)) ; CL style
  `(prog1
       (let ((mh-folder-updating-mod-flag (buffer-modified-p))
             (buffer-read-only nil)
             (buffer-file-name nil))    ;don't let the buffer get locked
         (prog1
             (progn
               ,@body)
           (mh-set-folder-modified-p mh-folder-updating-mod-flag)))
     ,@(if (not save-modification-flag)
           '((mh-set-folder-modified-p nil)))))