From: Leo <sdl.web@gmail.com>
To: 6810@debbugs.gnu.org
Subject: bug#6810: 23.2; dired-omit-mode makes dired slow
Date: Sat, 04 Dec 2010 17:34:21 +0000 [thread overview]
Message-ID: <m1zkslcuhu.fsf@cam.ac.uk> (raw)
In-Reply-To: <m1r5iblqea.fsf@cam.ac.uk> (Leo's message of "Fri, 06 Aug 2010 16:19:57 +0100")
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
next prev parent reply other threads:[~2010-12-04 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 15:19 bug#6810: 23.2; dired-omit-mode makes dired slow Leo
2010-12-04 17:34 ` Leo [this message]
2010-12-04 22:19 ` Chong Yidong
2010-12-05 5:20 ` Leo
2010-12-06 19:55 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1zkslcuhu.fsf@cam.ac.uk \
--to=sdl.web@gmail.com \
--cc=6810@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.