aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel1995-09-08 20:38:17 +0000
committerAndré Spiegel1995-09-08 20:38:17 +0000
commit6cfd24f9a58919f7dd5f7a54fff719c5ea1d7f0b (patch)
treef614912f2c8e772dfda36ae17bc9f09e558a001f
parent1b8cac5dc43063c98c7cb3857ae44462363c207f (diff)
downloademacs-6cfd24f9a58919f7dd5f7a54fff719c5ea1d7f0b.tar.gz
emacs-6cfd24f9a58919f7dd5f7a54fff719c5ea1d7f0b.zip
(dired-internal-noselect): Set dired-directory when refreshing a buffer
that displays a list of files. (dired-find-buffer-nocreate): Handle the case when dired-directory is a list. (dired-sort-other): Don't set mode-name if we are not in dired-mode.
-rw-r--r--lisp/dired.el38
1 files changed, 22 insertions, 16 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 1bd50d4fc06..8272ed9e0ff 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -419,20 +419,24 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
419 ;; kill-all-local-variables any longer. 419 ;; kill-all-local-variables any longer.
420 (setq buffer (create-file-buffer (directory-file-name dirname))))) 420 (setq buffer (create-file-buffer (directory-file-name dirname)))))
421 (set-buffer buffer) 421 (set-buffer buffer)
422 (if (not new-buffer-p) ; existing buffer ... 422 (if (not new-buffer-p) ; existing buffer ...
423 (if switches ; ... but new switches 423 (cond (switches ; ... but new switches
424 (dired-sort-other switches) ; this calls dired-revert 424 ;; file list may have changed
425 ;; If directory has changed on disk, offer to revert. 425 (if (consp dir-or-list)
426 (if (let ((attributes (file-attributes dirname)) 426 (setq dired-directory dir-or-list))
427 (modtime (visited-file-modtime))) 427 ;; this calls dired-revert
428 (or (eq modtime 0) 428 (dired-sort-other switches))
429 (not (eq (car attributes) t)) 429 ;; If directory has changed on disk, offer to revert.
430 (and (= (car (nth 5 attributes)) (car modtime)) 430 ((if (let ((attributes (file-attributes dirname))
431 (= (nth 1 (nth 5 attributes)) (cdr modtime))))) 431 (modtime (visited-file-modtime)))
432 nil 432 (or (eq modtime 0)
433 (message 433 (not (eq (car attributes) t))
434 (substitute-command-keys 434 (and (= (car (nth 5 attributes)) (car modtime))
435 "Directory has changed on disk; type \\[revert-buffer] to update Dired")))) 435 (= (nth 1 (nth 5 attributes)) (cdr modtime)))))
436 nil
437 (message
438 (substitute-command-keys
439 "Directory has changed on disk; type \\[revert-buffer] to update Dired")))))
436 ;; Else a new buffer 440 ;; Else a new buffer
437 (setq default-directory 441 (setq default-directory
438 (if (file-directory-p dirname) 442 (if (file-directory-p dirname)
@@ -472,7 +476,9 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
472 (save-excursion 476 (save-excursion
473 (set-buffer (cdr (car blist))) 477 (set-buffer (cdr (car blist)))
474 (if (and (eq major-mode mode) 478 (if (and (eq major-mode mode)
475 (equal dired-directory dirname)) 479 (if (consp dired-directory)
480 (equal (car dired-directory) dirname)
481 (equal dired-directory dirname)))
476 (setq found (cdr (car blist)) 482 (setq found (cdr (car blist))
477 blist nil) 483 blist nil)
478 (setq blist (cdr blist)))))) 484 (setq blist (cdr blist))))))
@@ -2207,7 +2213,7 @@ With a prefix argument you can edit the current listing switches instead."
2207 ;; minor mode accordingly, others appear literally in the mode line. 2213 ;; minor mode accordingly, others appear literally in the mode line.
2208 ;; With optional second arg NO-REVERT, don't refresh the listing afterwards. 2214 ;; With optional second arg NO-REVERT, don't refresh the listing afterwards.
2209 (setq dired-actual-switches switches) 2215 (setq dired-actual-switches switches)
2210 (dired-sort-set-modeline) 2216 (if (eq major-mode 'dired-mode) (dired-sort-set-modeline))
2211 (or no-revert (revert-buffer))) 2217 (or no-revert (revert-buffer)))
2212 2218
2213;; To make this file smaller, the less common commands 2219;; To make this file smaller, the less common commands