aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-08-01 11:55:12 +0000
committerRichard M. Stallman1993-08-01 11:55:12 +0000
commit1d673d85da7649c03cd8fd4e987c68778fdaab92 (patch)
treeac3b0fd4a829ba318c3c8fe0ebf4fec7d1d2eb9a
parentec11639d935da95a42a0b08680dc84b760d7021d (diff)
downloademacs-1d673d85da7649c03cd8fd4e987c68778fdaab92.tar.gz
emacs-1d673d85da7649c03cd8fd4e987c68778fdaab92.zip
(dired-sort-mode): Variable deleted.
Don't display it in mode line. (dired-sort-set-modeline): Set mode-name instead.
-rw-r--r--lisp/dired.el21
1 files changed, 4 insertions, 17 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index ee1d5abb272..df9c87a88af 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -726,14 +726,6 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
726 (define-key dired-mode-map "\C-_" 'dired-undo) 726 (define-key dired-mode-map "\C-_" 'dired-undo)
727 (define-key dired-mode-map "\C-xu" 'dired-undo) 727 (define-key dired-mode-map "\C-xu" 'dired-undo)
728 ) 728 )
729
730(or (member '(dired-sort-mode dired-sort-mode) minor-mode-alist)
731 ;; Test whether this has already been done in case dired is reloaded
732 ;; There may be several elements with dired-sort-mode as car.
733 (setq minor-mode-alist
734 (cons '(dired-sort-mode dired-sort-mode)
735 ;; dired-sort-mode is nil outside dired
736 minor-mode-alist)))
737 729
738;; Make menu bar items. 730;; Make menu bar items.
739 731
@@ -951,7 +943,6 @@ Keybindings:
951 dired-directory) 943 dired-directory)
952 (set (make-local-variable 'dired-actual-switches) 944 (set (make-local-variable 'dired-actual-switches)
953 (or switches dired-listing-switches)) 945 (or switches dired-listing-switches))
954 (make-local-variable 'dired-sort-mode)
955 (dired-sort-other dired-actual-switches t) 946 (dired-sort-other dired-actual-switches t)
956 (run-hooks 'dired-mode-hook)) 947 (run-hooks 'dired-mode-hook))
957 948
@@ -2016,23 +2007,19 @@ Thus, use \\[backward-page] to find the beginning of a group of errors."
2016 (concat "^-[^t" dired-ls-sorting-switches "]+$") 2007 (concat "^-[^t" dired-ls-sorting-switches "]+$")
2017 "Regexp recognized by dired to set `by name' mode.") 2008 "Regexp recognized by dired to set `by name' mode.")
2018 2009
2019(defvar dired-sort-mode nil
2020 "Whether Dired sorts by name, date etc. (buffer-local).")
2021;; This is nil outside dired buffers so it can be used in the modeline
2022
2023(defun dired-sort-set-modeline () 2010(defun dired-sort-set-modeline ()
2024 ;; Set modeline display according to dired-actual-switches. 2011 ;; Set modeline display according to dired-actual-switches.
2025 ;; Modeline display of "by name" or "by date" guarantees the user a 2012 ;; Modeline display of "by name" or "by date" guarantees the user a
2026 ;; match with the corresponding regexps. Non-matching switches are 2013 ;; match with the corresponding regexps. Non-matching switches are
2027 ;; shown literally. 2014 ;; shown literally.
2028 (setq dired-sort-mode 2015 (setq mode-name
2029 (let (case-fold-search) 2016 (let (case-fold-search)
2030 (cond ((string-match dired-sort-by-name-regexp dired-actual-switches) 2017 (cond ((string-match dired-sort-by-name-regexp dired-actual-switches)
2031 " by name") 2018 "Dired by name")
2032 ((string-match dired-sort-by-date-regexp dired-actual-switches) 2019 ((string-match dired-sort-by-date-regexp dired-actual-switches)
2033 " by date") 2020 "Dired by date")
2034 (t 2021 (t
2035 (concat " " dired-actual-switches))))) 2022 (concat "Dired " dired-actual-switches)))))
2036 ;; update mode line: 2023 ;; update mode line:
2037 (set-buffer-modified-p (buffer-modified-p))) 2024 (set-buffer-modified-p (buffer-modified-p)))
2038 2025