(defun image-dired-dired-after-readin-hook ()
"Relocate existing thumbnail overlays in Dired buffer after reverting.
Move them to their corresponding files if they still exist.
-Otherwise, delete overlays."
+Otherwise, delete overlays.
+Used by `image-dired-dired-toggle-marked-thumbs'."
(mapc (lambda (overlay)
(when (overlay-get overlay 'put-image)
(let* ((image-file (overlay-get overlay 'image-file))
image-dired-external-viewer file)))
;;;###autoload
-(defun image-dired-dired-display-image (&optional arg)
+(defun image-dired-dired-display-image (&optional _)
"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" dired-mode)
- (image-dired-display-image (dired-get-filename) arg))
+See documentation for `image-dired-display-image' for more information."
+ (declare (advertised-calling-convention () "29.1"))
+ (interactive nil dired-mode)
+ (image-dired-display-image (dired-get-filename)))
(defun image-dired-copy-with-exif-file-name ()
"Copy file with unique name to main image directory.
:version "26.1"
:type '(repeat (string :tag "Argument")))
-(defcustom image-dired-cmd-rotate-original-program
- "jpegtran"
+(defcustom image-dired-cmd-rotate-original-program "jpegtran"
"Executable used to rotate original image.
Used together with `image-dired-cmd-rotate-original-options'."
:type 'file)
Used together with `image-dired-cmd-write-exif-data-options'."
:type 'file)
-(defcustom image-dired-cmd-write-exif-data-options
- '("-%t=%v" "%f")
+(defcustom image-dired-cmd-write-exif-data-options '("-%t=%v" "%f")
"Arguments of command used to write EXIF data.
Used with `image-dired-cmd-write-exif-data-program'.
Available format specifiers are: %f which is replaced by
(defun image-dired-file-name-at-point ()
"Get abbreviated file name for thumbnail or display image at point."
- (let ((f (image-dired-original-file-name)))
- (when f
- (abbreviate-file-name f))))
+ (when-let ((f (image-dired-original-file-name)))
+ (abbreviate-file-name f)))
(defun image-dired-associated-dired-buffer ()
"Get associated Dired buffer at point."
(equal (window-buffer window) buf))
nil t))
-(defun image-dired-window-width-pixels (window)
- "Calculate WINDOW width in pixels."
- (* (window-width window) (frame-char-width)))
-
(defun image-dired-display-window ()
"Return window where `image-dired-display-image-buffer' is visible."
(get-window-with-predicate
"Return non-nil if there is an `image-dired' thumbnail at point."
(get-text-property (point) 'image-dired-thumbnail))
+(defun image-dired-window-width-pixels (window)
+ "Calculate WINDOW width in pixels."
+ (declare (obsolete window-body-width "29.1"))
+ (* (window-width window) (frame-char-width)))
+
(provide 'image-dired-util)
;; Local Variables:
Calculate how many thumbnails fit."
(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
- (/ width
- (+ (* 2 image-dired-thumb-relief)
- (* 2 image-dired-thumb-margin)
- (image-dired-thumb-size 'width)
- char-width))))
+ (width (window-body-width (image-dired-thumbnail-window) t))
+ (image-dired-thumbs-per-row
+ (/ width
+ (+ (* 2 image-dired-thumb-relief)
+ (* 2 image-dired-thumb-margin)
+ (image-dired-thumb-size 'width)
+ char-width))))
(image-dired-line-up)))
(defun image-dired-line-up-interactive ()
(defun image-dired-display-window-width (window)
"Return width, in pixels, of WINDOW."
(declare (obsolete nil "29.1"))
- (- (image-dired-window-width-pixels window)
+ (- (window-body-width window t)
image-dired-display-window-width-correction))
(defun image-dired-display-window-height (window)
(cons (list tag file) (cdr image-dired-tag-file-list))))
(setq image-dired-tag-file-list (list (list tag file))))))
-(defun image-dired-display-thumb-properties ()
- "Display thumbnail properties in the echo area."
- (declare (obsolete image-dired-update-header-line "29.1"))
- (image-dired-update-header-line))
+(define-obsolete-function-alias 'image-dired-display-thumb-properties
+ #'image-dired-update-header-line "29.1")
(defvar image-dired-slideshow-count 0
"Keeping track on number of images in slideshow.")