diff options
| author | Richard M. Stallman | 1993-06-04 07:25:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-04 07:25:58 +0000 |
| commit | e4e02841022e445562e1b2d6901eb52ceca2d603 (patch) | |
| tree | 37dfa79bd10fa95f428ea3b90a335b9e35fd5572 | |
| parent | 47c0f58be5c3efbc54c36bc803453e87c67303f0 (diff) | |
| download | emacs-e4e02841022e445562e1b2d6901eb52ceca2d603.tar.gz emacs-e4e02841022e445562e1b2d6901eb52ceca2d603.zip | |
(dired-change-marks): Just ding if one arg is RET.
Search for strings, not regexps. Use subst-char-in-region.
| -rw-r--r-- | lisp/dired.el | 17 |
1 files 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." | |||
| 1750 | (new (progn (message "Change %c marks to (new mark): " old) | 1750 | (new (progn (message "Change %c marks to (new mark): " old) |
| 1751 | (read-char)))) | 1751 | (read-char)))) |
| 1752 | (list old new))) | 1752 | (list old new))) |
| 1753 | (let ((regexp (format "^%s" (regexp-quote old))) | 1753 | (if (or (eq old ?\r) (eq new ?\r)) |
| 1754 | (buffer-read-only)) | 1754 | (ding) |
| 1755 | (save-excursion | 1755 | (let ((string (format "\n%c" old)) |
| 1756 | (goto-char (point-min)) | 1756 | (buffer-read-only)) |
| 1757 | (while (re-search-forward regexp nil t) | 1757 | (save-excursion |
| 1758 | (beginning-of-line) | 1758 | (goto-char (point-min)) |
| 1759 | (delete-region (point) (1+ (point))) | 1759 | (while (search-forward string nil t) |
| 1760 | (insert-char new 1))))) | 1760 | (subst-char-in-region (match-beginning 0) |
| 1761 | (match-end 0) old new)))))) | ||
| 1761 | 1762 | ||
| 1762 | (defun dired-unmark-all-files (mark &optional arg) | 1763 | (defun dired-unmark-all-files (mark &optional arg) |
| 1763 | "Remove a specific mark or any mark from every file. | 1764 | "Remove a specific mark or any mark from every file. |