Function: ibuffer-save-marks

ibuffer-save-marks is a macro defined in ibuf-macs.el.gz.

Signature

(ibuffer-save-marks &rest BODY)

Documentation

Save the marked status of the buffers and execute BODY; restore marks.

Source Code

;; Defined in /usr/src/emacs/lisp/ibuf-macs.el.gz
(defmacro ibuffer-save-marks (&rest body)
  "Save the marked status of the buffers and execute BODY; restore marks."
  (declare (indent 0))
  (let ((bufsym (make-symbol "bufsym")))
    `(let ((,bufsym (current-buffer))
	   (ibuffer-save-marks-tmp-mark-list (ibuffer-current-state-list)))
       (unwind-protect
	   (progn
	     (save-excursion
	       ,@body))
	 (with-current-buffer ,bufsym
	   (ibuffer-redisplay-engine
	    ;; Get rid of dead buffers
	    (delq nil
                  (mapcar (lambda (e) (when (buffer-live-p (car e))
                                        e))
			  ibuffer-save-marks-tmp-mark-list)))
	   (ibuffer-redisplay t))))))