瀏覽代碼

New STARTUP keyword `showeverything'

This will make even drawer contents visible upon startup.
Carsten Dominik 15 年之前
父節點
當前提交
2e8ece9219
共有 4 個文件被更改,包括 29 次插入12 次删除
  1. 5 0
      doc/ChangeLog
  2. 7 3
      doc/org.texi
  3. 4 0
      lisp/ChangeLog
  4. 13 9
      lisp/org.el

+ 5 - 0
doc/ChangeLog

@@ -1,3 +1,8 @@
+2009-09-18  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.texi (Visibility cycling): Document showeverything keyword.
+	(In-buffer settings): Document showeverything keyword.
+
 2009-09-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.texi (Setting up the staging area): Fix the example.

+ 7 - 3
doc/org.texi

@@ -894,6 +894,7 @@ the previously used indirect buffer.
 @cindex @code{overview}, STARTUP keyword
 @cindex @code{content}, STARTUP keyword
 @cindex @code{showall}, STARTUP keyword
+@cindex @code{showeverything}, STARTUP keyword
 
 When Emacs first visits an Org file, the global state is set to
 OVERVIEW, @ie only the top level headlines are visible.  This can be
@@ -905,6 +906,7 @@ buffer:
 #+STARTUP: overview
 #+STARTUP: content
 #+STARTUP: showall
+#+STARTUP: showeverything
 @end example
 
 @cindex property, VISIBILITY
@@ -10171,10 +10173,12 @@ tree.  The corresponding variable for global default settings is
 @cindex @code{overview}, STARTUP keyword
 @cindex @code{content}, STARTUP keyword
 @cindex @code{showall}, STARTUP keyword
+@cindex @code{showeverything}, STARTUP keyword
 @example
-overview   @r{top-level headlines only}
-content    @r{all headlines}
-showall    @r{no folding at all, show everything}
+overview         @r{top-level headlines only}
+content          @r{all headlines}
+showall          @r{no folding of any entries}
+showeverything   @r{show even drawer contents}
 @end example
 
 @vindex org-startup-indented

+ 4 - 0
lisp/ChangeLog

@@ -9,6 +9,10 @@
 	(org-update-dblock): Apply the indentation of the begin line to
 	the rest of the block.
 	(org-ctrl-c-ctrl-c): Also find indented dblock lines.
+	(org-startup-folded): New allowed value `showeverything'.
+	(org-startup-options): Add STARTUP keyword `showeverything'.
+	(org-set-startup-visibility): Respect value `showeverything' in
+	org-startup-folded.
 
 2009-09-17  Carsten Dominik  <carsten.dominik@gmail.com>
 

+ 13 - 9
lisp/org.el

@@ -286,14 +286,16 @@ is Emacs 23 only."
 This can also be configured on a per-file basis by adding one of
 the following lines anywhere in the buffer:
 
-   #+STARTUP: fold
-   #+STARTUP: nofold
-   #+STARTUP: content"
+   #+STARTUP: fold              (or `overview', this is equivalent)
+   #+STARTUP: nofold            (or `showall', this is equivalent)
+   #+STARTUP: content
+   #+STARTUP: showeverything"
   :group 'org-startup
   :type '(choice
 	  (const :tag "nofold: show all" nil)
 	  (const :tag "fold: overview" t)
-	  (const :tag "content: all headlines" content)))
+	  (const :tag "content: all headlines" content)
+	  (const :tag "show everything, even drawers" showeverything)))
 
 (defcustom org-startup-truncated t
   "Non-nil means, entering Org-mode will set `truncate-lines'.
@@ -3510,6 +3512,7 @@ After a match, the following groups carry important information:
     ("overview" org-startup-folded t)
     ("nofold" org-startup-folded nil)
     ("showall" org-startup-folded nil)
+    ("showeverything" org-startup-folded showeverything)
     ("content" org-startup-folded content)
     ("indent" org-startup-indented t)
     ("noindent" org-startup-indented nil)
@@ -5105,11 +5108,12 @@ With a numeric prefix, show all headlines up to that level."
    ((eq org-startup-folded 'content)
     (let ((this-command 'org-cycle) (last-command 'org-cycle))
       (org-cycle '(4)) (org-cycle '(4)))))
-  (if org-hide-block-startup (org-hide-block-all))
-  (org-set-visibility-according-to-property 'no-cleanup)
-  (org-cycle-hide-archived-subtrees 'all)
-  (org-cycle-hide-drawers 'all)
-  (org-cycle-show-empty-lines 'all))
+  (unless (eq org-startup-folded 'showeverything)
+    (if org-hide-block-startup (org-hide-block-all))
+    (org-set-visibility-according-to-property 'no-cleanup)
+    (org-cycle-hide-archived-subtrees 'all)
+    (org-cycle-hide-drawers 'all)
+    (org-cycle-show-empty-lines 'all)))
 
 (defun org-set-visibility-according-to-property (&optional no-cleanup)
   "Switch subtree visibilities according to :VISIBILITY: property."