diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2009-07-01 09:34:13 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2009-07-01 09:34:13 +0200 |
commit | c1a4c5901acecf80ed198065e9a5e18e6667fb14 (patch) | |
tree | 40bdf88a8563df36bcc68e71868b3586b3406186 | |
parent | 31e35da86385702c541df93023913732e4d1023f (diff) | |
download | org-mode-c1a4c5901acecf80ed198065e9a5e18e6667fb14.tar.gz |
Plain lists: Improvements to cycling with TAB.
TAB now cycles visibility in plain lists if the cursor is in a plain
list. This corresponds now to the new default value `t' of
`org-cycle-include-plain-lists'. If you want to treat plain list
items as part of the outline hierarchy during cycling of outline
headings (this is what a `t' value used to mean), set this variable to
`integrate'.
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/org.texi | 11 | ||||
-rwxr-xr-x | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/org-list.el | 29 | ||||
-rw-r--r-- | lisp/org.el | 3 |
5 files changed, 40 insertions, 14 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 43c984f..8ffbcf8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2009-07-01 Carsten Dominik <carsten.dominik@gmail.com> + + * org.texi (Plain lists): Document new behavior of + `org-cycle-include-plain-lists'. + 2009-06-30 Carsten Dominik <carsten.dominik@gmail.com> * org.texi: Hyphenation only in TeX. diff --git a/doc/org.texi b/doc/org.texi index 5db7b01..f2627b1 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1368,11 +1368,12 @@ of an item (the line with the bullet or number). @kindex @key{TAB} @item @key{TAB} @vindex org-cycle-include-plain-lists -Items can be folded just like headline levels if you set the variable -@code{org-cycle-include-plain-lists}. The level of an item is then -given by the indentation of the bullet/number. Items are always -subordinate to real headlines, however; the hierarchies remain -completely separated. +Items can be folded just like headline levels. Normally this works only if +the cursor is on a plain list item. For more details, see the variable +@code{org-cycle-include-plain-lists}. to @code{integrate}, plain list items +will be treated like low-level. The level of an item is then given by the +indentation of the bullet/number. Items are always subordinate to real +headlines, however; the hierarchies remain completely separated. If @code{org-cycle-include-plain-lists} has not been set, @key{TAB} fixes the indentation of the current line in a heuristic way. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 617b49d..5bbd422 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2009-07-01 Carsten Dominik <carsten.dominik@gmail.com> + * org.el (org-cycle): Honor the `integrate' value of + org-cycle-include-plain-lists'. + + * org-list.el (org-cycle-include-plain-lists): New allowed value + `internal'. Improve the docstring. + * org.el (org-set-autofill-regexps): Improve the paragraph-start regexp to work better with LaTeX commands. diff --git a/lisp/org-list.el b/lisp/org-list.el index ff0ccbb..a195ac6 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -57,15 +57,28 @@ :tag "Org Plain lists" :group 'org-structure) -(defcustom org-cycle-include-plain-lists nil - "Non-nil means, include plain lists into visibility cycling. -This means that during cycling, plain list items will *temporarily* be -interpreted as outline headlines with a level given by 1000+i where i is the -indentation of the bullet. In all other operations, plain list items are -not seen as headlines. For example, you cannot assign a TODO keyword to -such an item." +(defcustom org-cycle-include-plain-lists t + "When t, make TAB cycle visibility on plain list items. + +Cycling plain lists works only when the cursor is on a plain list +item. When the cursor is on an outline heading, plain lists are +treated as text. This is the most stable way of handling this, +which is why it is the default. + +When this is the symbol `integrate', then during cycling, plain +list items will *temporarily* be interpreted as outline headlines +with a level given by 1000+i where i is the indentation of the +bullet. This setting can lead to strange effects when switching +visibility to `children', because the first \"child\" in a +subtree decides what children should be listed. If that first +\"child\" is a plain list item with an implied large level +number, all true children and grand children of the outline +heading will be exposed in a children' view." :group 'org-plain-lists - :type 'boolean) + :type '(choice + (const :tag "Never" nil) + (const :tag "With cursor in plain list (recommended)" t))) + (const :tag "As children of outline headings" integrate) (defcustom org-plain-list-ordered-item-terminator t "The character that makes a line with leading number an ordered list item. diff --git a/lisp/org.el b/lisp/org.el index 8c997b0..fde19b5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4730,7 +4730,8 @@ in special contexts. (outline-regexp (cond ((not (org-mode-p)) outline-regexp) - (org-cycle-include-plain-lists + ((or (eq org-cycle-include-plain-lists 'integrate) + (and org-cycle-include-plain-lists (org-at-item-p))) (concat "\\(?:\\*" (if nstars (format "\\{1,%d\\}" nstars) "+") " \\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)")) |