[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Agenda is slow because of vc-mode
From: |
David Maus |
Subject: |
Re: [Orgmode] Agenda is slow because of vc-mode |
Date: |
Fri, 18 Jun 2010 18:19:48 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Daniel Clemente wrote:
>Hi.
> I have a shell script which exports my agenda to a file. It's pretty
>slow: about 90 seconds. There are many files (200 .org files, 76k
>lines, 3'6 Mb, 1600 open tasks) but the performance should be better.
> I found a way to bring it down to 11 seconds: temporarily disable
>the version control tools I'm using (bazaar, git). To test, just
>change their names so that Emacs can't run them.
> Since this slowness is caused by vc-mode, I wonder if it's possible
>for Org to open the agenda files without enabling vc-mode, for vc-mode
>is not necessary for org-mode.
> I fear not, because org-agenda-get-day-entries uses
>org-get-agenda-file-buffer to open a buffer normally, and this buffer
>should be fully functional for later usage.
That's indeed the problem: Its hard to figure a default options for
such functionality.
> As a hack, I used (defun vc-find-file-hook () nil) in my script;
>this does the trick.
Instead of overloading `vc-find-file-hook' you could use something
like this:
(defun dmj/disable-vc-for-agenda-files-hook ()
"Disable vc-mode for Org agenda files."
(if (and (fboundp 'org-agenda-file-p)
(org-agenda-file-p (buffer-file-name)))
(remove-hook 'find-file-hook 'vc-find-file-hook)
(add-hook 'find-file-hook 'vc-find-file-hook)))
(add-hook 'find-file-hook 'dmj/disable-vc-for-agenda-files-hook)
It removes vc-find-file-hook from the list of find-file-hooks when the
file is question is an agenda file.
HTH
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpBDwuYiJfOa.pgp
Description: PGP signature