GNU bug report logs -
#6810
23.2; dired-omit-mode makes dired slow
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Fri, 6 Aug 2010 16:31:02 UTC
Severity: normal
Found in version 23.2
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 2010-08-06 16:19 +0100, Leo wrote:
> When dired-omit-mode is on, operations on marked files become much
> slower. To see this, following these steps:
>
> 1. Emacs -q
>
> 2. eval:
> (require 'dired-x)
> (add-hook 'dired-mode-hook 'dired-omit-mode)
>
> 3. C-x d and enter emacs/lisp (or any dir that has a few dozen files)
>
> 4. Mark all files by typing: * / t
>
> 5. Change mode to 444 by typing: M 444 RET
>
>
> For every marked file, a message is displayed something like:
> Redisplaying...xyz.el
> Omitting...
> (Nothing to omit)
>
> Can this inefficiency be rid of? Thank you.
>
> Leo
`dired-do-redisplay' iterates over the marked files calling
dired-update-file-line which triggers dired-after-readin-hook (see line
1132 in dired-aux). So that hook is being run for as many times as the
number of files marked.
Any objection to something like this:
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 62d6928..90fd1e69 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1017,10 +1017,13 @@
;; message much faster than making dired-map-over-marks show progress
(dired-uncache
(if (consp dired-directory) (car dired-directory) dired-directory))
- (dired-map-over-marks (let ((fname (dired-get-filename)))
+ (dired-map-over-marks (let ((fname (dired-get-filename))
+ ;; disable readin hook until later
+ (dired-after-readin-hook nil))
(message "Redisplaying... %s" fname)
(dired-update-file-line fname))
arg)
+ (run-hooks 'dired-after-readin-hook)
(dired-move-to-filename)
(message "Redisplaying...done")))
Leo
This bug report was last modified 14 years and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.