From e4e02841022e445562e1b2d6901eb52ceca2d603 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 4 Jun 1993 07:25:58 +0000 Subject: [PATCH] (dired-change-marks): Just ding if one arg is RET. Search for strings, not regexps. Use subst-char-in-region. --- lisp/dired.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 4f431c703db..6dacbbd3db5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1750,14 +1750,15 @@ OLD and NEW are both characters used to mark files." (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.