From: Richard M. Stallman Date: Thu, 21 Nov 2002 17:31:51 +0000 (+0000) Subject: (dired-sort-inhibit): New variable. X-Git-Tag: ttn-vms-21-2-B4~12312 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=23fc67ead93a5f10eb73ea0c80382638b9ba6745;p=emacs.git (dired-sort-inhibit): New variable. (dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil. --- 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))