summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2006-12-29 23:57:38 +0000
committerNick Roberts <nickrob@snap.net.nz>2006-12-29 23:57:38 +0000
commit5641671fabc6f3e6f6b2c218c3076e554737ec12 (patch)
tree1faef9572f4c13ff1ffed048bc2c75a0ebdb23fe /lisp/dired.el
parent8cc303bb899eb786518b48feb8cffb0f8b5bf8e7 (diff)
downloademacs-5641671fabc6f3e6f6b2c218c3076e554737ec12.tar.gz
(dired-sort-other): Move test for dired-mode...
(dired-sort-set-modeline): ...to here.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 09f4dc8425a..4f2e1b74b10 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3098,15 +3098,18 @@ The idea is to set this buffer-locally in special dired buffers.")
;; Modeline display of "by name" or "by date" guarantees the user a
;; match with the corresponding regexps. Non-matching switches are
;; shown literally.
- (setq mode-name
- (let (case-fold-search)
- (cond ((string-match dired-sort-by-name-regexp dired-actual-switches)
- "Dired by name")
- ((string-match dired-sort-by-date-regexp dired-actual-switches)
- "Dired by date")
- (t
- (concat "Dired " dired-actual-switches)))))
- (force-mode-line-update))
+ (when (eq major-mode 'dired-mode)
+ (setq mode-name
+ (let (case-fold-search)
+ (cond ((string-match
+ dired-sort-by-name-regexp dired-actual-switches)
+ "Dired by name")
+ ((string-match
+ dired-sort-by-date-regexp dired-actual-switches)
+ "Dired by date")
+ (t
+ (concat "Dired " dired-actual-switches)))))
+ (force-mode-line-update)))
(defun dired-sort-toggle-or-edit (&optional arg)
"Toggle between sort by date/name and refresh the dired buffer.
@@ -3162,7 +3165,7 @@ set the minor mode accordingly, others appear literally in the mode line.
With optional second arg NO-REVERT, don't refresh the listing afterwards."
(dired-sort-R-check switches)
(setq dired-actual-switches switches)
- (if (eq major-mode 'dired-mode) (dired-sort-set-modeline))
+ (dired-sort-set-modeline)
(or no-revert (revert-buffer)))
(defvar dired-subdir-alist-pre-R nil