]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-sort-inhibit): New variable.
authorRichard M. Stallman <rms@gnu.org>
Thu, 21 Nov 2002 17:31:51 +0000 (17:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 21 Nov 2002 17:31:51 +0000 (17:31 +0000)
(dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil.

lisp/dired.el

index 5fe4e4aedbd1619fecb201ab5ee680822f6afb12..68c6ffc8bc1e25b38d47edd25d0899eb5315c093 100644 (file)
@@ -2723,6 +2723,10 @@ Thus, use \\[backward-page] to find the beginning of a group of errors."
   (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 @@ Thus, use \\[backward-page] to find the beginning of a group of errors."
   "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))