From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Having (too) many files in org-agenda-files Date: Wed, 29 Sep 2010 15:19:18 +0200 Message-ID: References: <878w2lso50.fsf@mundaneum.com> <877hi56jc0.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=35327 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0wZA-0004ug-Jd for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 09:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0wZ8-0006tS-Vf for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 09:19:24 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:60187) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0wZ8-0006tJ-Kx for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 09:19:22 -0400 Received: by eyh5 with SMTP id 5so232449eyh.0 for ; Wed, 29 Sep 2010 06:19:21 -0700 (PDT) In-Reply-To: <877hi56jc0.fsf@mundaneum.com> 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: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org On Sep 29, 2010, at 10:32 AM, S=E9bastien Vauban wrote: > Hi Carsten, > > Carsten Dominik wrote: >> On Sep 28, 2010, at 8:45 PM, S=E9bastien Vauban wrote: >>> Of course, I have many, many files in Org mode. All files I write =20= >>> (or touch) >>> in fact. >>> >>> Of course, I would like to search through my files at some point =20 >>> in time. I >>> even would like to search through your files at some point in =20 >>> time, I mean >>> through =3Dorg-mode/contrib/babel=3D and =3DWorg=3D for example. = Hence, I =20 >>> put them >>> in =3Dorg-agenda-files=3D. >>> >>> The problem is the load-time of my Emacs, now 221 seconds, coming =20= >>> from 20 >>> seconds before the heavy use of Org... >>> >>> You'll tell me: not a problem, you do that only once a day, and =20 >>> 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 =20 >>> 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 =20= >>> we >>> really display (i.e., pop up) the buffer? I guess this must be a =20= >>> major >>> component of the time this takes. >>> >>> - Couldn't we have 2 vars: =3Dorg-agenda-files=3D for the files you =20= >>> know you >>> want have scanned for the agenda construction, and an extra list =20= >>> such as >>> =3Dorg-search-files=3D for files not containing any dates? Then, = some =20 >>> time >>> would have to be taken when =3DC-c a s=3D, but not before. And not = if =20 >>> you >>> don't search for anything in your Org files during that Emacs =20 >>> session... >> >> 4 minutes of startup time is entirely unacceptable. And I think >> you need to identify what is causing this. >> >> First of all, unless you are having to totally old Version of Emacs, > > Nope. GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) > of 2010-03-29 on rothera, modified by Debian > > >> fontification at display time is standard, I believe. > > It seems not, from what I see in the Messages buffer. I really don't =20= > have the > impression of having fiddled with that, really. > > >> You must be doing something strange, like forcing Emacs to load >> all those files in org-agenda-files for example, > > That, yes! I should have explicitly written it, but -- yes -- I do =20= > have: > > --8<---------------cut here---------------start------------->8--- > (org-agenda-list) > --8<---------------cut here---------------end--------------->8--- > > in my .emacs. > > >> and maybe forcing global fontification for each file or so. > > To repeat myself, no to that question. But ispell and flyspell are =20 > called for > Org files. Maybe there are interactions? > > >> About a separate variable for search file, that does of cause exist: >> org-agenda-text-search-extra-files > > Of course! > > Doing this: > > --8<---------------cut here---------------start------------->8--- > (setq org-agenda-files > (append (directory-files org-directory t "^[^\\.].*\\.org$") > (if (file-exists-p "~/Projects/") > (directory-files "~/Projects/" t "^[^\\.].*\\.org$") > nil))) > > (setq org-agenda-text-search-extra-files > (append > (if (file-exists-p "~/Public/") > (directory-files "~/Public/" t "^[^\\.].*\\.txt$") > nil) > (if (file-exists-p = "~/Public/www.mygooglest.com/source/sva/=20 > ") > (directory-files = "~/Public/www.mygooglest.com/source/sva/=20 > " t "^[^\\.].*\\.txt$") > nil) > (if (file-exists-p "~/Examples/Org-scraps/") > (directory-files "~/Examples/Org-scraps/" t "^[^\=20 > \.].*\\.txt$") > nil) > (if (file-exists-p "~/Downloads/emacs/site-lisp/org-=20 > mode/contrib/babel/") > (directory-files "~/Downloads/emacs/site-lisp/org-=20 > mode/contrib/babel/" t "^[^\\.].*\\.org$") > nil) > (if (file-exists-p "~/Downloads/emacs/site-lisp/Worg/") > (directory-files "~/Downloads/emacs/site-lisp/=20 > Worg/" t "^[^\\.].*\\.org$") > nil) > )) > --8<---------------cut here---------------end--------------->8--- > > reduces my load time from 221 seconds down to 92 seconds. Already a =20= > huge diff! Still bad though. I am wondering what is causing the fontification =20 message. I do not get this, so it must be something in your setup. You should try to find out when this is happening and why. Also, you might consider to remove (org-agenda-list) from .emacs. I think it is pretty much always a bad idea to put a command like this =20= into your startup. Just make it a habit to call it early after starting =20 Emacs. It also seems to me you some of the extra packages might be activated several times in each file. One possible reason could be that you have put the code to turn them on into several hooks like text-mode-hook, outline-mode-hook, and org-mode-hook. Turning on org-mode will first run text-mode-hook, then outline-mode-hook, then org-mode-hook ..... Maybe you are also calling font-lock-fontify-buffer explicitly in one of your hooks? Hope some of this helps. If not, let me see you full configuration - maybe I can spot something else. - Carsten