current line. ARG, if non-nil, specifies the files to use instead
of the marked files. If ARG is an integer, use the next ARG (or
previous -ARG, if ARG<0) files."
- (interactive "P")
+ (interactive "P" dired-mode)
(dired-map-over-marks
(let ((image-pos (dired-move-to-filename))
(image-file (dired-get-filename nil t))
(defun image-dired-next-line-and-display ()
"Move to next Dired line and display thumbnail image."
- (interactive)
+ (interactive nil dired-mode)
(dired-next-line 1)
(image-dired-display-thumbs
t (or image-dired-append-when-browsing nil) t)
(defun image-dired-previous-line-and-display ()
"Move to previous Dired line and display thumbnail image."
- (interactive)
+ (interactive nil dired-mode)
(dired-previous-line 1)
(image-dired-display-thumbs
t (or image-dired-append-when-browsing nil) t)
(defun image-dired-toggle-append-browsing ()
"Toggle `image-dired-append-when-browsing'."
- (interactive)
+ (interactive nil dired-mode)
(setq image-dired-append-when-browsing
(not image-dired-append-when-browsing))
(message "Append browsing %s"
(defun image-dired-mark-and-display-next ()
"Mark current file in Dired and display next thumbnail image."
- (interactive)
+ (interactive nil dired-mode)
(dired-mark 1)
(image-dired-display-thumbs
t (or image-dired-append-when-browsing nil) t)
(defun image-dired-toggle-dired-display-properties ()
"Toggle `image-dired-dired-disp-props'."
- (interactive)
+ (interactive nil dired-mode)
(setq image-dired-dired-disp-props
(not image-dired-dired-disp-props))
(message "Dired display properties %s"
"Call `dired-next-line', then track thumbnail.
This can safely replace `dired-next-line'.
With prefix argument, move ARG lines."
- (interactive "P")
+ (interactive "P" dired-mode)
(dired-next-line (or arg 1))
(if image-dired-track-movement
(image-dired-track-thumbnail)))
"Call `dired-previous-line', then track thumbnail.
This can safely replace `dired-previous-line'.
With prefix argument, move ARG lines."
- (interactive "P")
+ (interactive "P" dired-mode)
(dired-previous-line (or arg 1))
(if image-dired-track-movement
(image-dired-track-thumbnail)))
-
;;;###autoload
(defun image-dired-jump-thumbnail-buffer ()
"Jump to thumbnail buffer."
- (interactive)
+ (interactive nil dired-mode)
(let ((window (image-dired-thumbnail-window))
frame)
(if window
"Create thumbnail images for all marked files in Dired.
With prefix argument ARG, create thumbnails even if they already exist
\(i.e. use this to refresh your thumbnails)."
- (interactive "P")
+ (interactive "P" dired-mode)
(let (thumb-name)
(dolist (curr-file (dired-get-marked-files))
(setq thumb-name (image-dired-thumb-name curr-file))
;;;###autoload
(defun image-dired-display-thumbs-append ()
"Append thumbnails to `image-dired-thumbnail-buffer'."
- (interactive)
+ (interactive nil dired-mode)
(image-dired-display-thumbs nil t t))
;;;###autoload
(defun image-dired-display-thumb ()
"Shorthand for `image-dired-display-thumbs' with prefix argument."
- (interactive)
+ (interactive nil dired-mode)
(image-dired-display-thumbs t nil t))
;;;###autoload
(defun image-dired-dired-display-external ()
"Display file at point using an external viewer."
- (interactive)
+ (interactive nil dired-mode)
(let ((file (dired-get-filename)))
(start-process "image-dired-external" nil
image-dired-external-viewer file)))
"Display current image file.
See documentation for `image-dired-display-image' for more information.
With prefix argument ARG, display image in its original size."
- (interactive "P")
+ (interactive "P" dired-mode)
(image-dired-display-image (dired-get-filename) arg))
(defun image-dired-copy-with-exif-file-name ()
`image-dired-main-image-directory' called
2005_05_08_12_52_00_dscn0319.jpg,
2005_05_08_14_27_45_dscn0320.jpg etc."
- (interactive)
+ (interactive nil dired-mode)
(let (new-name
(files (dired-get-marked-files)))
(mapc
lets you input a regexp and this will be matched against all tags
on all image files in the database file. The files that have a
matching tag will be marked in the Dired buffer."
- (interactive "sMark tagged files (regexp): ")
+ (interactive "sMark tagged files (regexp): " dired-mode)
(image-dired-sane-db-file)
(let ((hits 0)
files)
(defun image-dired-dired-display-properties ()
"Display properties for Dired file in the echo area."
- (interactive)
+ (interactive nil dired-mode)
(let* ((file (dired-get-filename))
(file-name (file-name-nondirectory file))
(dired-buf (buffer-name (current-buffer)))
"Set the ImageDescription EXIF tag for the original image.
If the image already has a value for this tag, it is used as the
default value at the prompt."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(if (not (image-dired-image-at-point-p))
(message "No thumbnail at point")
(let* ((file (image-dired-original-file-name))
;;;###autoload
(defun image-dired-tag-files (arg)
"Tag marked file(s) in Dired. With prefix ARG, tag file at point."
- (interactive "P")
+ (interactive "P" dired-mode)
(let ((tag (completing-read
"Tags to add (separate tags with a semicolon): "
image-dired-tag-history nil nil nil 'image-dired-tag-history))
(defun image-dired-tag-thumbnail ()
"Tag current or marked thumbnails."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let ((tag (completing-read
"Tags to add (separate tags with a semicolon): "
image-dired-tag-history nil nil nil 'image-dired-tag-history)))
(defun image-dired-delete-tag (arg)
"Remove tag for selected file(s).
With prefix argument ARG, remove tag from file at point."
- (interactive "P")
+ (interactive "P" dired-mode)
(let ((tag (completing-read "Tag to remove: " image-dired-tag-history
nil nil nil 'image-dired-tag-history))
files)
(defun image-dired-tag-thumbnail-remove ()
"Remove tag from current or marked thumbnails."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let ((tag (completing-read "Tag to remove: " image-dired-tag-history
nil nil nil 'image-dired-tag-history)))
(image-dired--with-marked
;;;###autoload
(defun image-dired-dired-comment-files ()
"Add comment to current or marked files in Dired."
- (interactive)
+ (interactive nil dired-mode)
(let ((comment (image-dired-read-comment)))
(image-dired-write-comments
(mapcar
"Edit comment and tags of current or marked image files.
Edit comment and tags for all marked image files in an
easy-to-use form."
- (interactive)
+ (interactive nil dired-mode)
(setq image-dired-widget-list nil)
;; Setup buffer.
(let ((files (dired-get-marked-files)))
`image-dired-next-line-and-display' and
`image-dired-previous-line-and-display' where we do not want the
thumbnail buffer to be selected."
- (interactive "P")
+ (interactive "P" nil dired-mode)
(setq image-dired--generate-thumbs-start (current-time))
(let ((buf (image-dired-create-thumbnail-buffer))
thumb-name files dired-buf)
"Track the original file in the associated Dired buffer.
See documentation for `image-dired-toggle-movement-tracking'.
Interactive use only useful if `image-dired-track-movement' is nil."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
(let* ((dired-buf (image-dired-associated-dired-buffer))
(file-name (image-dired-original-file-name))
(window (image-dired-get-buffer-window dired-buf)))
they are \"mirrored\" in the dired buffer. When this is on, moving
around in the thumbnail or dired buffer will find the matching
position in the other buffer."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
(setq image-dired-track-movement (not image-dired-track-movement))
(message "Movement tracking %s" (if image-dired-track-movement "on" "off")))
If optional argument WRAP-AROUND is non-nil, wrap around: if
point is on the last image, move to the last one and vice versa."
- (interactive "p")
+ (interactive "p" image-dired-thumbnail-mode)
(setq arg (or arg 1))
(let (pos)
(dotimes (_ (abs arg))
Optional prefix ARG says how many images to move; the default is
one image. Negative means move forward.
On reaching end or beginning of buffer, stop and show a message."
- (interactive "p")
+ (interactive "p" image-dired-thumbnail-mode)
(image-dired-forward-image (- (or arg 1))))
(defun image-dired-next-line ()
(defun image-dired-line-up ()
"Line up thumbnails according to `image-dired-thumbs-per-row'.
See also `image-dired-line-up-dynamic'."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let ((inhibit-read-only t))
(goto-char (point-min))
(while (and (not (image-dired-image-at-point-p))
(defun image-dired-line-up-dynamic ()
"Line up thumbnails images dynamically.
Calculate how many thumbnails fit."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let* ((char-width (frame-char-width))
(width (image-dired-window-width-pixels (image-dired-thumbnail-window)))
(image-dired-thumbs-per-row
(defun image-dired-line-up-interactive ()
"Line up thumbnails interactively.
Ask user how many thumbnails should be displayed per row."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let ((image-dired-thumbs-per-row
(string-to-number (read-string "How many thumbs per row: "))))
(if (not (> image-dired-thumbs-per-row 0))
(defun image-dired-thumbnail-display-external ()
"Display original image for thumbnail at point using external viewer."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(let ((file (image-dired-original-file-name)))
(if (not (image-dired-image-at-point-p))
(message "No thumbnail at point")
"Display current thumbnail's original image in display buffer.
See documentation for `image-dired-display-image' for more information.
With prefix argument ARG, display image in its original size."
- (interactive "P")
+ (interactive "P" image-dired-thumbnail-mode)
(let ((file (image-dired-original-file-name)))
(if (not (string-equal major-mode "image-dired-thumbnail-mode"))
(message "Not in image-dired-thumbnail-mode")
and a confirmation is needed before the original image files is
overwritten. This confirmation can be turned off using
`image-dired-rotate-original-ask-before-overwrite'."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(image-dired-rotate-original "270"))
(defun image-dired-rotate-original-right ()
and a confirmation is needed before the original image files is
overwritten. This confirmation can be turned off using
`image-dired-rotate-original-ask-before-overwrite'."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(image-dired-rotate-original "90"))
(defun image-dired-display-next-thumbnail-original (&optional arg)
(defun image-dired-comment-thumbnail ()
"Add comment to current thumbnail in thumbnail buffer."
- (interactive)
+ (interactive nil image-dired-comment-thumbnail image-dired-display-image-mode)
(let* ((file (image-dired-original-file-name))
(comment (image-dired-read-comment file)))
(image-dired-write-comments (list (cons file comment)))
(defun image-dired-delete-marked ()
"Delete current or marked thumbnails and associated images."
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
+ (unless (derived-mode-p 'image-dired-thumbnail-mode)
+ (user-error "Not in `image-dired-thumbnail-mode'"))
(image-dired--with-marked
(image-dired-delete-char)
(unless (bobp)
(defun image-dired-rotate-thumbnail-left ()
"Rotate thumbnail left (counter clockwise) 90 degrees."
(declare (obsolete image-dired-refresh-thumb "29.1"))
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(with-suppressed-warnings ((obsolete image-dired-rotate-thumbnail))
(image-dired-rotate-thumbnail "270")))
(defun image-dired-rotate-thumbnail-right ()
"Rotate thumbnail counter right (clockwise) 90 degrees."
(declare (obsolete image-dired-refresh-thumb "29.1"))
- (interactive)
+ (interactive nil image-dired-thumbnail-mode)
(with-suppressed-warnings ((obsolete image-dired-rotate-thumbnail))
(image-dired-rotate-thumbnail "90")))