# HG changeset patch # User Karl Heuer # Date 818883753 0 # Node ID 0611604f3cd3eca9de9795782ed6391fe39b4306 # Parent 9729af46fe60d994d5398ce0cb4b05a746140107 (dired-flag-backup-files): Under MS-DOS, search for possible backup files by checking for filenames which end with a `k' (the backup extension is `.bak'). diff -r 9729af46fe60 -r 0611604f3cd3 lisp/dired.el --- a/lisp/dired.el Wed Dec 13 15:31:07 1995 +0000 +++ b/lisp/dired.el Wed Dec 13 19:42:33 1995 +0000 @@ -2012,21 +2012,20 @@ "Flag all backup files (names ending with `~') for deletion. With prefix argument, unflag these files." (interactive "P") - (let ((dired-marker-char (if unflag-p ?\040 dired-del-marker))) + (let ((dired-marker-char (if unflag-p ?\ dired-del-marker)) + (last-c (if (eq system-type 'ms-dos) ?k ?~))) (dired-mark-if - ;; It is less than general to check for ~ here, + ;; Don't call backup-file-name-p unless the last character looks like + ;; it might be the end of a backup file name. This isn't very general, ;; but it's the only way this runs fast enough. (and (save-excursion (end-of-line) - (or - (eq (preceding-char) ?~) - ;; Handle executables in case of -F option. - ;; We need not worry about the other kinds - ;; of markings that -F makes, since they won't - ;; appear on real backup files. - (if (eq (preceding-char) ?*) - (progn - (forward-char -1) - (eq (preceding-char) ?~))))) + ;; Handle executables in case of -F option. + ;; We need not worry about the other kinds + ;; of markings that -F makes, since they won't + ;; appear on real backup files. + (if (eq (preceding-char) ?*) + (forward-char -1)) + (eq (preceding-char) last-c)) (not (looking-at dired-re-dir)) (let ((fn (dired-get-filename t t))) (if fn (backup-file-name-p fn))))