mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-05 19:31:02 -08:00
Improve error handling in dired-change-marks
* lisp/dired.el (dired-change-marks): Signal user-error if mark character is invalid. Catch more invalid characters. (Bug#29842)
This commit is contained in:
parent
3d81d2326a
commit
e5e31aab9b
1 changed files with 15 additions and 13 deletions
|
|
@ -3868,19 +3868,21 @@ OLD and NEW are both characters used to mark files."
|
||||||
(new (progn (message "Change %c marks to (new mark): " old)
|
(new (progn (message "Change %c marks to (new mark): " old)
|
||||||
(read-char))))
|
(read-char))))
|
||||||
(list old new)))
|
(list old new)))
|
||||||
(if (or (eq old ?\r) (eq new ?\r))
|
(dolist (c (list new old))
|
||||||
(ding)
|
(if (or (not (char-displayable-p c))
|
||||||
(let ((string (format "\n%c" old))
|
(eq c ?\r))
|
||||||
(inhibit-read-only t))
|
(user-error "Invalid mark character: `%c'" c)))
|
||||||
(save-excursion
|
(let ((string (format "\n%c" old))
|
||||||
(goto-char (point-min))
|
(inhibit-read-only t))
|
||||||
(while (search-forward string nil t)
|
(save-excursion
|
||||||
(if (if (= old ?\s)
|
(goto-char (point-min))
|
||||||
(save-match-data
|
(while (search-forward string nil t)
|
||||||
(dired-get-filename 'no-dir t))
|
(if (if (= old ?\s)
|
||||||
t)
|
(save-match-data
|
||||||
(subst-char-in-region (match-beginning 0)
|
(dired-get-filename 'no-dir t))
|
||||||
(match-end 0) old new)))))))
|
t)
|
||||||
|
(subst-char-in-region (match-beginning 0)
|
||||||
|
(match-end 0) old new))))))
|
||||||
|
|
||||||
(defun dired-unmark-all-marks ()
|
(defun dired-unmark-all-marks ()
|
||||||
"Remove all marks from all files in the Dired buffer."
|
"Remove all marks from all files in the Dired buffer."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue