From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Having (too) many files in org-agenda-files Date: Wed, 29 Sep 2010 08:38:07 -0400 Message-ID: <87pqvwiv2o.fsf@fastmail.fm> References: <878w2lso50.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=46154 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0vvP-0002sr-Tz for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 08:38:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0vvK-0007nM-30 for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 08:38:19 -0400 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:51998) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0vvJ-0007n0-VI for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 08:38:14 -0400 In-Reply-To: <878w2lso50.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Tue, 28 Sep 2010 20:45:31 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: Org Mode Hi Sebastian,=20 I wrote this response yesterday, but it may have gotten lost in gmane's reverse obfuscation system for email addresses. :) (OT: Is there a "correct" way to respond to your messages in gnus? I subscribe to org-mode via gmane/nntp and in your emails the org-mode ML address is obfuscated and redirected: emacs-orgmode-mXXj517/zsQ@public.gmane.org.) ----- S=C3=A9bastien Vauban writes: > Of course, I have many, many files in Org mode. All files I write (or > touch) in fact. > > Of course, I would like to search through my files at some point in time. > I even would like to search through your files at some point in time, I m= ean > through =3Dorg-mode/contrib/babel=3D and =3DWorg=3D for example. > The drawback of org-mode's plain text format is that org-mode needs to load, parse, and fontify, and preserve in memory all files it queries (i.e., agenda files). Too many agenda files can thus cause a pretty big performance hit (both when loading agenda files and constructing agenda views). To avoid this, I would recommend including only important files in org-agenda-files. Possible solutions for searching other files include: 1. loading the other directories when needed (e.g., through a function that changes the value of org-agenda-files) 2. using the variable org-agenda-text-search-extra-files (see below) 3. searching other directories with external tools (grep, perl script, etc.) > The problem is the load-time of my Emacs, now: > > Emacs Init startup time: 221 seconds. Do you invoke an agenda command in your emacs, such as org-agenda-to-appt? That would cause org-mode to load all org files. > coming from 20 seconds before the heavy use of Org... > > with tens of times such lines in my *Messages* buffer: > > OVERVIEW > Checking for library `filladapt'... > +-> Requiring `filladapt' (already loaded) > Checking for library `filladapt'... Found > Fontifying Axa.org... (regexps...........................................= .) > Checking for library `filladapt'... Found > Fontifying Axa.org... (regexps...........................................= ..) > Checking for library `filladapt'... Found > Fontifying Axa.org... (regexps...........................................= ...) > Checking for library `filladapt'... Found > +-> Requiring `outline-mode-easy-bindings' (already loaded) > +-> Requiring `ispell' (already loaded) > Evaluate code AFTER HAVING LOADED `flyspell'... [2 times] > Starting new Ispell process [en_US] ... > Checking for library `filladapt'... > +-> Requiring `filladapt' (already loaded) > Checking for library `filladapt'... Found It seems that filladapt is causing some of the verbosity (and possible slowness) there. When loading agenda files, my *Messages* buffer only shows: OVERVIEW [29 times] > You'll tell me: not a problem, you do that only once a day, and you > use Emacs client/server for the rest of the time. True. A bit, because > I sometimes have to restart Emacs for testing a fresh one (not > impacted by defvars already defined, or deffaces, etc.). > > Having to wait almost 4 minutes is a real pain. So, here my > comments/questions: > > - Isn't it possible to delay the fontification/ispell/etc. to when we rea= lly > display (i.e., pop up) the buffer? I guess this must be a major compon= ent > of the time this takes. I imagine the fontification is necessary for the agenda to function properly. Thus, org files are parsed en masse when the agenda is called for the first time. (Hence my question about whether you were calling the agenda from ~/.emacs.) > > - Couldn't we have 2 vars: =3Dorg-agenda-files=3D for the files you know = you want > have scanned for the agenda construction, and an extra list such as > =3Dorg-search-files=3D for files not containing any dates? Then, some = time > would have to be taken when =3DC-c a s=3D, but not before. And not if y= ou don't > search for anything in your Org files during that Emacs session... > This already exists. See org-agenda-text-search-extra-files.=20 Best, Matt