commit a3dd5f1216f76d82fbb8f59bf016c2dab714eb72 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Aug 14 10:35:09 2021 +0300 ; * etc/NEWS: Improve wording of a recent addition. diff --git a/etc/NEWS b/etc/NEWS index b40c2bd8f9..19eddb7277 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2341,7 +2341,8 @@ a list. --- *** New face 'diff-changed-unspecified'. -This is used when 'diff-use-changed-face' is non-nil. +This is used to highlight "changed" lines (those marked with '!') in +context diffs, when 'diff-use-changed-face' is non-nil. --- *** New 'diff-mode' font locking face 'diff-error'. commit 254dc6ab4ca8e6a549a795f9eaf45378ce51b61f Author: Alan Mackenzie Date: Fri Aug 13 20:58:30 2021 +0000 CC Mode: Fix a bug in yesterday's patch * lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Check the language has multi-line strings before calling c-ml-string-opener-at-or-around-point. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index a5df8449ea..057d292246 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1526,6 +1526,7 @@ Note that the style variables are always made local to the buffer." (unless (or (and ;; Don't set c-new-BEG/END if we're in an ml string. + c-ml-string-opener-re (eq beg-literal-type 'string) (c-ml-string-opener-at-or-around-point (car beg-limits))) (and c-multiline-string-start-char commit 8fbb8700831742c28d351e4fd79373dea0002649 Author: Lars Ingebrigtsen Date: Fri Aug 13 15:50:14 2021 +0200 Make `debug' reset `inhibit-read-only' while running * lisp/emacs-lisp/debug.el (debug): Bind `inhibit-read-only' to nil in case we're in a context that has bound it to t (bug#26947). diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 069c7a90ad..2007f79634 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -182,7 +182,11 @@ the debugger will not be entered." (equal "initial_terminal" (terminal-name))))) ;; Don't let `inhibit-message' get in our way (especially important if ;; `non-interactive-frame' evaluated to a non-nil value. - (inhibit-message nil)) + (inhibit-message nil) + ;; We may be entering the debugger from a context that has + ;; let-bound `inhibit-read-only', which means that all + ;; buffers would be read/write while the debugger is running. + (inhibit-read-only nil)) (unless non-interactive-frame (message "Entering debugger...")) (let (debugger-value commit e30c7f314b67656c9a946b7a6bc045c5f76814d6 Author: Lars Ingebrigtsen Date: Fri Aug 13 15:37:21 2021 +0200 Adjust previous diff-changed-unspecified change * lisp/vc/diff-mode.el (diff-changed-unspecified): Adjust the definition to Emacs 28 (bug#26969). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 1d838e6628..bb1c46c070 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -358,12 +358,14 @@ well." "`diff-mode' face used to highlight added lines.") (defface diff-changed-unspecified - '((((class color) (min-colors 88) (background light)) - :background "grey90") + '((default + :inherit diff-changed) + (((class color) (min-colors 88) (background light)) + :background "grey90" :extend t) (((class color) (min-colors 88) (background dark)) - :background "grey20") + :background "grey20" :extend t) (((class color)) - :foreground "grey")) + :foreground "grey" :extend t)) "`diff-mode' face used to highlight changed lines." :version "28.1") commit 4d51c2c472963d6330925c06d59f16de370c6474 Author: Lars Ingebrigtsen Date: Fri Aug 13 15:35:49 2021 +0200 Add new face diff-changed-unspecified * lisp/vc/diff-mode.el (diff-changed-unspecified): New face. (diff-font-lock-keywords): Use it (bug#26969). diff --git a/etc/NEWS b/etc/NEWS index 26ede71523..b40c2bd8f9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2339,6 +2339,10 @@ a list. ** Diff +--- +*** New face 'diff-changed-unspecified'. +This is used when 'diff-use-changed-face' is non-nil. + --- *** New 'diff-mode' font locking face 'diff-error'. This face is used for error messages from 'diff'. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 4652afa1f9..1d838e6628 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -357,6 +357,16 @@ well." :foreground "green" :extend t)) "`diff-mode' face used to highlight added lines.") +(defface diff-changed-unspecified + '((((class color) (min-colors 88) (background light)) + :background "grey90") + (((class color) (min-colors 88) (background dark)) + :background "grey20") + (((class color)) + :foreground "grey")) + "`diff-mode' face used to highlight changed lines." + :version "28.1") + (defface diff-changed '((t nil)) "`diff-mode' face used to highlight changed lines." @@ -436,9 +446,10 @@ well." (defvar diff-use-changed-face (and (face-differs-from-default-p 'diff-changed) (not (face-equal 'diff-changed 'diff-added)) (not (face-equal 'diff-changed 'diff-removed))) - "If non-nil, use the face `diff-changed' for changed lines in context diffs. -Otherwise, use the face `diff-removed' for removed lines, -and the face `diff-added' for added lines.") + "Controls how changed lines are fontified in context diffs. +If non-nil, use the face `diff-changed-unspecified'. Otherwise, +use the face `diff-removed' for removed lines, and the face +`diff-added' for added lines.") (defvar diff-font-lock-keywords `((,(concat "\\(" diff-hunk-header-re-unified "\\)\\(.*\\)$") @@ -470,7 +481,7 @@ and the face `diff-added' for added lines.") diff-indicator-added-face diff-indicator-removed-face))))) (2 (if diff-use-changed-face - 'diff-changed + 'diff-changed-unspecified ;; Otherwise, use the same method as above. (save-match-data (let ((limit (save-excursion (diff-beginning-of-hunk)))) commit cebe18b63e1eb06f8b2ccfcdfa4dcf98ceb21503 Author: Lars Ingebrigtsen Date: Fri Aug 13 14:44:30 2021 +0200 permanently-enabled-local-variables doc string clarification * lisp/files.el (permanently-enabled-local-variables): Clarify what kind of local variables this refers to. diff --git a/lisp/files.el b/lisp/files.el index 775d871dd7..875ac55316 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3601,7 +3601,7 @@ This hook is called only if there is at least one file-local variable to set.") (defvar permanently-enabled-local-variables '(lexical-binding) - "A list of local variables that are always enabled. + "A list of file-local variables that are always enabled. This overrides any `enable-local-variables' setting.") (defun hack-local-variables-confirm (all-vars unsafe-vars risky-vars dir-name) commit 711eb40b9b9e2aabd0e23ec264e8e8f913329d33 Author: Lars Ingebrigtsen Date: Fri Aug 13 13:38:38 2021 +0200 Make info-look search harder for the Python info file * lisp/info-look.el (python-mode): Try harder to find the correct info file (bug#31405). diff --git a/lisp/info-look.el b/lisp/info-look.el index 19c5537e74..33f15a34e9 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -43,6 +43,7 @@ (require 'info) (eval-when-compile (require 'subr-x)) +(eval-when-compile (require 'cl-lib)) (defgroup info-lookup nil "Major mode sensitive help agent." @@ -902,9 +903,13 @@ Return nil if there is nothing appropriate in the buffer near point." (info-lookup-maybe-add-help :mode 'python-mode - :doc-spec `((,(if (Info-find-file "python3.9" t) - "(python3.9)Index" - "(python)Index")))) + ;; Debian includes Python info files, but they're version-named + ;; instead of having a symlink. + :doc-spec `((,(cl-loop for version from 20 downto 7 + for name = (format "python3.%d" version) + if (Info-find-file name t) + return (format "(%s)Index" name) + finally return "(python)Index")))) (info-lookup-maybe-add-help :mode 'cperl-mode commit 65dd00667ff060cf79fea4b49bfa4d8f7a16ee1f Author: Lars Ingebrigtsen Date: Fri Aug 13 13:19:39 2021 +0200 Fix problem where an error would change standard-output * src/keyboard.c (cmd_error): Don't set standard-output/standard-input (bug#30529). Instead bind them temporarily while handling the error. diff --git a/src/keyboard.c b/src/keyboard.c index 820229cf8f..2e4c4e6aab 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -924,6 +924,7 @@ static Lisp_Object cmd_error (Lisp_Object data) { Lisp_Object old_level, old_length; + ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object conditions; char macroerror[sizeof "After..kbd macro iterations: " + INT_STRLEN_BOUND (EMACS_INT)]; @@ -951,8 +952,8 @@ cmd_error (Lisp_Object data) executing_kbd_macro = Qnil; } - Vstandard_output = Qt; - Vstandard_input = Qt; + specbind (Qstandard_output, Qt); + specbind (Qstandard_input, Qt); kset_prefix_arg (current_kboard, Qnil); kset_last_prefix_arg (current_kboard, Qnil); cancel_echoing (); @@ -969,6 +970,7 @@ cmd_error (Lisp_Object data) Vquit_flag = Qnil; Vinhibit_quit = Qnil; + unbind_to (count, Qnil); return make_fixnum (0); } commit 37dbf108938113d1b65912661a0470e5d660e15a Author: Lars Ingebrigtsen Date: Fri Aug 13 13:06:33 2021 +0200 Unknown line endings in filepos-to-bufferpos/bufferpos-to-linepos * lisp/international/mule-util.el (filepos-to-bufferpos): Give better errors on `exact' with unknown line endings, and guess at Unix if `approximate' (bug#36573). (bufferpos-to-filepos): Ditto. diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 55449599fe..38d29cb238 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -333,13 +333,20 @@ QUALITY can be: `approximate', in which case we may cut some corners to avoid excessive work. `exact', in which case we may end up re-(en/de)coding a large - part of the file/buffer, this can be expensive and slow. + part of the file/buffer, this can be expensive and slow. (It + is an error to request the `exact' method when the buffer's + EOL format is not yet decided.) nil, in which case we may return nil rather than an approximation." (unless coding-system (setq coding-system buffer-file-coding-system)) (let ((eol (coding-system-eol-type coding-system)) (type (coding-system-type coding-system)) (base (coding-system-base coding-system)) (pm (save-restriction (widen) (point-min)))) + ;; Handle EOL edge cases. + (unless (numberp eol) + (if (eq quality 'exact) + (error "Unknown EOL format in coding system: %s" coding-system) + (setq eol 0))) (and (eq type 'utf-8) ;; Any post-read/pre-write conversions mean it's not really UTF-8. (not (null (coding-system-get coding-system :post-read-conversion))) @@ -409,14 +416,24 @@ QUALITY can be: `approximate', in which case we may cut some corners to avoid excessive work. `exact', in which case we may end up re-(en/de)coding a large - part of the file/buffer, this can be expensive and slow. + part of the file/buffer, this can be expensive and slow. (It + is an error to request the `exact' method when the buffer's + EOL format is not yet decided.) nil, in which case we may return nil rather than an approximation." (unless coding-system (setq coding-system buffer-file-coding-system)) (let* ((eol (coding-system-eol-type coding-system)) - (lineno (if (= eol 1) (1- (line-number-at-pos position)) 0)) (type (coding-system-type coding-system)) (base (coding-system-base coding-system)) - (point-min 1)) ;Clarify what the `1' means. + (point-min 1) ;Clarify what the `1' means. + lineno) + ;; Handle EOL edge cases. + (unless (numberp eol) + (if (eq quality 'exact) + (error "Unknown EOL format in coding system: %s" coding-system) + (setq eol 0))) + (setq lineno (if (= eol 1) + (1- (line-number-at-pos position)) + 0)) (and (eq type 'utf-8) ;; Any post-read/pre-write conversions mean it's not really UTF-8. (not (null (coding-system-get coding-system :post-read-conversion))) diff --git a/test/lisp/international/mule-util-resources/utf-8.txt b/test/lisp/international/mule-util-resources/utf-8.txt new file mode 100644 index 0000000000..385bbb4ba8 --- /dev/null +++ b/test/lisp/international/mule-util-resources/utf-8.txt @@ -0,0 +1,2 @@ +Thís is a test line 1. +Line 2. diff --git a/test/lisp/international/mule-util-tests.el b/test/lisp/international/mule-util-tests.el index 6518be66db..0fcff9d02d 100644 --- a/test/lisp/international/mule-util-tests.el +++ b/test/lisp/international/mule-util-tests.el @@ -22,6 +22,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'mule-util) (defconst mule-util-test-truncate-data @@ -82,4 +83,43 @@ (dotimes (i (length mule-util-test-truncate-data)) (mule-util-test-truncate-create i)) +(ert-deftest filepos/bufferpos-tests-utf-8 () + (let ((coding-system-for-read 'utf-8-unix)) + (with-temp-buffer + (insert-file-contents (ert-resource-file "utf-8.txt")) + (should (eq buffer-file-coding-system 'utf-8-unix)) + ;; First line is "Thís is a test line 1.". + ;; Bytes start counting at 0; chars at 1. + (should (= (filepos-to-bufferpos 1 'exact) 2)) + (should (= (bufferpos-to-filepos 2 'exact) 1)) + ;; After non-ASCII. + (should (= (filepos-to-bufferpos 4 'exact) 4)) + (should (= (bufferpos-to-filepos 4 'exact) 4))))) + +(ert-deftest filepos/bufferpos-tests-binary () + (let ((coding-system-for-read 'binary)) + (with-temp-buffer + (insert-file-contents (ert-resource-file "utf-8.txt")) + (should (eq buffer-file-coding-system 'no-conversion)) + ;; First line is "Thís is a test line 1.". + ;; Bytes start counting at 0; chars at 1. + (should (= (filepos-to-bufferpos 1 'exact) 2)) + (should (= (bufferpos-to-filepos 2 'exact) 1)) + ;; After non-ASCII. + (should (= (filepos-to-bufferpos 4 'exact) 5)) + (should (= (bufferpos-to-filepos 5 'exact) 4))))) + +(ert-deftest filepos/bufferpos-tests-undecided () + (let ((coding-system-for-read 'binary)) + (with-temp-buffer + (insert-file-contents (ert-resource-file "utf-8.txt")) + (setq buffer-file-coding-system 'undecided) + (should-error (filepos-to-bufferpos 1 'exact)) + (should-error (bufferpos-to-filepos 2 'exact)) + (should (= (filepos-to-bufferpos 1 'approximate) 2)) + (should (= (bufferpos-to-filepos 2 'approximate) 1)) + ;; After non-ASCII. + (should (= (filepos-to-bufferpos 4 'approximate) 5)) + (should (= (bufferpos-to-filepos 5 'approximate) 4))))) + ;;; mule-util-tests.el ends here commit 62475407231a6504608286cd8632d6940e1d5e6c Author: Lars Ingebrigtsen Date: Fri Aug 13 12:28:55 2021 +0200 Remove :group from defcustoms in image-dired.el * lisp/image-dired.el: Remove :group from the defcustoms throughout. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 3c59ef95b5..7092f758db 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -164,8 +164,7 @@ (defcustom image-dired-dir (locate-user-emacs-file "image-dired/") "Directory where thumbnail images are stored." - :type 'directory - :group 'image-dired) + :type 'directory) (defcustom image-dired-thumbnail-storage 'use-image-dired-dir "How to store image-dired's thumbnail files. @@ -181,51 +180,44 @@ that allows sharing of thumbnails across different programs." (const :tag "Use image-dired-dir" use-image-dired-dir) (const :tag "Thumbnail Managing Standard (normal 128x128)" standard) (const :tag "Thumbnail Managing Standard (large 256x256)" standard-large) - (const :tag "Per-directory" per-directory)) - :group 'image-dired) + (const :tag "Per-directory" per-directory))) (defcustom image-dired-db-file (expand-file-name ".image-dired_db" image-dired-dir) "Database file where file names and their associated tags are stored." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-temp-image-file (expand-file-name ".image-dired_temp" image-dired-dir) "Name of temporary image file used by various commands." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-gallery-dir (expand-file-name ".image-dired_gallery" image-dired-dir) "Directory to store generated gallery html pages. This path needs to be \"shared\" to the public so that it can access the index.html page that image-dired creates." - :type 'directory - :group 'image-dired) + :type 'directory) (defcustom image-dired-gallery-image-root-url "https://your.own.server/image-diredpics" "URL where the full size images are to be found. Note that this path has to be configured in your web server. Image-Dired expects to find pictures in this directory." - :type 'string - :group 'image-dired) + :type 'string) (defcustom image-dired-gallery-thumb-image-root-url "https://your.own.server/image-diredthumbs" "URL where the thumbnail images are to be found. Note that this path has to be configured in your web server. Image-Dired expects to find pictures in this directory." - :type 'string - :group 'image-dired) + :type 'string) (defcustom image-dired-cmd-create-thumbnail-program "convert" "Executable used to create thumbnail. Used together with `image-dired-cmd-create-thumbnail-options'." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-create-thumbnail-options '("-size" "%wx%h" "%f[0]" "-resize" "%wx%h>" "-strip" "jpeg:%t") @@ -236,14 +228,12 @@ Available format specifiers are: %w which is replaced by %f which is replaced by the file name of the original image and %t which is replaced by the file name of the thumbnail file." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-create-temp-image-program "convert" "Executable used to create temporary image. Used together with `image-dired-cmd-create-temp-image-options'." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-create-temp-image-options '("-size" "%wx%h" "%f[0]" "-resize" "%wx%h>" "-strip" "jpeg:%t") @@ -254,8 +244,7 @@ the calculated max size for width and height in the image display window, %f which is replaced by the file name of the original image and %t which is replaced by the file name of the temporary file." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-pngnq-program (or (executable-find "pngnq") @@ -264,8 +253,7 @@ is replaced by the file name of the temporary file." It quantizes colors of PNG images down to 256 colors or fewer using the NeuQuant algorithm." :version "26.1" - :type '(choice (const :tag "Not Set" nil) file) - :group 'image-dired) + :type '(choice (const :tag "Not Set" nil) file)) (defcustom image-dired-cmd-pngnq-options '("-f" "%t") @@ -273,15 +261,13 @@ using the NeuQuant algorithm." Available format specifiers are the same as in `image-dired-cmd-create-thumbnail-options'." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-pngcrush-program (executable-find "pngcrush") "The file name of the `pngcrush' program. It optimizes the compression of PNG images. Also it adds PNG textual chunks with the information required by the Thumbnail Managing Standard." - :type '(choice (const :tag "Not Set" nil) file) - :group 'image-dired) + :type '(choice (const :tag "Not Set" nil) file)) (defcustom image-dired-cmd-pngcrush-options `("-q" @@ -299,14 +285,12 @@ Available format specifiers are the same as in `image-dired-cmd-create-thumbnail-options', with %q for a temporary file name (typically generated by pnqnq)." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-optipng-program (executable-find "optipng") "The file name of the `optipng' program." :version "26.1" - :type '(choice (const :tag "Not Set" nil) file) - :group 'image-dired) + :type '(choice (const :tag "Not Set" nil) file)) (defcustom image-dired-cmd-optipng-options '("-o5" "%t") "Arguments passed to `image-dired-cmd-optipng-program'. @@ -314,8 +298,7 @@ Available format specifiers are described in `image-dired-cmd-create-thumbnail-options'." :version "26.1" :type '(repeat (string :tag "Argument")) - :link '(url-link "man:optipng(1)") - :group 'image-dired) + :link '(url-link "man:optipng(1)")) (defcustom image-dired-cmd-create-standard-thumbnail-options (append '("-size" "%wx%h" "%f[0]") @@ -331,15 +314,13 @@ Available format specifiers are described in Available format specifiers are the same as in `image-dired-cmd-create-thumbnail-options', with %m for file modification time." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-rotate-thumbnail-program "mogrify" "Executable used to rotate thumbnail. Used together with `image-dired-cmd-rotate-thumbnail-options'." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-rotate-thumbnail-options '("-rotate" "%d" "%t") @@ -350,15 +331,13 @@ number of (positive) degrees to rotate the image, normally 90 or 270 \(for 90 degrees right and left), %t which is replaced by the file name of the thumbnail file." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (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 - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-rotate-original-options '("-rotate" "%d" "-copy" "all" "-outfile" "%t" "%o") @@ -370,28 +349,24 @@ number of (positive) degrees to rotate the image, normally 90 or original image file name and %t which is replaced by `image-dired-temp-image-file'." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-temp-rotate-image-file (expand-file-name ".image-dired_rotate_temp" image-dired-dir) "Temporary file for rotate operations." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-rotate-original-ask-before-overwrite t "Confirm overwrite of original file after rotate operation. If non-nil, ask user for confirmation before overwriting the original file with `image-dired-temp-rotate-image-file'." - :type 'boolean - :group 'image-dired) + :type 'boolean) (defcustom image-dired-cmd-write-exif-data-program "exiftool" "Program used to write EXIF data to image. Used together with `image-dired-cmd-write-exif-data-options'." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-write-exif-data-options '("-%t=%v" "%f") @@ -401,15 +376,13 @@ Available format specifiers are: %f which is replaced by the image file name, %t which is replaced by the tag name and %v which is replaced by the tag value." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-cmd-read-exif-data-program "exiftool" "Program used to read EXIF data to image. Used together with `image-dired-cmd-read-exif-data-options'." - :type 'file - :group 'image-dired) + :type 'file) (defcustom image-dired-cmd-read-exif-data-options '("-s" "-s" "-s" "-%t" "%f") @@ -418,15 +391,13 @@ Used with `image-dired-cmd-read-exif-data-program'. Available format specifiers are: %f which is replaced by the image file name and %t which is replaced by the tag name." :version "26.1" - :type '(repeat (string :tag "Argument")) - :group 'image-dired) + :type '(repeat (string :tag "Argument"))) (defcustom image-dired-gallery-hidden-tags (list "private" "hidden" "pending") "List of \"hidden\" tags. Used by `image-dired-gallery-generate' to leave out \"hidden\" images." - :type '(repeat string) - :group 'image-dired) + :type '(repeat string)) (defcustom image-dired-thumb-size (cond @@ -436,29 +407,24 @@ Used by `image-dired-gallery-generate' to leave out \"hidden\" images." "Size of thumbnails, in pixels. This is the default size for both `image-dired-thumb-width' and `image-dired-thumb-height'." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-thumb-width image-dired-thumb-size "Width of thumbnails, in pixels." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-thumb-height image-dired-thumb-size "Height of thumbnails, in pixels." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-thumb-relief 2 "Size of button-like border around thumbnails." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-thumb-margin 2 "Size of the margin around thumbnails. This is where you see the cursor." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-thumb-visible-marks t "Make marks visible in thumbnail buffer. @@ -484,34 +450,29 @@ and No line-up means that no automatic line-up will be done." (const :tag "Dynamic" dynamic) (const :tag "Fixed" fixed) (const :tag "Interactive" interactive) - (const :tag "No line-up" none)) - :group 'image-dired) + (const :tag "No line-up" none))) (defcustom image-dired-thumbs-per-row 3 "Number of thumbnails to display per row in thumb buffer." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-display-window-width-correction 1 "Number to be used to correct image display window width. Change if the default (1) does not work (i.e. if the image does not completely fit)." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-display-window-height-correction 0 "Number to be used to correct image display window height. Change if the default (0) does not work (i.e. if the image does not completely fit)." - :type 'integer - :group 'image-dired) + :type 'integer) (defcustom image-dired-track-movement t "The current state of the tracking and mirroring. For more information, see the documentation for `image-dired-toggle-movement-tracking'." - :type 'boolean - :group 'image-dired) + :type 'boolean) (defcustom image-dired-append-when-browsing nil "Append thumbnails in thumbnail buffer when browsing. @@ -521,8 +482,7 @@ images in the thumbnail buffer. If you enable this and want to clean the thumbnail buffer because it is filled with too many thumbnails, just call `image-dired-display-thumb' to display only the image at point. This value can be toggled using `image-dired-toggle-append-browsing'." - :type 'boolean - :group 'image-dired) + :type 'boolean) (defcustom image-dired-dired-disp-props t "If non-nil, display properties for dired file when browsing. @@ -530,16 +490,14 @@ Used by `image-dired-next-line-and-display', `image-dired-previous-line-and-display' and `image-dired-mark-and-display-next'. If the database file is large, this can slow down image browsing in dired and you might want to turn it off." - :type 'boolean - :group 'image-dired) + :type 'boolean) (defcustom image-dired-display-properties-format "%b: %f (%t): %c" "Display format for thumbnail properties. %b is replaced with associated dired buffer name, %f with file name \(without path) of original image file, %t with the list of tags and %c with the comment." - :type 'string - :group 'image-dired) + :type 'string) (defcustom image-dired-external-viewer ;; TODO: Use mailcap, dired-guess-shell-alist-default, @@ -552,20 +510,17 @@ Including parameters. Used when displaying original image from `image-dired-thumbnail-mode'." :version "27.1" :type '(choice string - (const :tag "Not Set" nil)) - :group 'image-dired) + (const :tag "Not Set" nil))) (defcustom image-dired-main-image-directory "~/pics/" "Name of main image directory, if any. Used by `image-dired-copy-with-exif-file-name'." - :type 'string - :group 'image-dired) + :type 'string) (defcustom image-dired-show-all-from-dir-max-files 50 "Maximum number of files to show using `image-dired-show-all-from-dir' before warning the user." - :type 'integer - :group 'image-dired) + :type 'integer) (defmacro image-dired--with-db-file (&rest body) "Run BODY in a temp buffer containing `image-dired-db-file'. @@ -1648,7 +1603,6 @@ You probably want to use this together with special-mode "image-dired-thumbnail" "Browse and manipulate thumbnail images using dired. Use `image-dired-minor-mode' to get a nice setup." - :group 'image-dired (buffer-disable-undo) (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) @@ -1656,7 +1610,6 @@ Use `image-dired-minor-mode' to get a nice setup." special-mode "image-dired-image-display" "Mode for displaying and manipulating original image. Resized or in full-size." - :group 'image-dired (buffer-disable-undo) (image-mode-setup-winprops) (setq cursor-type nil) commit 6fd2a4933597776e80b6beb2538a478f1f3c5e8b Author: Peter Münster Date: Fri Aug 13 12:25:27 2021 +0200 Don't disable transient mark mode when changing image faces * lisp/image-dired.el (image-dired-thumb-update-marks): Keep the mark state when changing faces. (bug#49999). diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 76c7ae91f0..3c59ef95b5 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -2360,20 +2360,18 @@ non-nil." (defun image-dired-thumb-update-marks () "Update the marks in the thumbnail buffer." - ;; TODO: only called by image-dired-mouse-toggle-mark but there are - ;; certainly other places, where it should be called too. (when image-dired-thumb-visible-marks (with-current-buffer image-dired-thumbnail-buffer - (save-excursion + (save-mark-and-excursion (goto-char (point-min)) (let ((inhibit-read-only t)) (while (not (eobp)) - (if (image-dired-thumb-file-marked-p) - (add-face-text-property - (point) (1+ (point)) - 'image-dired-thumb-mark) - (remove-text-properties (point) (1+ (point)) - '(face image-dired-thumb-mark))) + (with-silent-modifications + (if (image-dired-thumb-file-marked-p) + (add-face-text-property (point) (1+ (point)) + 'image-dired-thumb-mark) + (remove-text-properties (point) (1+ (point)) + '(face image-dired-thumb-mark)))) (forward-char))))))) (defun image-dired-mouse-toggle-mark-1 ()