From 36dba0cf6e0f3d958aaff4e9df5a6977ee0953fa Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 26 Jan 2013 10:57:47 +0100 Subject: [PATCH] org.el (org-agenda-inhibit-startup-visibility-cycling): New option * org.el (org-agenda-inhibit-startup-visibility-cycling): New option. (org-agenda-prepare-buffers): Use it to speed up the agenda generation. This change will boost agenda creation *a lot*, especially for people using many agenda files. See the docstring of the new option for details. --- lisp/org.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index afc2b7a95..7467db7c3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16662,6 +16662,20 @@ effort string \"2hours\" is equivalent to 120 minutes." :type '(alist :key-type (string :tag "Modifier") :value-type (number :tag "Minutes"))) +(defcustom org-agenda-inhibit-startup-visibility-cycling t + "Turn off visibility cycling when preparing agenda buffers. + +When preparing agenda buffers, Org visits agenda files. When +this variable is `t' (the default), the visited buffers for +agenda files will not honor `org-startup-folded' or any +#+STARTUP: fold option. Turning this option off may slow down +the generation of agenda, both because folding takes time and +because finding entries in folded buffers takes longer than +finding entries in unfolded ones." + :type 'boolean + :version "24.3" + :group 'org-agenda) + (defun org-duration-string-to-minutes (s &optional output-to-string) "Convert a duration string S to minutes. @@ -17001,6 +17015,8 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (pc '(:org-comment t)) (pall '(:org-archived t :org-comment t)) (inhibit-read-only t) + (org-inhibit-startup-visibility-stuff + org-agenda-inhibit-startup-visibility-cycling) (rea (concat ":" org-archive-tag ":")) bmp file re) (save-excursion