Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
fa562dd5
Commit
fa562dd5
authored
Jun 28, 1994
by
Richard M. Stallman
Browse files
(dired-readin): Record the directory's modtime.
(dired-internal-noselect): Offer to revert if dir has changed.
parent
79e6ae33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
lisp/dired.el
lisp/dired.el
+13
-1
No files found.
lisp/dired.el
View file @
fa562dd5
...
...
@@ -398,7 +398,16 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
(set-buffer buffer)
(if (not new-buffer-p) ; existing buffer ...
(if switches ; ... but new switches
(dired-sort-other switches)) ; this calls dired-revert
(dired-sort-other switches) ; this calls dired-revert
;; If directory has changed on disk, offer to revert.
(if (let ((attributes (file-attributes dirname))
(modtime (visited-file-modtime)))
(or (not (eq (car attributes) t))
(and (= (car (nth 5 attributes)) (car modtime))
(= (nth 1 (nth 5 attributes)) (cdr modtime)))))
nil
(if (yes-or-no-p "
Directory
has
changed
on
disk
; update the buffer? ")
(
dired-revert
)
)))
;; Else a new buffer
(
setq
default-directory
(
abbreviate-file-name
...
...
@@ -482,6 +491,9 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
;; dired-build-subdir-alist will call dired-clear-alist first
(
set
(
make-local-variable
'dired-subdir-alist
)
nil
)
(
dired-build-subdir-alist
)
(
let
((
attributes
(
file-attributes
dirname
)))
(
if
(
eq
(
car
attributes
)
t
)
(
set-visited-file-modtime
(
nth
5
attributes
))))
(
set-buffer-modified-p
nil
))))
;; Subroutines of dired-readin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment