# HG changeset patch # User Richard M. Stallman # Date 738284584 0 # Node ID 29fe3ea604a26c1f99e575277f3c47022f285598 # Parent 793f7e0dc66ba7202dc4acbc955ed533ab374018 (dired-flag-backup-files): Speedup: check explicitly for ~ at end of line. (dired-flag-auto-save-files): Similar change. diff -r 793f7e0dc66b -r 29fe3ea604a2 lisp/dired.el --- a/lisp/dired.el Mon May 24 22:58:54 1993 +0000 +++ b/lisp/dired.el Mon May 24 23:03:04 1993 +0000 @@ -1709,11 +1709,15 @@ (interactive "P") (let ((dired-marker-char (if unflag-p ?\040 dired-del-marker))) (dired-mark-if - (and (not (looking-at dired-re-dir)) - (let ((fn (dired-get-filename t t))) - (if fn (auto-save-file-name-p - (file-name-nondirectory fn))))) - "auto save file"))) + ;; It is less than general to check for ~ here, + ;; but it's the only way this runs fast enough. + (and (save-excursion (end-of-line) + (eq (preceding-char) ?#)) + (not (looking-at dired-re-dir)) + (let ((fn (dired-get-filename t t))) + (if fn (auto-save-file-name-p + (file-name-nondirectory fn))))) + "auto save file"))) (defun dired-flag-backup-files (&optional unflag-p) "Flag all backup files (names ending with `~') for deletion. @@ -1721,7 +1725,11 @@ (interactive "P") (let ((dired-marker-char (if unflag-p ?\040 dired-del-marker))) (dired-mark-if - (and (not (looking-at dired-re-dir)) + ;; It is less than general to check for ~ here, + ;; but it's the only way this runs fast enough. + (and (save-excursion (end-of-line) + (eq (preceding-char) ?~)) + (not (looking-at dired-re-dir)) (let ((fn (dired-get-filename t t))) (if fn (backup-file-name-p fn)))) "backup file")))