Commit f8a47b07 authored by Mark Oteiza's avatar Mark Oteiza
Browse files

More image-dired refactoring

* lisp/image-dired.el (image-dired-thumbnail-mode):
(image-dired-display-image-mode): Add :group 'image-dired so
customize-mode works.
(image-dired-display-image): Rearrange.
(image-dired-copy-with-exif-file-name): This map is for side effect.
(image-dired-dired-edit-comment-and-tags): Just use #'identity.
parent 9886239b
...@@ -1463,6 +1463,7 @@ You probably want to use this together with ...@@ -1463,6 +1463,7 @@ You probably want to use this together with
special-mode "image-dired-thumbnail" special-mode "image-dired-thumbnail"
"Browse and manipulate thumbnail images using dired. "Browse and manipulate thumbnail images using dired.
Use `image-dired-minor-mode' to get a nice setup." Use `image-dired-minor-mode' to get a nice setup."
:group 'image-dired
(buffer-disable-undo) (buffer-disable-undo)
(add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t))
...@@ -1470,6 +1471,7 @@ Use `image-dired-minor-mode' to get a nice setup." ...@@ -1470,6 +1471,7 @@ Use `image-dired-minor-mode' to get a nice setup."
special-mode "image-dired-image-display" special-mode "image-dired-image-display"
"Mode for displaying and manipulating original image. "Mode for displaying and manipulating original image.
Resized or in full-size." Resized or in full-size."
:group 'image-dired
(buffer-disable-undo) (buffer-disable-undo)
(image-mode-setup-winprops) (image-mode-setup-winprops)
(add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t))
...@@ -1741,26 +1743,22 @@ original size." ...@@ -1741,26 +1743,22 @@ original size."
'image-dired-cmd-create-temp-image-program) 'image-dired-cmd-create-temp-image-program)
(let ((new-file (expand-file-name image-dired-temp-image-file)) (let ((new-file (expand-file-name image-dired-temp-image-file))
(window (image-dired-display-window)) (window (image-dired-display-window))
width height command ret
(image-type 'jpeg)) (image-type 'jpeg))
(setq file (expand-file-name file)) (setq file (expand-file-name file))
(if (not original-size) (if (not original-size)
(progn (let* ((command
(setq width (image-dired-display-window-width window))
(setq height (image-dired-display-window-height window))
(setq command
(format-spec (format-spec
image-dired-cmd-create-temp-image-options image-dired-cmd-create-temp-image-options
(list (list
(cons ?p image-dired-cmd-create-temp-image-program) (cons ?p image-dired-cmd-create-temp-image-program)
(cons ?w width) (cons ?w (image-dired-display-window-width window))
(cons ?h height) (cons ?h (image-dired-display-window-height window))
(cons ?f file) (cons ?f file)
(cons ?t new-file)))) (cons ?t new-file))))
(setq ret (call-process shell-file-name nil nil nil (ret (call-process shell-file-name nil nil nil
shell-command-switch command)) shell-command-switch command)))
(if (not (= 0 ret)) (when (not (zerop ret))
(error "Could not resize image"))) (error "Could not resize image")))
(setq image-type (image-type-from-file-name file)) (setq image-type (image-type-from-file-name file))
(copy-file file new-file t)) (copy-file file new-file t))
(with-current-buffer (image-dired-create-display-image-buffer) (with-current-buffer (image-dired-create-display-image-buffer)
...@@ -1983,7 +1981,7 @@ function. The result is a couple of new files in ...@@ -1983,7 +1981,7 @@ function. The result is a couple of new files in
(interactive) (interactive)
(let (new-name (let (new-name
(files (dired-get-marked-files))) (files (dired-get-marked-files)))
(mapcar (mapc
(lambda (curr-file) (lambda (curr-file)
(setq new-name (setq new-name
(format "%s/%s" (format "%s/%s"
...@@ -2433,8 +2431,7 @@ the operation by activating the Cancel button.\n\n") ...@@ -2433,8 +2431,7 @@ the operation by activating the Cancel button.\n\n")
:size 60 :size 60
:format "%v " :format "%v "
:value (or (mapconcat :value (or (mapconcat
(lambda (tag) #'identity
tag)
(image-dired-list-tags file) (image-dired-list-tags file)
",") ""))) ",") "")))
;; Save information in all widgets so that we can use it when ;; Save information in all widgets so that we can use it when
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment