diff options
author | Richard M. Stallman <rms@gnu.org> | 2002-11-21 17:31:51 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2002-11-21 17:31:51 +0000 |
commit | 23fc67ead93a5f10eb73ea0c80382638b9ba6745 (patch) | |
tree | 99f259ea80ed85e3f2c06b8c4ba1b269c85664f3 /lisp | |
parent | 304d3e5d3d89fb40ac6c4fb2e5e0f23a97171729 (diff) | |
download | emacs-23fc67ead93a5f10eb73ea0c80382638b9ba6745.tar.gz |
(dired-sort-inhibit): New variable.
(dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dired.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 5fe4e4aedbd..68c6ffc8bc1 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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)) |