# HG changeset patch # User Richard M. Stallman # Date 1037899911 0 # Node ID 5d690a3537aa8307a1b24d05304b7c7fd78be076 # Parent 3531509372aa0c909e0bf09ac2749b7fb830323a (dired-sort-inhibit): New variable. (dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil. diff -r 3531509372aa -r 5d690a3537aa lisp/dired.el --- 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))