diff options
| author | Richard M. Stallman | 2002-11-21 17:31:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-11-21 17:31:51 +0000 |
| commit | 23fc67ead93a5f10eb73ea0c80382638b9ba6745 (patch) | |
| tree | 99f259ea80ed85e3f2c06b8c4ba1b269c85664f3 | |
| parent | 304d3e5d3d89fb40ac6c4fb2e5e0f23a97171729 (diff) | |
| download | emacs-23fc67ead93a5f10eb73ea0c80382638b9ba6745.tar.gz emacs-23fc67ead93a5f10eb73ea0c80382638b9ba6745.zip | |
(dired-sort-inhibit): New variable.
(dired-sort-toggle-or-edit): Err if dired-sort-inhibit non-nil.
| -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." | |||
| 2723 | (concat "^-[^t" dired-ls-sorting-switches "]+$") | 2723 | (concat "^-[^t" dired-ls-sorting-switches "]+$") |
| 2724 | "Regexp recognized by dired to set `by name' mode.") | 2724 | "Regexp recognized by dired to set `by name' mode.") |
| 2725 | 2725 | ||
| 2726 | (defvar dired-sort-inhibit nil | ||
| 2727 | "Non-nil means the Dired sort command is disabled. | ||
| 2728 | The idea is to set this buffer-locally in special Dired buffers.") | ||
| 2729 | |||
| 2726 | (defun dired-sort-set-modeline () | 2730 | (defun dired-sort-set-modeline () |
| 2727 | ;; Set modeline display according to dired-actual-switches. | 2731 | ;; Set modeline display according to dired-actual-switches. |
| 2728 | ;; Modeline display of "by name" or "by date" guarantees the user a | 2732 | ;; 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." | |||
| 2742 | "Toggle between sort by date/name and refresh the dired buffer. | 2746 | "Toggle between sort by date/name and refresh the dired buffer. |
| 2743 | With a prefix argument you can edit the current listing switches instead." | 2747 | With a prefix argument you can edit the current listing switches instead." |
| 2744 | (interactive "P") | 2748 | (interactive "P") |
| 2749 | (when dired-sort-inhibit | ||
| 2750 | (error "Cannot sort this Dired buffer")) | ||
| 2745 | (if arg | 2751 | (if arg |
| 2746 | (dired-sort-other | 2752 | (dired-sort-other |
| 2747 | (read-string "ls switches (must contain -l): " dired-actual-switches)) | 2753 | (read-string "ls switches (must contain -l): " dired-actual-switches)) |