Mercurial > emacs
changeset 3478:a917a964bef8
(dired-change-marks): Just ding if one arg is RET.
Search for strings, not regexps. Use subst-char-in-region.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 04 Jun 1993 07:25:58 +0000 |
parents | c079a2d6cf0e |
children | 7cda082508c9 |
files | lisp/dired.el |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/dired.el Fri Jun 04 07:14:47 1993 +0000 +++ b/lisp/dired.el Fri Jun 04 07:25:58 1993 +0000 @@ -1750,14 +1750,15 @@ (new (progn (message "Change %c marks to (new mark): " old) (read-char)))) (list old new))) - (let ((regexp (format "^%s" (regexp-quote old))) - (buffer-read-only)) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward regexp nil t) - (beginning-of-line) - (delete-region (point) (1+ (point))) - (insert-char new 1))))) + (if (or (eq old ?\r) (eq new ?\r)) + (ding) + (let ((string (format "\n%c" old)) + (buffer-read-only)) + (save-excursion + (goto-char (point-min)) + (while (search-forward string nil t) + (subst-char-in-region (match-beginning 0) + (match-end 0) old new)))))) (defun dired-unmark-all-files (mark &optional arg) "Remove a specific mark or any mark from every file.