소스 검색

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.
Bastien Guerry 12 년 전
부모
커밋
36dba0cf6e
1개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      lisp/org.el

+ 16 - 0
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