diff options
| author | Mark Oteiza | 2016-12-15 20:36:24 -0500 |
|---|---|---|
| committer | Mark Oteiza | 2016-12-15 20:36:24 -0500 |
| commit | f8a47b07ff4604a807193937922f3ba6f8eaf488 (patch) | |
| tree | 28495c812e5a1a06f67e36cc71a66ce295de63fc | |
| parent | 9886239bd29f3a7b95da61f852fecef3cfa32825 (diff) | |
| download | emacs-f8a47b07ff4604a807193937922f3ba6f8eaf488.tar.gz emacs-f8a47b07ff4604a807193937922f3ba6f8eaf488.zip | |
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.
| -rw-r--r-- | lisp/image-dired.el | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 5ccc040c1d7..2925d0cb64a 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -1463,6 +1463,7 @@ You probably want to use this together with | |||
| 1463 | special-mode "image-dired-thumbnail" | 1463 | special-mode "image-dired-thumbnail" |
| 1464 | "Browse and manipulate thumbnail images using dired. | 1464 | "Browse and manipulate thumbnail images using dired. |
| 1465 | Use `image-dired-minor-mode' to get a nice setup." | 1465 | Use `image-dired-minor-mode' to get a nice setup." |
| 1466 | :group 'image-dired | ||
| 1466 | (buffer-disable-undo) | 1467 | (buffer-disable-undo) |
| 1467 | (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) | 1468 | (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) |
| 1468 | 1469 | ||
| @@ -1470,6 +1471,7 @@ Use `image-dired-minor-mode' to get a nice setup." | |||
| 1470 | special-mode "image-dired-image-display" | 1471 | special-mode "image-dired-image-display" |
| 1471 | "Mode for displaying and manipulating original image. | 1472 | "Mode for displaying and manipulating original image. |
| 1472 | Resized or in full-size." | 1473 | Resized or in full-size." |
| 1474 | :group 'image-dired | ||
| 1473 | (buffer-disable-undo) | 1475 | (buffer-disable-undo) |
| 1474 | (image-mode-setup-winprops) | 1476 | (image-mode-setup-winprops) |
| 1475 | (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) | 1477 | (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) |
| @@ -1741,26 +1743,22 @@ original size." | |||
| 1741 | 'image-dired-cmd-create-temp-image-program) | 1743 | 'image-dired-cmd-create-temp-image-program) |
| 1742 | (let ((new-file (expand-file-name image-dired-temp-image-file)) | 1744 | (let ((new-file (expand-file-name image-dired-temp-image-file)) |
| 1743 | (window (image-dired-display-window)) | 1745 | (window (image-dired-display-window)) |
| 1744 | width height command ret | ||
| 1745 | (image-type 'jpeg)) | 1746 | (image-type 'jpeg)) |
| 1746 | (setq file (expand-file-name file)) | 1747 | (setq file (expand-file-name file)) |
| 1747 | (if (not original-size) | 1748 | (if (not original-size) |
| 1748 | (progn | 1749 | (let* ((command |
| 1749 | (setq width (image-dired-display-window-width window)) | ||
| 1750 | (setq height (image-dired-display-window-height window)) | ||
| 1751 | (setq command | ||
| 1752 | (format-spec | 1750 | (format-spec |
| 1753 | image-dired-cmd-create-temp-image-options | 1751 | image-dired-cmd-create-temp-image-options |
| 1754 | (list | 1752 | (list |
| 1755 | (cons ?p image-dired-cmd-create-temp-image-program) | 1753 | (cons ?p image-dired-cmd-create-temp-image-program) |
| 1756 | (cons ?w width) | 1754 | (cons ?w (image-dired-display-window-width window)) |
| 1757 | (cons ?h height) | 1755 | (cons ?h (image-dired-display-window-height window)) |
| 1758 | (cons ?f file) | 1756 | (cons ?f file) |
| 1759 | (cons ?t new-file)))) | 1757 | (cons ?t new-file)))) |
| 1760 | (setq ret (call-process shell-file-name nil nil nil | 1758 | (ret (call-process shell-file-name nil nil nil |
| 1761 | shell-command-switch command)) | 1759 | shell-command-switch command))) |
| 1762 | (if (not (= 0 ret)) | 1760 | (when (not (zerop ret)) |
| 1763 | (error "Could not resize image"))) | 1761 | (error "Could not resize image"))) |
| 1764 | (setq image-type (image-type-from-file-name file)) | 1762 | (setq image-type (image-type-from-file-name file)) |
| 1765 | (copy-file file new-file t)) | 1763 | (copy-file file new-file t)) |
| 1766 | (with-current-buffer (image-dired-create-display-image-buffer) | 1764 | (with-current-buffer (image-dired-create-display-image-buffer) |
| @@ -1983,7 +1981,7 @@ function. The result is a couple of new files in | |||
| 1983 | (interactive) | 1981 | (interactive) |
| 1984 | (let (new-name | 1982 | (let (new-name |
| 1985 | (files (dired-get-marked-files))) | 1983 | (files (dired-get-marked-files))) |
| 1986 | (mapcar | 1984 | (mapc |
| 1987 | (lambda (curr-file) | 1985 | (lambda (curr-file) |
| 1988 | (setq new-name | 1986 | (setq new-name |
| 1989 | (format "%s/%s" | 1987 | (format "%s/%s" |
| @@ -2433,8 +2431,7 @@ the operation by activating the Cancel button.\n\n") | |||
| 2433 | :size 60 | 2431 | :size 60 |
| 2434 | :format "%v " | 2432 | :format "%v " |
| 2435 | :value (or (mapconcat | 2433 | :value (or (mapconcat |
| 2436 | (lambda (tag) | 2434 | #'identity |
| 2437 | tag) | ||
| 2438 | (image-dired-list-tags file) | 2435 | (image-dired-list-tags file) |
| 2439 | ",") ""))) | 2436 | ",") ""))) |
| 2440 | ;; Save information in all widgets so that we can use it when | 2437 | ;; Save information in all widgets so that we can use it when |