changeset 48491:5d690a3537aa

(dired-sort-inhibit): New variable. (dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil.
author Richard M. Stallman <rms@gnu.org>
date Thu, 21 Nov 2002 17:31:51 +0000
parents 3531509372aa
children 8faa4c711a1a
files lisp/dired.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Thu Nov 21 17:29:22 2002 +0000
+++ b/lisp/dired.el	Thu Nov 21 17:31:51 2002 +0000
@@ -2723,6 +2723,10 @@
   (concat "^-[^t" dired-ls-sorting-switches "]+$")
   "Regexp recognized by dired to set `by name' mode.")
 
+(defvar dired-sort-inhibit nil
+  "Non-nil means the Dired sort command is disabled.
+The idea is to set this buffer-locally in special Dired buffers.")
+
 (defun dired-sort-set-modeline ()
   ;; Set modeline display according to dired-actual-switches.
   ;; Modeline display of "by name" or "by date" guarantees the user a
@@ -2742,6 +2746,8 @@
   "Toggle between sort by date/name and refresh the dired buffer.
 With a prefix argument you can edit the current listing switches instead."
   (interactive "P")
+  (when dired-sort-inhibit
+    (error "Cannot sort this Dired buffer"))
   (if arg
       (dired-sort-other
        (read-string "ls switches (must contain -l): " dired-actual-switches))