diff options
| author | Richard M. Stallman | 1996-12-07 20:15:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-07 20:15:18 +0000 |
| commit | ad8c455410e8fc2b5ba01b07a783d3418331a623 (patch) | |
| tree | a3336dd1c7d2ccfd5e3ed56ffb77e9735305f737 | |
| parent | 6918a4a1db8fc6915844c7be4e17dba403ade0e5 (diff) | |
| download | emacs-ad8c455410e8fc2b5ba01b07a783d3418331a623.tar.gz emacs-ad8c455410e8fc2b5ba01b07a783d3418331a623.zip | |
(dired-omit-size-limit): New variable.
(dired-omit-toggle, dired-omit-expunge): Respect it.
| -rw-r--r-- | lisp/dired-x.el | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index b626b3aade5..a45c9ad52df 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -91,6 +91,7 @@ | |||
| 91 | ;; dired-omit-files-p | 91 | ;; dired-omit-files-p |
| 92 | ;; dired-omit-files | 92 | ;; dired-omit-files |
| 93 | ;; dired-omit-extensions | 93 | ;; dired-omit-extensions |
| 94 | ;; dired-omit-size-limit | ||
| 94 | ;; | 95 | ;; |
| 95 | ;; To find out more about these variables, load this file, put your cursor at | 96 | ;; To find out more about these variables, load this file, put your cursor at |
| 96 | ;; the end of any of the variable names, and hit C-h v [RET]. *Please* see | 97 | ;; the end of any of the variable names, and hit C-h v [RET]. *Please* see |
| @@ -168,6 +169,10 @@ This only has effect when `dired-omit-files-p' is t. See interactive function | |||
| 168 | `dired-omit-extensions'. The default is to omit `.', `..', and auto-save | 169 | `dired-omit-extensions'. The default is to omit `.', `..', and auto-save |
| 169 | files.") | 170 | files.") |
| 170 | 171 | ||
| 172 | (defvar dired-omit-size-limit 20000 | ||
| 173 | "*If a dired buffer listing contains more than this many characters, | ||
| 174 | do not do omitting. If nil, always do omitting.") | ||
| 175 | |||
| 171 | (defvar dired-find-subdir nil ; t is pretty near to DWIM... | 176 | (defvar dired-find-subdir nil ; t is pretty near to DWIM... |
| 172 | "*If non-nil, Dired always finds a directory in a buffer of its own. | 177 | "*If non-nil, Dired always finds a directory in a buffer of its own. |
| 173 | If nil, Dired finds the directory as a subdirectory in some other buffer | 178 | If nil, Dired finds the directory as a subdirectory in some other buffer |
| @@ -262,6 +267,7 @@ For more features, see variables | |||
| 262 | dired-omit-files-p | 267 | dired-omit-files-p |
| 263 | dired-omit-files | 268 | dired-omit-files |
| 264 | dired-omit-extensions | 269 | dired-omit-extensions |
| 270 | dired-omit-size-limit | ||
| 265 | dired-find-subdir | 271 | dired-find-subdir |
| 266 | dired-enable-local-variables | 272 | dired-enable-local-variables |
| 267 | dired-local-variables-file | 273 | dired-local-variables-file |
| @@ -535,7 +541,8 @@ With an arg, and if omitting was on, turn it off but don't refresh the buffer." | |||
| 535 | (if (not dired-omit-files-p) | 541 | (if (not dired-omit-files-p) |
| 536 | (revert-buffer) | 542 | (revert-buffer) |
| 537 | ;; this will mention how many were omitted: | 543 | ;; this will mention how many were omitted: |
| 538 | (dired-omit-expunge)))) | 544 | (let ((dired-omit-size-limit nil)) |
| 545 | (dired-omit-expunge))))) | ||
| 539 | 546 | ||
| 540 | (defvar dired-omit-extensions | 547 | (defvar dired-omit-extensions |
| 541 | (append completion-ignored-extensions | 548 | (append completion-ignored-extensions |
| @@ -552,7 +559,8 @@ variables `dired-omit-files-p' and `dired-omit-files'.") | |||
| 552 | 559 | ||
| 553 | (defun dired-omit-expunge (&optional regexp) | 560 | (defun dired-omit-expunge (&optional regexp) |
| 554 | "Erases all unmarked files matching REGEXP. | 561 | "Erases all unmarked files matching REGEXP. |
| 555 | Does nothing if global variable `dired-omit-files-p' is nil. | 562 | Does nothing if global variable `dired-omit-files-p' is nil, or if called |
| 563 | non-interactively and buffer is bigger than `dired-omit-size-limit'. | ||
| 556 | If REGEXP is nil or not specified, uses `dired-omit-files', and also omits | 564 | If REGEXP is nil or not specified, uses `dired-omit-files', and also omits |
| 557 | filenames ending in `dired-omit-extensions'. | 565 | filenames ending in `dired-omit-extensions'. |
| 558 | If REGEXP is the empty string, this function is a no-op. | 566 | If REGEXP is the empty string, this function is a no-op. |
| @@ -560,7 +568,10 @@ If REGEXP is the empty string, this function is a no-op. | |||
| 560 | This functions works by temporarily binding `dired-marker-char' to | 568 | This functions works by temporarily binding `dired-marker-char' to |
| 561 | `dired-omit-marker-char' and calling `dired-do-kill-lines'." | 569 | `dired-omit-marker-char' and calling `dired-do-kill-lines'." |
| 562 | (interactive "sOmit files (regexp): ") | 570 | (interactive "sOmit files (regexp): ") |
| 563 | (if dired-omit-files-p | 571 | (if (and dired-omit-files-p |
| 572 | (or (interactive-p) | ||
| 573 | (not dired-omit-size-limit) | ||
| 574 | (< (buffer-size) dired-omit-size-limit))) | ||
| 564 | (let ((omit-re (or regexp (dired-omit-regexp))) | 575 | (let ((omit-re (or regexp (dired-omit-regexp))) |
| 565 | (old-modified-p (buffer-modified-p)) | 576 | (old-modified-p (buffer-modified-p)) |
| 566 | count) | 577 | count) |