mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-28 10:56:36 +00:00
(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').
This commit is contained in:
parent
905cf8f284
commit
f13101e9c2
@ -2012,21 +2012,20 @@ A prefix argument says to unflag those files instead."
|
|||||||
"Flag all backup files (names ending with `~') for deletion.
|
"Flag all backup files (names ending with `~') for deletion.
|
||||||
With prefix argument, unflag these files."
|
With prefix argument, unflag these files."
|
||||||
(interactive "P")
|
(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
|
(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.
|
;; but it's the only way this runs fast enough.
|
||||||
(and (save-excursion (end-of-line)
|
(and (save-excursion (end-of-line)
|
||||||
(or
|
;; Handle executables in case of -F option.
|
||||||
(eq (preceding-char) ?~)
|
;; We need not worry about the other kinds
|
||||||
;; Handle executables in case of -F option.
|
;; of markings that -F makes, since they won't
|
||||||
;; We need not worry about the other kinds
|
;; appear on real backup files.
|
||||||
;; of markings that -F makes, since they won't
|
(if (eq (preceding-char) ?*)
|
||||||
;; appear on real backup files.
|
(forward-char -1))
|
||||||
(if (eq (preceding-char) ?*)
|
(eq (preceding-char) last-c))
|
||||||
(progn
|
|
||||||
(forward-char -1)
|
|
||||||
(eq (preceding-char) ?~)))))
|
|
||||||
(not (looking-at dired-re-dir))
|
(not (looking-at dired-re-dir))
|
||||||
(let ((fn (dired-get-filename t t)))
|
(let ((fn (dired-get-filename t t)))
|
||||||
(if fn (backup-file-name-p fn))))
|
(if fn (backup-file-name-p fn))))
|
||||||
|
Loading…
Reference in New Issue
Block a user