Function: image-dired--with-dired-buffer

image-dired--with-dired-buffer is a macro defined in image-dired-util.el.gz.

Signature

(image-dired--with-dired-buffer &rest BODY)

Documentation

Run BODY in the Dired buffer associated with thumbnail at point.

Should be used by commands in image-dired-thumbnail-mode.

Source Code

;; Defined in /usr/src/emacs/lisp/image/image-dired-util.el.gz
(defmacro image-dired--with-dired-buffer (&rest body)
  "Run BODY in the Dired buffer associated with thumbnail at point.
Should be used by commands in `image-dired-thumbnail-mode'."
  (declare (indent defun) (debug t))
  (let ((file (make-symbol "file"))
        (dired-buf (make-symbol "dired-buf")))
    `(let ((,file (image-dired-original-file-name))
           (,dired-buf (image-dired-associated-dired-buffer)))
       (unless ,file
         (error "No image at point"))
       (unless (and ,dired-buf (buffer-live-p ,dired-buf))
         (error "Cannot find associated Dired buffer for image: %s" ,file))
       (with-current-buffer ,dired-buf
         ,@body))))