diff options
| author | Tino Calancha | 2016-07-11 14:34:49 +0900 |
|---|---|---|
| committer | Tino Calancha | 2016-07-11 14:34:49 +0900 |
| commit | df7774be39af76d3072a0278ef815a47bf50dfe9 (patch) | |
| tree | f722a0fa5197618c29b1bee0b33ab875f97f188a /lisp | |
| parent | bfeda891a51178dd0032800ea4aef013c62bbe10 (diff) | |
| download | emacs-df7774be39af76d3072a0278ef815a47bf50dfe9.tar.gz emacs-df7774be39af76d3072a0278ef815a47bf50dfe9.zip | |
Dired always read file system
* dired.el (dired-always-read-filesystem): Add new option.
(dired-mark-files-containing-regexp): Use it (Bug#22694).
* doc/emacs/dired.texi: Mention it in the manual.
* test/lisp/dired-tests.el (dired-test-bug22694): Add test.
;* etc/NEWS: Add entry for this change.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/dired.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index d078478aaaf..5d14291d787 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -255,6 +255,18 @@ new Dired buffers." | |||
| 255 | :version "24.4" | 255 | :version "24.4" |
| 256 | :group 'dired) | 256 | :group 'dired) |
| 257 | 257 | ||
| 258 | (defcustom dired-always-read-filesystem nil | ||
| 259 | "Non-nil means revert buffers visiting files before searching them. | ||
| 260 | By default, commands like `dired-mark-files-containing-regexp' will | ||
| 261 | search any buffers visiting the marked files without reverting them, | ||
| 262 | even if they were changed on disk. When this option is non-nil, such | ||
| 263 | buffers are always reverted in a temporary buffer before searching | ||
| 264 | them: the search is performed on the temporary buffer, the original | ||
| 265 | buffer visiting the file is not modified." | ||
| 266 | :type 'boolean | ||
| 267 | :version "25.2" | ||
| 268 | :group 'dired) | ||
| 269 | |||
| 258 | ;; Internal variables | 270 | ;; Internal variables |
| 259 | 271 | ||
| 260 | (defvar dired-marker-char ?* ; the answer is 42 | 272 | (defvar dired-marker-char ?* ; the answer is 42 |
| @@ -3359,7 +3371,8 @@ object files--just `.o' will mark more than you might think." | |||
| 3359 | A prefix argument means to unmark them instead. | 3371 | A prefix argument means to unmark them instead. |
| 3360 | `.' and `..' are never marked. | 3372 | `.' and `..' are never marked. |
| 3361 | 3373 | ||
| 3362 | Note that if a file is visited in an Emacs buffer, this command will | 3374 | Note that if a file is visited in an Emacs buffer, and |
| 3375 | `dired-always-read-filesystem' is nil, this command will | ||
| 3363 | look in the buffer without revisiting the file, so the results might | 3376 | look in the buffer without revisiting the file, so the results might |
| 3364 | be inconsistent with the file on disk if its contents has changed | 3377 | be inconsistent with the file on disk if its contents has changed |
| 3365 | since it was last visited." | 3378 | since it was last visited." |
| @@ -3379,7 +3392,7 @@ since it was last visited." | |||
| 3379 | (message "Checking %s" fn) | 3392 | (message "Checking %s" fn) |
| 3380 | ;; For now we do it inside emacs | 3393 | ;; For now we do it inside emacs |
| 3381 | ;; Grep might be better if there are a lot of files | 3394 | ;; Grep might be better if there are a lot of files |
| 3382 | (if prebuf | 3395 | (if (and prebuf (not dired-always-read-filesystem)) |
| 3383 | (with-current-buffer prebuf | 3396 | (with-current-buffer prebuf |
| 3384 | (save-excursion | 3397 | (save-excursion |
| 3385 | (goto-char (point-min)) | 3398 | (goto-char (point-min)) |