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: Thu, 30 Sep 2010 13:24:16 +0200 Message-ID: <493C67F4-E312-43F3-B5D2-62F740EADD72@gmail.com> References: <878w2lso50.fsf@mundaneum.com> <877hi56jc0.fsf@mundaneum.com> <87fwwsfazb.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=51364 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1HFO-00058v-3E for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 07:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P1HFM-0008SH-KD for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 07:24:22 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:55744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P1HFM-0008S2-Cs for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 07:24:20 -0400 Received: by eyh5 with SMTP id 5so821547eyh.0 for ; Thu, 30 Sep 2010 04:24:19 -0700 (PDT) In-Reply-To: <87fwwsfazb.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 30, 2010, at 12:20 AM, S=E9bastien Vauban wrote: > Hi Carsten, > > Carsten Dominik wrote: >> On Sep 29, 2010, at 10:32 AM, S=E9bastien Vauban wrote: >>> 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 =20 >>>>> write (or >>>>> touch) in fact. >>>>> >>>>> Of course, I would like to search through my files at some point =20= >>>>> in time. >>>>> The problem is the load-time of my Emacs, now 221 seconds, =20 >>>>> coming from 20 >>>>> seconds before the heavy use of Org... >>>> >>>> 4 minutes of startup time is entirely unacceptable. And I think =20 >>>> you need >>>> to identify what is causing this. >>>> >>>> fontification at display time is standard, I believe. >>> >>> It seems not, from what I see in the Messages buffer. I really =20 >>> don't have >>> the impression of having fiddled with that, really. > >>>> You must be doing something strange [...] 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? >>> >>> [Using org-agenda-text-search-extra-files] reduces my load time =20 >>> from 221 >>> seconds down to 92 seconds. Already a 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 =20 >> should try to >> find out when this is happening and why. > > You've seen, from my reply to Matt, why my *Messages* buffer is more =20= > verbose > than yours. It's on purpose, just to be able to figure out more =20 > easily what's > going on. Though, I don't have yet... > > >> Also, you might consider to remove (org-agenda-list) from .emacs. I =20= >> think it >> is pretty much always a bad idea to put a command like this into your >> startup. Just make it a habit to call it early after starting Emacs. > > Honestly, that would not change that much. Having to wait 92 seconds =20= > at > startup, or a long time just a few minutes later has the same impact =20= > for me. > And: don't try to make me stop using Org ;-)) :-) The reason why I am suggesting to remove this command is more that it =20= make emacs more usable for command line usage etc. Furthermore, you are adding quite a bit to font-lock, but I don't see =20= why it should be so slow. My Emacs starts up in 4 seconds at most. When I create an agenda, I =20 am talking 1 second to maybe 2. I have about 10 files contributing to the agenda. - Carsten > > >> 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 =20 >> 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 =20 >> first run >> text-mode-hook, then outline-mode-hook, then org-mode-hook ..... =20 >> Maybe you >> are also calling font-lock-fontify-buffer explicitly in one of your =20= >> hooks? > > The only fontification customs that I do are here: > > --8<---------------cut here---------------start------------->8--- > ;; special words > (setq keywords-critical-pattern > "\\(BUGS\\|FIXME\\|TODO\\|todo\\|XXX\\|[Ee][Rr][Rr][Oo][Rr]\\|=20 > [Mm][Ii][Ss][Ss][Ii][Nn][Gg]\\|[Ii][Nn][Vv][Aa][Ll][Ii][Dd]\\|[Ff]=20 > [Aa][Ii][Ll][Ee][Dd]\\|[Cc][Oo][Rr][Rr][Uu][Pp][Tt][Ee][Dd]\\)") > (make-face 'keywords-critical) > (GNUEmacs (set-face-attribute 'keywords-critical nil :foreground =20 > "red" :background "yellow" :weight 'bold)) > > (setq keywords-org-critical-pattern > "\\(BUGS\\|FIXME\\|XXX\\|[^*] TODO\\|[Ee][Rr][Rr][Oo][Rr]\\|[Mm]=20= > [Ii][Ss][Ss][Ii][Nn][Gg]\\|[Ii][Nn][Vv][Aa][Ll][Ii][Dd]\\|[Ff][Aa]=20 > [Ii][Ll][Ee][Dd]\\|[Cc][Oo][Rr][Rr][Uu][Pp][Tt][Ee][Dd]\\)") > ; smaller subset of keywords for =20 > ensuring no conflict with Org mode TODO keywords > > ;; FIXME Highlighting all special keywords but "TODO" in Org mode is =20= > already a > ;; good step. Though, a nicer integration would be that "TODO" =20 > strings in the > ;; headings are not touched by this code, and that only "TODO" =20 > strings in the > ;; text body would be. Don't know (yet) how to do that... > (make-face 'keywords-org-critical) > (GNUEmacs (set-face-attribute 'keywords-org-critical nil :foreground =20= > "red" :background "yellow" :weight 'bold)) > > (setq keywords-normal-pattern "\\([Ww][Aa][Rr][Nn][Ii][Nn][Gg]\\)") > (make-face 'keywords-normal) > (GNUEmacs (set-face-attribute 'keywords-normal nil :foreground =20 > "magenta2" :background "yellow")) > > ;; set up highlighting of special words for proper selected major =20 > modes only > (dolist (mode '(fundamental-mode > svn-log-view-mode > text-mode)) ; no interference with Org mode (which =20 > derives from text-mode) > (font-lock-add-keywords mode > `((,keywords-critical-pattern 1 'keywords-=20 > critical prepend) > (,keywords-normal-pattern 1 'keywords-=20 > normal prepend)))) > > ;; set up highlighting of special words for Org mode only > (dolist (mode '(org-mode)) > (font-lock-add-keywords mode > `((,keywords-org-critical-pattern 1 =20 > 'keywords-org-critical prepend) > (,keywords-normal-pattern 1 'keywords-=20 > normal prepend)))) > > ;; add fontification patterns (even in comments) to a selected major =20= > mode > ;; *and* all major modes derived from it > (defun fontify-keywords () > (interactive) > (font-lock-add-keywords nil > `((,keywords-critical-pattern 1 'keywords-=20 > critical prepend) > (,keywords-normal-pattern 1 'keywords-=20 > normal prepend)))) > > ;; set up highlighting of special words for selected major modes =20 > *and* all > ;; major modes derived from them > (dolist (hook '(c++-mode-hook c-mode-hook change-log-mode-hook cperl-=20= > mode-hook css-mode-hook > emacs-lisp-mode-hook > html-mode-hook > java-mode-hook > latex-mode-hook lisp-mode-hook > makefile-mode-hook message-mode-hook > php-mode-hook python-mode-hook > sh-mode-hook shell-mode-hook ssh-config-mode-hook)) > (add-hook hook 'fontify-keywords)) > --8<---------------cut here---------------end--------------->8--- > > The goal is to highlight words such as FIXME, WARNING, XXX, TODO in =20= > as many > files as possible. > > For Org, a small custom (of the custom) is done in order not to =20 > catch all TODO > words: the TODO words in headlines (i.e., preceded by `* ') are *not* > highlighted. > > They are well highlighted when found in other portions of (normal) =20 > text. > > Other custom: > > --8<---------------cut here---------------start------------->8--- > ;; highlight columns 78 to 80 in some modes > (when (try-require 'column-marker) > (dolist (hook '(emacs-lisp-mode-hook > cperl-mode-hook > shell-mode-hook > text-mode-hook > change-log-mode-hook > makefile-mode-hook > message-mode-hook > texinfo-mode-hook)) > (add-hook hook (lambda () > (interactive) > (column-marker-1 78) > (column-marker-2 79) > (column-marker-3 80)))) > --8<---------------cut here---------------end--------------->8--- > > for getting markers in columns 78 to 80, showing me I'm good for a =20 > `M-q'... > > I've done multiple tests, now: > > - with none of the 2 above sets of customs > - with the 1st custom disabled, and the column-marker one enabled > - with both enabled > > Times observed (in seconds): > > | | no highlight | column marker only | all highlights | > |------+--------------+--------------------+----------------| > | | 63 | 82 | 91 | > | | 65 | 84 | 96 | > | | 76 | 100 | 130 | > |------+--------------+--------------------+----------------| > | mean | 68 | 89 | 106 | > > (note that times are really not that stable, while I always launched =20= > Emacs in > the same conditions, without doing anything else during that time!) > > So, the above 2 sets of customs have a real impact on the load time. > > But I'm still unsure how I have to change all of the above snippets =20= > of code, > in order to keep the same functionality, but without the time delays =20= > when > Emacs starts up... > > >> Hope some of this helps. If not, let me see you full configuration =20= >> - maybe I >> can spot something else. > > My .emacs file is there: > > http://www.mygooglest.com/sva/emacs-init-sva.el > > Though it's well documented, it's not a tiny one... But very well =20 > structured, > so quite easy to find stuff related to each other. > > I'm always interested by any comment... > > Best regards, > Seb > > --=20 > S=E9bastien Vauban > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten