From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Having (too) many files in org-agenda-files Date: Thu, 30 Sep 2010 00:20:24 +0200 Message-ID: <87fwwsfazb.fsf@mundaneum.com> References: <878w2lso50.fsf@mundaneum.com> <877hi56jc0.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Carsten, Carsten Dominik wrote: > On Sep 29, 2010, at 10:32 AM, S=C3=A9bastien Vauban wrote: >> Carsten Dominik wrote: >>> On Sep 28, 2010, at 8:45 PM, S=C3=A9bastien Vauban wrote: >>>> 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 ti= me. >>>> The problem is the load-time of my Emacs, now 221 seconds, coming from= 20 >>>> seconds before the heavy use of Org... >>> >>> 4 minutes of startup time is entirely unacceptable. And I think 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 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 called >> for Org files. Maybe there are interactions? >> >> [Using org-agenda-text-search-extra-files] reduces my load time from 221 >> seconds down to 92 seconds. Already a huge diff! > > Still bad though. I am wondering what is causing the fontification messag= e. > 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. You've seen, from my reply to Matt, why my *Messages* buffer is more verbose than yours. It's on purpose, just to be able to figure out more easily what= 's going on. Though, I don't have yet... > 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 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 at startup, or a long time just a few minutes later has the same impact for me. And: don't try to make me stop using Org=C2=A0;-)) > 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? 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]\\|[Mm][Ii= ][Ss][Ss][Ii][Nn][Gg]\\|[Ii][Nn][Vv][Aa][Ll][Ii][Dd]\\|[Ff][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 "red" :bac= kground "yellow" :weight 'bold)) (setq keywords-org-critical-pattern "\\(BUGS\\|FIXME\\|XXX\\|[^*] TODO\\|[Ee][Rr][Rr][Oo][Rr]\\|[Mm][Ii][= Ss][Ss][Ii][Nn][Gg]\\|[Ii][Nn][Vv][Aa][Ll][Ii][Dd]\\|[Ff][Aa][Ii][Ll][Ee][D= d]\\|[Cc][Oo][Rr][Rr][Uu][Pp][Tt][Ee][Dd]\\)") ; smaller subset of keywords for ensuring= no conflict with Org mode TODO keywords ;; FIXME Highlighting all special keywords but "TODO" in Org mode is alread= y a ;; good step. Though, a nicer integration would be that "TODO" strings in t= he ;; headings are not touched by this code, and that only "TODO" strings in t= he ;; 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 "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 "magenta2" := background "yellow")) ;; set up highlighting of special words for proper selected major modes only (dolist (mode '(fundamental-mode svn-log-view-mode text-mode)) ; no interference with Org mode (which derives= from text-mode) (font-lock-add-keywords mode `((,keywords-critical-pattern 1 'keywords-critica= l prepend) (,keywords-normal-pattern 1 'keywords-normal pr= epend)))) ;; set up highlighting of special words for Org mode only (dolist (mode '(org-mode)) (font-lock-add-keywords mode `((,keywords-org-critical-pattern 1 'keywords-org= -critical prepend) (,keywords-normal-pattern 1 'keywords-normal pr= epend)))) ;; add fontification patterns (even in comments) to a selected major mode ;; *and* all major modes derived from it (defun fontify-keywords () (interactive) (font-lock-add-keywords nil `((,keywords-critical-pattern 1 'keywords-critica= l prepend) (,keywords-normal-pattern 1 'keywords-normal pr= epend)))) ;; set up highlighting of special words for selected major modes *and* all ;; major modes derived from them (dolist (hook '(c++-mode-hook c-mode-hook change-log-mode-hook cperl-mode-h= ook 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 as many files as possible. For Org, a small custom (of the custom) is done in order not to catch all T= ODO words: the TODO words in headlines (i.e., preceded by `* ') are *not* highlighted. They are well highlighted when found in other portions of (normal) 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 `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 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 of code, in order to keep the same functionality, but without the time delays when Emacs starts up... > Hope some of this helps. If not, let me see you full configuration - mayb= e 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 structure= d, so quite easy to find stuff related to each other. I'm always interested by any comment... Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode