diff options
| author | Stefan Kangas | 2022-10-04 17:36:09 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-10-04 17:36:09 +0200 |
| commit | d9bd14975b60aa46408c67aa11a8a57bd5a8772a (patch) | |
| tree | b22a90ea8583b9fb44060c48e41ea04f01415347 /lisp | |
| parent | 849b7756fd31a69791e67dfe010b1e10f0168c83 (diff) | |
| download | emacs-d9bd14975b60aa46408c67aa11a8a57bd5a8772a.tar.gz emacs-d9bd14975b60aa46408c67aa11a8a57bd5a8772a.zip | |
image-dired: Shorten several long names
* lisp/image/image-dired.el (image-dired-image-mode-map)
(image-dired-image-mode): Rename from
'image-dired-display-image-mode-map' and
'image-dired-display-image-mode'. Update all uses and make old
names into obsolete aliases.
(image-dired-display-this, image-dired-display-next)
(image-dired-display-previous): Rename from
'image-dired-display-thumbnail-original-image',
'image-dired-display-next-thumbnail-original', and
'image-dired-display-previous-thumbnail-original'. Update all uses
and make old names into obsolete aliases.
* doc/emacs/dired.texi (Image-Dired): Update documentation for the
above changes, and improve indexing.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/image/image-dired.el | 103 |
1 files changed, 58 insertions, 45 deletions
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 86b8db7a855..d4fd3c62db1 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el | |||
| @@ -635,7 +635,7 @@ never ask for confirmation." | |||
| 635 | "Track the original file in the associated Dired buffer. | 635 | "Track the original file in the associated Dired buffer. |
| 636 | See `image-dired-toggle-movement-tracking'. Interactive use is | 636 | See `image-dired-toggle-movement-tracking'. Interactive use is |
| 637 | only useful if `image-dired-track-movement' is nil." | 637 | only useful if `image-dired-track-movement' is nil." |
| 638 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 638 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 639 | (let ((file-name (image-dired-original-file-name))) | 639 | (let ((file-name (image-dired-original-file-name))) |
| 640 | (image-dired--with-dired-buffer | 640 | (image-dired--with-dired-buffer |
| 641 | (if (not (dired-goto-file file-name)) | 641 | (if (not (dired-goto-file file-name)) |
| @@ -649,7 +649,7 @@ Tracking of the movements between thumbnail and Dired buffer so that | |||
| 649 | they are \"mirrored\" in the dired buffer. When this is on, moving | 649 | they are \"mirrored\" in the dired buffer. When this is on, moving |
| 650 | around in the thumbnail or dired buffer will find the matching | 650 | around in the thumbnail or dired buffer will find the matching |
| 651 | position in the other buffer." | 651 | position in the other buffer." |
| 652 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 652 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 653 | (setq image-dired-track-movement (not image-dired-track-movement)) | 653 | (setq image-dired-track-movement (not image-dired-track-movement)) |
| 654 | (message "Movement tracking %s" (if image-dired-track-movement "on" "off"))) | 654 | (message "Movement tracking %s" (if image-dired-track-movement "on" "off"))) |
| 655 | 655 | ||
| @@ -852,31 +852,31 @@ buffer with `image-dired--thumb-update-mark-at-point'." | |||
| 852 | '(image-dired--thumb-update-mark-at-point)) | 852 | '(image-dired--thumb-update-mark-at-point)) |
| 853 | ,(when maybe-next | 853 | ,(when maybe-next |
| 854 | '(if image-dired-marking-shows-next | 854 | '(if image-dired-marking-shows-next |
| 855 | (image-dired-display-next-thumbnail-original) | 855 | (image-dired-display-next) |
| 856 | (image-dired-forward-image))))) | 856 | (image-dired-forward-image))))) |
| 857 | 857 | ||
| 858 | (defun image-dired-mark-thumb-original-file () | 858 | (defun image-dired-mark-thumb-original-file () |
| 859 | "Mark original image file in associated Dired buffer." | 859 | "Mark original image file in associated Dired buffer." |
| 860 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 860 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 861 | (image-dired--do-mark-command t t | 861 | (image-dired--do-mark-command t t |
| 862 | (dired-mark 1))) | 862 | (dired-mark 1))) |
| 863 | 863 | ||
| 864 | (defun image-dired-unmark-thumb-original-file () | 864 | (defun image-dired-unmark-thumb-original-file () |
| 865 | "Unmark original image file in associated Dired buffer." | 865 | "Unmark original image file in associated Dired buffer." |
| 866 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 866 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 867 | (image-dired--do-mark-command t t | 867 | (image-dired--do-mark-command t t |
| 868 | (dired-unmark 1))) | 868 | (dired-unmark 1))) |
| 869 | 869 | ||
| 870 | (defun image-dired-flag-thumb-original-file () | 870 | (defun image-dired-flag-thumb-original-file () |
| 871 | "Flag original image file for deletion in associated Dired buffer." | 871 | "Flag original image file for deletion in associated Dired buffer." |
| 872 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 872 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 873 | (image-dired--do-mark-command t t | 873 | (image-dired--do-mark-command t t |
| 874 | (dired-flag-file-deletion 1))) | 874 | (dired-flag-file-deletion 1))) |
| 875 | 875 | ||
| 876 | (defun image-dired-unmark-all-marks () | 876 | (defun image-dired-unmark-all-marks () |
| 877 | "Remove all marks from all files in associated Dired buffer. | 877 | "Remove all marks from all files in associated Dired buffer. |
| 878 | Also update the marks in the thumbnail buffer." | 878 | Also update the marks in the thumbnail buffer." |
| 879 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 879 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 880 | (image-dired--do-mark-command nil t | 880 | (image-dired--do-mark-command nil t |
| 881 | (dired-unmark-all-marks)) | 881 | (dired-unmark-all-marks)) |
| 882 | (image-dired--with-thumbnail-buffer | 882 | (image-dired--with-thumbnail-buffer |
| @@ -916,7 +916,7 @@ You probably want to use this together with | |||
| 916 | "t t" #'image-dired-tag-thumbnail | 916 | "t t" #'image-dired-tag-thumbnail |
| 917 | "t r" #'image-dired-tag-thumbnail-remove | 917 | "t r" #'image-dired-tag-thumbnail-remove |
| 918 | 918 | ||
| 919 | "RET" #'image-dired-display-thumbnail-original-image | 919 | "RET" #'image-dired-display-this |
| 920 | "C-<return>" #'image-dired-thumbnail-display-external | 920 | "C-<return>" #'image-dired-thumbnail-display-external |
| 921 | 921 | ||
| 922 | "L" #'image-dired-rotate-original-left | 922 | "L" #'image-dired-rotate-original-left |
| @@ -925,8 +925,8 @@ You probably want to use this together with | |||
| 925 | "D" #'image-dired-thumbnail-set-image-description | 925 | "D" #'image-dired-thumbnail-set-image-description |
| 926 | "S" #'image-dired-slideshow-start | 926 | "S" #'image-dired-slideshow-start |
| 927 | "C-d" #'image-dired-delete-char | 927 | "C-d" #'image-dired-delete-char |
| 928 | "SPC" #'image-dired-display-next-thumbnail-original | 928 | "SPC" #'image-dired-display-next |
| 929 | "DEL" #'image-dired-display-previous-thumbnail-original | 929 | "DEL" #'image-dired-display-previous |
| 930 | "c" #'image-dired-comment-thumbnail | 930 | "c" #'image-dired-comment-thumbnail |
| 931 | "w" #'image-dired-copy-filename-as-kill | 931 | "w" #'image-dired-copy-filename-as-kill |
| 932 | "W" #'image-dired-wallpaper-set | 932 | "W" #'image-dired-wallpaper-set |
| @@ -955,7 +955,7 @@ You probably want to use this together with | |||
| 955 | 955 | ||
| 956 | :menu | 956 | :menu |
| 957 | '("Image-Dired" | 957 | '("Image-Dired" |
| 958 | ["Display image" image-dired-display-thumbnail-original-image] | 958 | ["Display image" image-dired-display-this] |
| 959 | ["Display in external viewer" image-dired-thumbnail-display-external] | 959 | ["Display in external viewer" image-dired-thumbnail-display-external] |
| 960 | ["Jump to Dired buffer" image-dired-jump-original-dired-buffer] | 960 | ["Jump to Dired buffer" image-dired-jump-original-dired-buffer] |
| 961 | "---" | 961 | "---" |
| @@ -984,20 +984,6 @@ You probably want to use this together with | |||
| 984 | ["Refresh thumb" image-dired-refresh-thumb]) | 984 | ["Refresh thumb" image-dired-refresh-thumb]) |
| 985 | ["Quit" quit-window])) | 985 | ["Quit" quit-window])) |
| 986 | 986 | ||
| 987 | (defvar-keymap image-dired-display-image-mode-map | ||
| 988 | :doc "Keymap for `image-dired-display-image-mode'." | ||
| 989 | "S" #'image-dired-slideshow-start | ||
| 990 | "SPC" #'image-dired-display-next-thumbnail-original | ||
| 991 | "DEL" #'image-dired-display-previous-thumbnail-original | ||
| 992 | "n" #'image-dired-display-next-thumbnail-original | ||
| 993 | "p" #'image-dired-display-previous-thumbnail-original | ||
| 994 | "m" #'image-dired-mark-thumb-original-file | ||
| 995 | "d" #'image-dired-flag-thumb-original-file | ||
| 996 | "u" #'image-dired-unmark-thumb-original-file | ||
| 997 | "U" #'image-dired-unmark-all-marks | ||
| 998 | ;; Disable keybindings from `image-mode-map' that doesn't make sense here. | ||
| 999 | "o" nil) ; image-save | ||
| 1000 | |||
| 1001 | (define-derived-mode image-dired-thumbnail-mode | 987 | (define-derived-mode image-dired-thumbnail-mode |
| 1002 | special-mode "image-dired-thumbnail" | 988 | special-mode "image-dired-thumbnail" |
| 1003 | "Browse and manipulate thumbnail images using Dired. | 989 | "Browse and manipulate thumbnail images using Dired. |
| @@ -1011,7 +997,26 @@ Use `image-dired-minor-mode' to get a nice setup." | |||
| 1011 | ;; Use approximately as much vertical spacing as horizontal. | 997 | ;; Use approximately as much vertical spacing as horizontal. |
| 1012 | (setq-local line-spacing (frame-char-width))) | 998 | (setq-local line-spacing (frame-char-width))) |
| 1013 | 999 | ||
| 1014 | (define-derived-mode image-dired-display-image-mode | 1000 | |
| 1001 | ;;; image-dired-image-mode | ||
| 1002 | |||
| 1003 | (define-obsolete-variable-alias 'image-dired-display-image-mode-map | ||
| 1004 | 'image-dired-image-mode-map "29.1") | ||
| 1005 | (defvar-keymap image-dired-image-mode-map | ||
| 1006 | :doc "Keymap for `image-dired-image-mode'." | ||
| 1007 | "S" #'image-dired-slideshow-start | ||
| 1008 | "SPC" #'image-dired-display-next | ||
| 1009 | "DEL" #'image-dired-display-previous | ||
| 1010 | "n" #'image-dired-display-next | ||
| 1011 | "p" #'image-dired-display-previous | ||
| 1012 | "m" #'image-dired-mark-thumb-original-file | ||
| 1013 | "d" #'image-dired-flag-thumb-original-file | ||
| 1014 | "u" #'image-dired-unmark-thumb-original-file | ||
| 1015 | "U" #'image-dired-unmark-all-marks | ||
| 1016 | ;; Disable keybindings from `image-mode-map' that doesn't make sense here. | ||
| 1017 | "o" nil) ; image-save | ||
| 1018 | |||
| 1019 | (define-derived-mode image-dired-image-mode | ||
| 1015 | image-mode "image-dired-image-display" | 1020 | image-mode "image-dired-image-display" |
| 1016 | "Mode for displaying and manipulating original image. | 1021 | "Mode for displaying and manipulating original image. |
| 1017 | Resized or in full-size." | 1022 | Resized or in full-size." |
| @@ -1041,7 +1046,7 @@ This is used by `image-dired-slideshow-start'." | |||
| 1041 | "Step to the next image in a slideshow." | 1046 | "Step to the next image in a slideshow." |
| 1042 | (if-let ((buf (get-buffer image-dired-thumbnail-buffer))) | 1047 | (if-let ((buf (get-buffer image-dired-thumbnail-buffer))) |
| 1043 | (with-current-buffer buf | 1048 | (with-current-buffer buf |
| 1044 | (image-dired-display-next-thumbnail-original)) | 1049 | (image-dired-display-next)) |
| 1045 | (image-dired--slideshow-stop))) | 1050 | (image-dired--slideshow-stop))) |
| 1046 | 1051 | ||
| 1047 | (defun image-dired--slideshow-start-timer () | 1052 | (defun image-dired--slideshow-start-timer () |
| @@ -1063,7 +1068,7 @@ With prefix argument ARG, wait that many seconds before going to | |||
| 1063 | the next image. | 1068 | the next image. |
| 1064 | 1069 | ||
| 1065 | With a negative prefix argument, prompt user for the delay." | 1070 | With a negative prefix argument, prompt user for the delay." |
| 1066 | (interactive "P" image-dired-thumbnail-mode image-dired-display-image-mode) | 1071 | (interactive "P" image-dired-thumbnail-mode image-dired-image-mode) |
| 1067 | (let ((delay | 1072 | (let ((delay |
| 1068 | (cond ((not arg) | 1073 | (cond ((not arg) |
| 1069 | image-dired-slideshow-delay) | 1074 | image-dired-slideshow-delay) |
| @@ -1076,7 +1081,7 @@ With a negative prefix argument, prompt user for the delay." | |||
| 1076 | (format-prompt "Delay, in seconds. Decimals are accepted" | 1081 | (format-prompt "Delay, in seconds. Decimals are accepted" |
| 1077 | delay)) | 1082 | delay)) |
| 1078 | delay)))))) | 1083 | delay)))))) |
| 1079 | (image-dired-display-thumbnail-original-image) | 1084 | (image-dired-display-this) |
| 1080 | (setq image-dired--slideshow-current-delay delay) | 1085 | (setq image-dired--slideshow-current-delay delay) |
| 1081 | (add-hook 'post-command-hook 'image-dired--slideshow-stop))) | 1086 | (add-hook 'post-command-hook 'image-dired--slideshow-stop))) |
| 1082 | 1087 | ||
| @@ -1085,9 +1090,9 @@ With a negative prefix argument, prompt user for the delay." | |||
| 1085 | (message (substitute-command-keys | 1090 | (message (substitute-command-keys |
| 1086 | (format | 1091 | (format |
| 1087 | (concat | 1092 | (concat |
| 1088 | "\\[image-dired-display-next-thumbnail-original] next, " | 1093 | "\\[image-dired-display-next] next, " |
| 1089 | "\\[image-dired-display-previous-thumbnail-original] previous, " | 1094 | "\\[image-dired-display-previous] previous, " |
| 1090 | "\\[image-dired-display-thumbnail-original-image] pause/unpause, " | 1095 | "\\[image-dired-display-this] pause/unpause, " |
| 1091 | "any other command to stop%s") | 1096 | "any other command to stop%s") |
| 1092 | (or suffix ""))))) | 1097 | (or suffix ""))))) |
| 1093 | 1098 | ||
| @@ -1096,11 +1101,11 @@ With a negative prefix argument, prompt user for the delay." | |||
| 1096 | (cond | 1101 | (cond |
| 1097 | ((memq this-command | 1102 | ((memq this-command |
| 1098 | '( image-dired-slideshow-start | 1103 | '( image-dired-slideshow-start |
| 1099 | image-dired-display-next-thumbnail-original | 1104 | image-dired-display-next |
| 1100 | image-dired-display-previous-thumbnail-original)) | 1105 | image-dired-display-previous)) |
| 1101 | (image-dired--slideshow-start-timer) | 1106 | (image-dired--slideshow-start-timer) |
| 1102 | (image-dired--slideshow-show-message)) | 1107 | (image-dired--slideshow-show-message)) |
| 1103 | ((eq this-command 'image-dired-display-thumbnail-original-image) | 1108 | ((eq this-command 'image-dired-display-this) |
| 1104 | (let ((pause image-dired--slideshow-timer)) | 1109 | (let ((pause image-dired--slideshow-timer)) |
| 1105 | (if pause | 1110 | (if pause |
| 1106 | (image-dired--slideshow-stop-timer) | 1111 | (image-dired--slideshow-stop-timer) |
| @@ -1200,7 +1205,7 @@ Ask user how many thumbnails should be displayed per row." | |||
| 1200 | 1205 | ||
| 1201 | (defun image-dired-display-image (file &optional _ignored) | 1206 | (defun image-dired-display-image (file &optional _ignored) |
| 1202 | "Display image FILE in the image buffer window. | 1207 | "Display image FILE in the image buffer window. |
| 1203 | If it is an image, the window will use `image-dired-display-image-mode' | 1208 | If it is an image, the window will use `image-dired-image-mode' |
| 1204 | which is based on `image-mode'." | 1209 | which is based on `image-mode'." |
| 1205 | (declare (advertised-calling-convention (file) "29.1")) | 1210 | (declare (advertised-calling-convention (file) "29.1")) |
| 1206 | (setq file (expand-file-name file)) | 1211 | (setq file (expand-file-name file)) |
| @@ -1214,12 +1219,12 @@ which is based on `image-mode'." | |||
| 1214 | (pop-to-buffer buf) | 1219 | (pop-to-buffer buf) |
| 1215 | (rename-buffer image-dired-display-image-buffer) | 1220 | (rename-buffer image-dired-display-image-buffer) |
| 1216 | (if (string-match (image-file-name-regexp) file) | 1221 | (if (string-match (image-file-name-regexp) file) |
| 1217 | (image-dired-display-image-mode) | 1222 | (image-dired-image-mode) |
| 1218 | ;; Support visiting PDF files. | 1223 | ;; Support visiting PDF files. |
| 1219 | (normal-mode)) | 1224 | (normal-mode)) |
| 1220 | (select-window cur-win)))) | 1225 | (select-window cur-win)))) |
| 1221 | 1226 | ||
| 1222 | (defun image-dired-display-thumbnail-original-image (&optional arg) | 1227 | (defun image-dired-display-this (&optional arg) |
| 1223 | "Display current thumbnail's original image in display buffer. | 1228 | "Display current thumbnail's original image in display buffer. |
| 1224 | See documentation for `image-dired-display-image' for more information. | 1229 | See documentation for `image-dired-display-image' for more information. |
| 1225 | With prefix argument ARG, display image in its original size." | 1230 | With prefix argument ARG, display image in its original size." |
| @@ -1234,19 +1239,19 @@ With prefix argument ARG, display image in its original size." | |||
| 1234 | (t | 1239 | (t |
| 1235 | (image-dired-display-image file arg))))) | 1240 | (image-dired-display-image file arg))))) |
| 1236 | 1241 | ||
| 1237 | (defun image-dired-display-next-thumbnail-original (&optional arg) | 1242 | (defun image-dired-display-next (&optional arg) |
| 1238 | "Move to the next image in the thumbnail buffer and display it. | 1243 | "Move to the next image in the thumbnail buffer and display it. |
| 1239 | With prefix ARG, move that many thumbnails." | 1244 | With prefix ARG, move that many thumbnails." |
| 1240 | (interactive "p" image-dired-thumbnail-mode image-dired-display-image-mode) | 1245 | (interactive "p" image-dired-thumbnail-mode image-dired-image-mode) |
| 1241 | (image-dired--with-thumbnail-buffer | 1246 | (image-dired--with-thumbnail-buffer |
| 1242 | (image-dired-forward-image arg t) | 1247 | (image-dired-forward-image arg t) |
| 1243 | (image-dired-display-thumbnail-original-image))) | 1248 | (image-dired-display-this))) |
| 1244 | 1249 | ||
| 1245 | (defun image-dired-display-previous-thumbnail-original (arg) | 1250 | (defun image-dired-display-previous (arg) |
| 1246 | "Move to the previous image in the thumbnail buffer and display it. | 1251 | "Move to the previous image in the thumbnail buffer and display it. |
| 1247 | With prefix ARG, move that many thumbnails." | 1252 | With prefix ARG, move that many thumbnails." |
| 1248 | (interactive "p" image-dired-thumbnail-mode image-dired-display-image-mode) | 1253 | (interactive "p" image-dired-thumbnail-mode image-dired-image-mode) |
| 1249 | (image-dired-display-next-thumbnail-original (- arg))) | 1254 | (image-dired-display-next (- arg))) |
| 1250 | 1255 | ||
| 1251 | 1256 | ||
| 1252 | ;;; Misc commands | 1257 | ;;; Misc commands |
| @@ -1525,7 +1530,7 @@ completely fit)." | |||
| 1525 | (defun image-dired-toggle-mark-thumb-original-file () | 1530 | (defun image-dired-toggle-mark-thumb-original-file () |
| 1526 | "Toggle mark on original image file in associated Dired buffer." | 1531 | "Toggle mark on original image file in associated Dired buffer." |
| 1527 | (declare (obsolete nil "29.1")) | 1532 | (declare (obsolete nil "29.1")) |
| 1528 | (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode) | 1533 | (interactive nil image-dired-thumbnail-mode image-dired-image-mode) |
| 1529 | (image-dired--do-mark-command nil t | 1534 | (image-dired--do-mark-command nil t |
| 1530 | (if (image-dired-dired-file-marked-p) | 1535 | (if (image-dired-dired-file-marked-p) |
| 1531 | (dired-unmark 1) | 1536 | (dired-unmark 1) |
| @@ -1963,6 +1968,14 @@ when using per-directory thumbnail file storage")) | |||
| 1963 | #'image-dired--update-header-line "29.1") | 1968 | #'image-dired--update-header-line "29.1") |
| 1964 | (define-obsolete-function-alias 'image-dired-delete-marked | 1969 | (define-obsolete-function-alias 'image-dired-delete-marked |
| 1965 | #'image-dired-do-flagged-delete "29.1") | 1970 | #'image-dired-do-flagged-delete "29.1") |
| 1971 | (define-obsolete-function-alias 'image-dired-display-image-mode | ||
| 1972 | #'image-dired-image-mode "29.1") | ||
| 1973 | (define-obsolete-function-alias 'image-dired-display-thumbnail-original-image | ||
| 1974 | #'image-dired-display-this "29.1") | ||
| 1975 | (define-obsolete-function-alias 'image-dired-display-next-thumbnail-original | ||
| 1976 | #'image-dired-display-next "29.1") | ||
| 1977 | (define-obsolete-function-alias 'image-dired-display-previous-thumbnail-original | ||
| 1978 | #'image-dired-display-previous "29.1") | ||
| 1966 | 1979 | ||
| 1967 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1980 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1968 | ;;;;;;;;; TEST-SECTION ;;;;;;;;;;; | 1981 | ;;;;;;;;; TEST-SECTION ;;;;;;;;;;; |