* lisp/org.el (org-set-autofill-regexps): use `org-item-re' in
`paragraph-start' to recognize alphabetical lists.
(org-fill-paragraph): enforce a pre-computed fill-prefix before
calling fill-paragraph when point in in an item. Also prevent
paragraphs getting merged into an adjacent list upon filling.
(org-adaptive-fill-function): make sure to determine real fill-prefix
for auto-fill.
(org-auto-fill-function): use a pre-computed fill-prefix before
calling do-auto-fill.
* lisp/org-list.el (org-list-item-body-column): new function
* lisp/org-inlinetask.el (org-inlinetask-at-task-p,
org-inlinetask-toggle-visibility): new functions.
* lisp/org-list.el (org-list-set-item-visibility): new function.
* lisp/org.el (org-cycle, org-cycle-internal-local): separate lists
and inline tasks from headlines.
(org-outline-level): do not consider lists as headlines.
Cycling visibility is using different tools.
* lisp/org-list.el (org-list-struct): mark items less indented than
top item of the list, so that they will be modified.
(org-list-struct-apply-struct): compare struct's indentation with
line's indentation instead of old-struct's. This is needed because
`org-list-struct' automatically fixes indentation so changes might not
be seen otherwise.
* lisp/org.el (org-ctrl-c-ctrl-c): small refactoring.
* lisp/org-list.el (org-update-checkbox-count): when a part of the
buffer is processed to count checkboxes, lists are read from top to
bottom, but inside lists (in drawers, blocks, or inline tasks) are
skipped. Thus, cookies cannot be updated. This patch enforces
reading of such lists if counter is itself in a special context.
* lisp/org-list.el (org-list-struct-apply-struct): inline tasks along
with their content must stay at column 0 even if the item is gaining
indentation. Moreover, fix indentation of text in an inline task,
now it can be in such a task within a list.
* lisp/org-list.el (org-at-item-p): also verify context is valid.
Otherwise it would recognize valid items where org-in-item-p
wouldn't.
(org-in-item-p, org-list-struct-apply-struct): use shorter version of
org-at-item-p.
(org-cycle-list-bullet): fix typo.
(org-list-parse-list): avoid calling org-at-item-p two times by using
an appropriate regexp
* lisp/org.el (org-indent-line-function): use an appropriate regexp
instead of calling org-at-item-p two times.
* lisp/org-list.el (org-in-item-p): When point was just after
org-list-end-re, check wouldn't be done for starting line. So, if
the first line was an item, it wouln't be noticed and function would
return nil. Simplify and comment code.
* lisp/org-list.el (org-list-struct-apply-struct): if end of list was
at eol, for example, with list inside a block, the last list
wouldn't be shifted. Thus, the patch ensures no blank lines is
skipped.
* lisp/org-list.el (org-list-struct): when a line has org-example
property, skip the entire block. This is needed during export, for
example when src blocks in org markup contain lists, and are
returned verbatim because org isn't in the list of interpreted
languages.
* lisp/org-list.el (org-list-insert-item-generic): change arguments.
The function now accepts structure and previous items alist. This
allow to insert an item programmatically more easily.
(org-insert-item): Apply changes to org-list-insert-item-generic. The
function now takes care about repairing structure and updating
checkboxes.
* lisp/org-timer.el (org-timer-item): Apply changes to
org-list-insert-item-generic. The function now takes care about
repairing structure.
* lisp/org-list.el (org-list-make-subtree): function now uses
org-list-parse-list mechanism.
(org-list-make-subtrees): removed function.
(org-list-to-generic): added a parameter and every parameter can be a
sexp returning a string, for finer control.
(org-list-to-html, org-list-to-latex, org-list-to-texinfo): slight
modifications to apply changes to org-list-to-generic.
(org-list-to-subtree): new function.
* lisp/org-list.el (org-at-item-counter-p): new function.
(org-list-parse-list): handle counters and list depth.
(org-list-to-generic): a special string is used when an item has a
counter.
(org-list-to-latex): use new special string for counters. This fixes
the counter bug in LaTeX export, as the enumi counter was the only one
modified.
* lisp/org-latex.el (org-export-latex-lists): use new
`org-list-parse-list' output.
* lisp/org-list.el (org-list-get-list-type): new function.
(org-list-parse-list): use new function.
* lisp/org-html.el (org-html-export-list-line): use new function.
* lisp/org-docbook.el (org-export-docbook-list-line): use new function.
* lisp/org-list.el (org-alphabetical-lists): new variable
(org-item-re, org-list-full-item, org-cycle-list-bullet,
org-list-struct-fix-bul, org-list-inc-bullet-maybe): reflect
introduction of the new variable.
(org-item-beginning-re): changed into a function, so any modification
of `org-alphabetical-lists' will not require reloading Org.
(org-at-item-p, org-toggle-checkbox, org-update-checkbox-count,
org-list-parse-list, org-list-send-list): reflect changes to
`org-item-beginning-re'.
(org-list-use-alpha-bul-p): new function.
* lisp/org.el (org-check-for-hidden): reflect changes to
`org-item-beginning-re'.
* lisp/org-capture.el (org-capture-place-item): reflect changes to
`org-item-beginning-re'.
* lisp/org-docbook.el (org-export-docbook-list-line): handle new type
of items.
* lisp/org-exp.el (org-export-mark-list-end,
org-export-mark-list-properties): reflect changes to
`org-item-beginning-re'.
* lisp/org-html.el (org-html-export-list-line): handle new type of
items.
* lisp/org-latex.el (org-export-latex-lists): handle new type of items
and reflect changes to `org-item-beginning-re'.
* lisp/org-ascii.el (org-export-ascii-preprocess): handle new counters.
Modified from a patch by Nathaniel Flath.
* lisp/org-list.el (org-list-end-re): removed function and made it a
variable. There's no need for the overhead of calling the function
every at every line in a list. User will have to reload Org if he
change value of either `org-list-end-regexp' or
`org-empty-line-terminates-plain-lists'.
(org-in-item-p,org-list-struct,org-list-parse-list): apply change.
* lisp/org-exp.el (org-export-mark-list-end,
org-export-mark-list-properties): apply change
* lisp/org-latex.el (org-export-latex-lists): apply change. Also
prevent items with org-example property to be considered as real
items.
When the function needs to know if cursor is in a plain list and move
to item beginning if it is the case, a fast way is to ignore errors on
(goto-char (org-in-item-p)).
* lisp/org-inlinetask.el (org-inlinetask-export-templates): slightly
modify templates so environment boundaries don't interfere with
content of task. Unprotect content of task so it might benefit from
further transformations. Set original-indentation property to a high
value to ensure that task is always in the last item of the list.
Also, apply templates later in export process.
* lisp/org-list.el (org-list-struct): fix inline task skipping.
* lisp/org-list.el (org-list-automatic-rules): removed insert rule.
(org-list-insert-item-generic): removed code preventing user to insert
another item in a block within a list. It is because new list context
make it impossible to see if a point in a block is also in a list.
* lisp/org-list.el (org-update-checkbox-count): do not recompute every
list before next heading when there are more than one cookie in an
headline. Moreover, ignore the case where cookie is inserted neither
at an heading nor at an item.
* lisp/org-list.el (org-sort-list): fix number of arguments to
`org-list-repair', plus make end-record go to end of item before any
blank line to keep them from being swallowed in the sorting.
* lisp/org-list.el (org-list-forbidden-blocks): variable renamed from
org-list-blocks.
(org-list-export-context): new variable
* list/org-exp.el (org-export-mark-lists): use new variable.
* list/org-latex.el (org-export-latex-lists): use new variable
* lisp/org-list.el (org-list-search-generic): renamed form
org-search-unenclosed-generic to reflect now behavior. Now, match
can only be in a valid context for lists, as determined by
`org-list-context'.
(org-list-search-backward): renamed from
org-search-backward-unenclosed.
(org-list-search-forward): renamed from org-search-forward-unenclosed.
(org-toggle-checkbox,org-update-checkbox-count): use new functions.
(org-sort-list): using default regexp search functions as context is
not required in this case.
* lisp/org-ascii.el (org-export-ascii-preprocess): use new function
* lisp/org-capture.el (org-capture-place-item): use new function
* lisp/org-exp.el (org-export-mark-lists): new function, replacing
org-export-mark-list-ending. It adds information as text properties
to every list, before changes done by exporter destruct them.
* lisp/org-html.el (org-export-as-html): delegate list handling to
external function org-html-export-list-line.
(org-html-export-list-line): new function.
* lisp/org-latex.el (org-export-latex-lists): small modification.
* lisp/org-list.el (org-list-get-first-item): new alias for
org-list-get-list-begin
(org-list-get-last-item): new function
(org-list-get-list-end): use org-list-get-last-item
* lisp/org.el (org-get-string-indentation): moved in generally useful
functions section, as it wasn't specific to plain lists and that no
code was using it in org-list.el.
* list/org-list.el (org-list-indent-item-generic): remove error
messages happening before process. This belongs to interactive
functions.
(org-indent-item,org-indent-item-tree,
org-outdent-item,org-outdent-item-tree): ensure point or region is
correct before computing list structure. Return an error message
otherwise.
* lisp/org-list.el (org-apply-on-list): use new structures. Function
is now applied in reverse order so modifications do not change
positions of items in buffer.
* org-list.el (org-list-parse-list): rewrite of function to allow text
following a sub-list in the same item. See docstring for an example
of output.
(org-list-to-generic): use new parsing function.
(org-list-to-latex,org-list-to-html): minor change for clearer export.
* org-list.el (org-list-has-child-p): renamed from org-list-get-child.
Returning first child is only useful as a predicate, as we're
allowing an item to have more than one sub-list.
(org-list-indent-item-generic): use `org-list-has-child-p' instead of
org-list-get-child.
(org-in-item-p): also return item beginning when list starts at
context beginning.
(org-list-get-parent): use of `org-list-struct-parent-alist' helper
function is not optional anymore.
(org-list-get-all-items): shorten code with the help of cl.el.
(org-list-get-children): now returns all children of item, even if
they do not belong to the same list. Renamed from
org-list-get-all-children.
(org-list-get-list-begin): function wasn't return value when item was
already the first item of the list at point.
(org-list-get-list-end): function wasn't return value when item was
already the last item of the list at point.
(org-list-struct-fix-box,org-update-checkbox-count): now uses
`org-list-get-children'.
* org-list.el (org-list-separating-blank-lines-number): use new
accessors.
(org-list-insert-item-generic): use list structures to insert a new
item.
(org-list-exchange-items): refactor and comment code. Now return new
struct instead of modifying it, as list sorting would sometimes eat
first item.
(org-move-item-down,org-move-item-up): reflect changes to
`org-list-exchange-items'.
(org-insert-item): as `org-in-item-p' also computes item beginning
when applicable, reuse the result.
* org-timer.el (org-timer-item): as `org-in-item-p' also computes item
beginning when applicable, reuse the result.
* lisp/org-list.el (org-list-in-item-p): unify methods for this predicate.
(org-list-in-item-p-with-indent): removed function
(org-list-ending-between): removed function
(org-list-maybe-skip-block): removed function
(org-list-in-item-p-with-regexp): removed function
(org-list-top-point-with-regexp): removed function
(org-list-top-point-with-indent): removed function
(org-list-bottom-point-with-indent): removed function
(org-list-bottom-point-with-regexp): removed function
(org-list-get-item-same-level): removed function
(org-list-top-point): removed function
(org-list-bottom-point): removed function
(org-get-item-beginning): renamed to org-list-get-item-begin to be
consistent with naming policy of non-interactive functions.
(org-get-beginning-of-list): removed function
(org-beginning-of-item-list): use new accessors
(org-get-end-of-list): removed function
(org-end-of-list): use new accessors
(org-get-end-of-item): removed function
(org-end-of-item): use new accessors
(org-get-previous-item): removed function
(org-previous-item): use new accessors
(org-get-next-item): removed function
(org-next-item): use new accessors
(org-end-of-item-before-blank): renamed to
(org-list-get-item-end-before-blank): Use new accessors.
* org-list.el (org-list-repair): removed optional argument
FORCE-BULLET. The job of this interactive function is to completely
fix a list at point. Changing bullets is a separate task. Also
removed others optional arguments TOP and BOTTOM to follow the new
structures.
(org-list-indent-item-generic): remove need for TOP and BOTTOM. STRUCT
is a new required argument. This avoids computing a list structure
many times when function is called more than once in a row, for
example in org-cycle-item-indentation. Use new accessors. Now, also
call `org-update-checkbox-count-maybe'.
(org-outdent-item,org-indent-item,org-outdent-item-tree,org-indent-item-tree):
remove need for TOP and BOTTOM.
(org-list-insert-item-generic): reflect changes to `org-list-repair'.
(org-list-exchange-items): use new accessors. Now modify struct to
avoid re-reading it later.
(org-move-item-down): reflect changes to `org-list-repair'. Use new
accessors.
(org-move-item-up): reflect changes to `org-list-repair'. Use new
accessors.
(org-cycle-list-bullet): use new structures. Also use a shortcut to
`org-list-struct-fix-struct' in order to avoid unnecessary fixes, like
`org-list-struct-fix-box'
(org-sort-list): use of new structures. Renamed an internal function
for a little more clarity.
(org-cycle-item-indentation): remove dependency on org-list-repair.
Use new accessors.
(org-list-get-child): correct bug when asking for the child of the
last item
(org-list-exchange-items): use new accessors.
* lisp/org-list.el (org-list-blocks): new variable
(org-list-context): new function
(org-list-full-item-re): new variable
(org-list-struct-assoc-at-point): use new varible
(org-list-struct): rewrite of function. Now, list data is collected by
looking at the list line after line. It reads the whole list each time
because reading only a subtree was not enough for some operations,
like fixing checkboxes. It also removes the need to get
`org-list-top-point' and `org-list-bottom-point' first. An added data
is the position of item ending. This aims to be able to have list
followed by text inside an item.
(org-list-struct-assoc-end): new function
(org-list-struct-parent-alist): new function
(org-list-get-parent): new function
(org-list-get-child): new function
(org-list-get-next-item): new function
(org-list-get-prev-item): new function
(org-list-get-subtree): use helper function `org-list-struct-prev-alist'.
(org-list-get-all-items): new function
(org-list-get-all-children): new function
(org-list-get-top-point): new function
(org-list-get-bottom-point): new function
(org-list-get-counter): new function
(org-list-get-item-end): new function
(org-list-struct-fix-bul): rewrite for cleaner code. Make use of new
accessors.
(org-list-struct-fix-ind): make use of new accessors.
(org-list-struct-fix-box): new function
(org-list-struct-fix-checkboxes): removed function
(org-list-struct-outdent): use new accessors. Use the fact that there
is no longer a virtual item at beginning of structure.
(org-list-struct-indent): use helper functions
`org-list-struct-prev-alist' and `org-list-struct-parent-alist'. Also
use new accessors.
(org-list-struct-fix-struct): comment function. Call directly
`org-list-struct-apply-struct', without removing unchanged items
first.
(org-list-struct-apply-struct): comment function. Rewrite using new
accessors. Use new variable `org-list-full-item-re'.
(org-list-shift-item-indentation): removed function, now included in
`org-list-struct-apply-struct' because it is too specific.
Conflicts:
lisp/org-list.el
org-list: new way to get structure of a list and new accessors
* lisp/org-list.el (org-list-blocks): new variable
(org-list-context): new function
(org-list-full-item-re): new variable
(org-list-struct-assoc-at-point): use new varible
(org-list-struct): rewrite of function. Now, list data is collected by
looking at the list line after line. It reads the whole list each time
because reading only a subtree was not enough for some operations,
like fixing checkboxes. It also removes the need to get
`org-list-top-point' and `org-list-bottom-point' first. An added data
is the position of item ending. This aims to be able to have list
followed by text inside an item.
(org-list-struct-assoc-end): new function
(org-list-struct-parent-alist): new function
(org-list-get-parent): new function
(org-list-get-child): new function
(org-list-get-next-item): new function
(org-list-get-prev-item): new function
(org-list-get-subtree): use helper function `org-list-struct-prev-alist'.
(org-list-get-all-items): new function
(org-list-get-all-children): new function
(org-list-get-counter): new function
(org-list-get-item-end): new function
(org-list-struct-fix-bul): rewrite for cleaner code. Make use of new
accessors.
(org-list-struct-fix-ind): make use of new accessors.
(org-list-struct-fix-box): new function
(org-list-struct-fix-checkboxes): removed function
(org-list-struct-outdent): use new accessors. Use the fact that there
is no longer a virtual item at beginning of structure.
(org-list-struct-indent): use helper functions
`org-list-struct-prev-alist' and `org-list-struct-parent-alist'. Also
use new accessors.
(org-list-struct-fix-struct): comment function. Call directly
`org-list-struct-apply-struct', without removing unchanged items
first.
(org-list-struct-apply-struct): comment function. Rewrite using new
accessors. Use new variable `org-list-full-item-re'.
(org-list-shift-item-indentation): removed function, now included in
`org-list-struct-apply-struct' because it is too specific.
Conflicts:
lisp/org-list.el
* lisp/org-list.el (org-list-get-all-items): new function
(org-list-get-all-children): new function
(org-list-get-nth): new function
(org-list-set-nth): new function
(org-list-get-ind): new function
(org-list-set-ind): new function
(org-list-get-bullet): new function
(org-list-set-bullet): new function
(org-list-get-checkbox): new function
(org-list-set-checkbox): new function
(org-list-struct-fix-bul): use new accessors
(org-list-repair): use new accessors
(org-list-indent-item-generic): make use of accessors
(org-list-get-parent): renamed from org-list-struct-get-parent
(org-list-get-child): renamed from org-list-struct-get-child
(org-list-struct-fix-ind): make use of accessors
(org-list-get-next-item): new function
(org-list-get-subtree): new function
* lisp/org-list.el (org-list-struct-assoc-at-point): add checkbox to
list structure
* lisp/org-list.el (org-list-struct-assoc-at-point): add checkbox as
value in structure
* lisp/org-list.el (org-list-struct-apply-struct): also apply checkboxes
I just found a left over in org-list.el. :)
Updated patch attached.
>From bf6c65a42e04d4753c58795442a479685bb5f318 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Wed, 26 Jan 2011 11:14:11 +0100
Subject: [PATCH] org: remove org-invisible-p
* org.el: Remove org-invisible-p: outline-invisible-p is
available in Emacs 22 and in recent XEmacs 21. Replace in
various files.
Signed-off-by: Julien Danjou <julien@danjou.info>
* lisp/org-list.el (org-list-top-point-with-indent,
org-list-bottom-point-with-indent): Pay also attention to
'original-indentation property of text, as blocks are put to column
0 upon exporting.
* lisp/org-latex.el (org-export-latex-lists): do not add an
unnecessary newline character after a list.
* lisp/org-list.el (org-list-bottom-point-with-indent): ensure bottom
point is just after a non blank line.
* org-list.el (org-list-bottom-point-with-indent): do not check
indentation of a non-empty blank line.
* org-list.el (org-sort-list): sort a list with point anywhere inside
it.
* org-list.el (org-cycle-list-bullet): follow order of bullets
indicated in doc-string.
* org-list.el (org-list-bottom-point-with-indent): list is ended when
a line is less indented that the last item, not the less indented item.
* org-list.el (org-list-insert-item-generic): Updating checkboxes can
modifiy bottom point of a list, so make it a marker before calling
`org-update-checkbox-count-maybe'.
* org-list.el (org-toggle-checkbox): Ignore items in drawers when used
from an heading. Send an error when no item is in region.
* org-list.el (org-update-checkbox-count): Correctly handle argument
ALL. Speed optimization.
* org-ascii.el (org-export-ascii-preprocess): allow [@start:x] and
[@x] syntax for list numbering.
* org-capture.el (org-capture-place-item): make use of new tools.
* org-capture.el (org-capture-insert-template-here): mark use of new
tools.
* org-docbook.el (org-export-as-docbook): remove list ending detection
as they are now marked explicitely.
* org-exp.el (org-export-mark-list-ending): new function.
* org-exp.el (org-export-preprocess-string): mark list endings with
`org-export-mark-list-ending'.
* org-html.el (org-export-as-html): remove list ending detection as
they are now marked explicitely. Use value option in list items
instead of start when special numbering is needed.
* org-latex.el (org-export-latex-lists): make use of new tools.
Allow [start:x] and [@x] syntax for list numbering.
* org-list.el (org-list-two-spaces-after-bullet-regexp): docstring
correction.
* org-list.el (org-list-beginning-re): variable removed.
* org-list.el (org-list-ending-method): new variable.
* org-list.el (org-empty-line-terminates-plain-lists): corrected
docstring to match new lists.
* org-list.el (org-list-end-regexp): new variable.
* org-list.el (org-list-automatic-rules): new variable.
* org-list.el (org-provide-checkbox-statistics): variable removed.
* org-list.el (org-list-end-re): new function.
* org-list.el (org-item-re): allow regexp to properly recognize items
with two spaces after bullet.
* org-list.el (org-item-beginning-re): pay attention to
`org-plain-list-ordered-item-terminator' when defining an item.
Replace `org-list-beginning-re'.
* org-list.el (org-list-ending-between): new function.
* org-list.el (org-list-maybe-skip-block): new function.
* org-list.el (org-list-search-unenclosed-generic): new function.
* org-list.el (org-search-backward-unenclosed): new function.
* org-list.el (org-search-forward-unenclosed): new function.
* org-list.el (org-list-in-item-p-with-indent): new function.
* org-list.el (org-list-in-item-p-with-regexp): new function.
* org-list.el (org-list-top-point-with-regexp): new function.
* org-list.el (org-list-bottom-point-with-regexp): new function.
* org-list.el (org-list-top-point-with-indent): new function.
* org-list.el (org-list-bottom-point-with-indent): new function.
* org-list.el (org-list-at-regexp-after-bullet-p): new function.
* org-list.el (org-list-get-item-same-level): new function.
* org-list.el (org-list-separating-blank-lines-number): new function.
* org-list.el (org-list-insert-item-generic): new function.
* org-list.el (org-list-indent-item-generic): new function.
* org-list.el (org-in-item-p): now depends on `org-list-ending-method'.
* org-list.el (org-list-first-item-p): now needs list top item as
argument.
* org-list.el (org-at-item-timer-p): new function.
* org-list.el (org-at-item-description-p): new function.
* org-list.el (org-checkbox-blocked-p): make use of new tools.
Ignore [@start:x] and [@x] constructs before any checkbox.
* org-list.el (org-list-top-point): new function.
* org-list.el (org-list-bottom-point): new function.
* org-list.el (org-get-item-beginning): new function.
* org-list.el (org-beginning-of-item): make use of new tools.
* org-list.el (org-get-beginning-of-list): new function.
* org-list.el (org-beginning-of-item-list): make use of new list
tools.
* org-list.el (org-get-end-of-list): new function.
* org-list.el (org-end-of-item-list): make use of new tools.
* org-list.el (org-get-end-of-item): new function.
* org-list.el (org-end-of-item): make use of new tools.
* org-list.el (org-end-of-item-text-before-children): function removed.
* org-list.el (org-end-of-item-or-at-child): new function.
* org-list.el (org-end-of-item-before-blank): new function.
* org-list.el (org-get-previous-item): new function.
* org-list.el (org-previous-item): make use of new tools.
* org-list.el (org-get-next-item): new function.
* org-list.el (org-next-item): make use of new tools.
* org-list.el (org-list-exchange-items): new function.
* org-list.el (org-move-item-down): preserve blank lines when moving
items.
* org-list.el (org-move-item-up): preserve blank lines when moving
items.
* org-list.el (org-cycle-list-bullet): Apply rules defined in
`org-list-automatic-rules.
* org-list.el (org-insert-item): check `org-list-automatic-rules'
before inserting a checkbox in an description list. Apply some
heuristics to guess correct number of blank lines to insert between
items.
* org-list.el (org-list-struct-assoc-at-point): new function.
* org-list.el (org-list-struct): new function.
* org-list.el (org-list-struct-origins): new function.
* org-list.el (org-list-struct-get-parent): new function.
* org-list.el (org-list-struct-get-child): new function.
* org-list.el (org-list-struct-fix-bul): new function.
* org-list.el (org-list-struct-fix-ind): new function.
* org-list.el (org-list-struct-fix-struct): new function.
* org-list.el (org-list-struct-outdent): new function.
* org-list.el (org-list-struct-indent): new function.
* org-list.el (org-list-struct-apply-struct): new function.
* org-list.el (org-shift-item-indentation): now needs bottom position
of list as second argument.
* org-list.el (org-item-indent-positions): function removed.
* org-list.el (org-outdent-item): make use of new tools. Document
region handling.
* org-list.el (org-indent-item): make use of new tools. Document
region handling.
* org-list.el (org-outdent-item-tree): make use of new tools. Document
region handling.
* org-list.el (org-indent-item-tree): make use of new tools. Document
region handling.
* org-list.el (org-suppress-item-indentation): variable removed.
* org-list.el (org-cycle-item-indentation): only cycle to meaningful
positions in the list.
* org-list.el (org-list-bullet-string): new function.
* org-list.el (org-get-bullet): remove dependence to
`org-list-item-beginning'.
* org-list.el (org-list-inc-bullet-maybe): new function.
* org-list.el (org-maybe-renumber-ordered-list): function removed.
* org-list.el (org-maybe-renumber-ordered-list): function removed.
* org-list.el (org-renumber-ordered-list): function removed.
* org-list.el (org-fix-bullet-type): function removed.
* org-list.el (org-list-repair): replace both
`org-renumber-ordered-list' and `org-fix-bullet-type'.
* org-list.el (org-toggle-checkbox): make use of new tools.
Handle [@start:x] and [@x] constructs. Check
`org-list-automatic-rules' when inserting a checkbox in a
description list.
* org-list.el (org-update-checkbox-count): make use of new tools.
* org-list.el (org-apply-on-list): new function.
* org-list.el (org-sort-list): new function.
* org-list.el (org-list-item-beginning): function removed.
* org-list.el (org-list-goto-true-beginning): function removed.
* org-list.el (org-list-end): function removed.
* org-list.el (org-list-parse-list): make use of new tools. Handle
[@start:x] and [@x] constructs.
* org-list.el (org-list-send-list): make use of new tools.
* org-list.el (org-list-to-generic): correctly transform description
items.
* org-timer.el (org-timer): added one optional argument to return the
string instead of inserting it in the buffer.
* org-timer.el (org-timer-item): insert timer item at correct column.
Return an error when inserting such item in a list of another type.
* org.el (org-set-font-lock-defaults): correctly fontify [@start:x]
and [@x] structures.
* org.el (org-cycle-internal-local): correctly cycle visibility of
items
* org.el (org-sort): now sort timer items.
* org.el (org-sort-entries-or-items): function removed.
* org.el (org-sort-entries-sort): New function. Replace
`org-sort-entries-or-items'. List sorting code has been moved to
`org-sort-list'.
* org.el (org-add-log-setup): removed extra &optional in arguments.
* org.el (org-store-log-note): make use of new tools. Indent correctly
before inserting an item.
* org.el (org-ctrl-c-ctrl-c): make use of new tools. Unconditionally
repair list when function is called.
* org.el (org-toggle-item): check
`org-list-two-spaces-after-bullet-regexp' when toggling items.
* org.el (org-in-regexps-block-p): allow string and form returning
string as END-RE argument.
* org.el (org-indent-line-function): documented code. Correctly indent
item body and text after a list. Indentation of source code is left
to `org-edit-src-exit'. Indentation of others blocks should be the
same as the #+begin line.
* org-list.el (org-list-struct): accept list boundaries as an
argument in order to avoid computing `org-list-top-point' and
`org-list-bottom-point' twice when indenting.
* org-list.el (org-list-in-item-p-with-indent): Test if first line is
the item beginning.
* org-list.el (org-list-top-point-with-indent): Test if first line is
a valid list beginning.
* org-list.el (org-list-insert-item-generic): A single item already
counting blank lines in his body should be separated with the next
one by a blank line. Moreover, if user already provided blank lines,
follow his wishes.
* org-list.el (org-indent-item-tree): when moving top item of a *-list
to column 0, only the first item had its bullet changed to -. It now
changes all items of the top-level list, as expected.
* org-list.el (org-list-automatic-rules): doc-string reflects this
change.
* org-list.el (org-indent-item-tree): prevent whole list from being
moved when user is not moving subtree. Thus,
`org-cycle-item-indentation' will not allow to move the list.
* org-list.el (org-indent-item-tree): Removed region code. It was prone
to errors and undocumented.
* org-list.el (org-item-indent-positions): Better heuristics to
determine what bullet the item will have when demoted.
* org-list.el (org-list-bullet-string): do not modify match-data.
* org.el (org-toggle-item): now working again when changing list items
into plain text. Moreover take into consideration
`org-list-two-spaces-after-bullet-regexp'.
* org-list.el (org-indent-item-tree): removed unnecessary bullets fix,
and improved heuristics to determine bullet when indenting.
* org-list.el (org-item-indent-positions): function now returns sane
results when there are two lists separated with blank lines only.
* org.el (org-set-font-lock-defaults): Correct fontification for
checkboxes found after [@start:?].
* org-list.el (org-list-at-regexp-after-bullet-p): skip any [@start:?]
when looking at a regex after a bullet.
* org-list.el (org-toggle-checkbox): correct insertion of checkboxes
when there is already a [@start:?] in the item.
* org-list.el (org-checkbox-blocked-p): properly check if there's an
unchecked item before.
* org-list.el (org-list-parse-list): function handles items having
both a counter and a checkbox.
* org-list.el: `org-at-description-p' renamed to
`org-at-item-description-p', `org-first-list-item-p' renamed to
`org-list-first-item-p', `org-end-of-item-text-before-children'
renamed to `org-end-of-item-or-at-child'.
* org-list.el (org-list-bullet-string): New function returning bullet
concatenated with an appropriate number of white spaces.
* org-list.el (org-list-insert-item-generic): Insert the right bullet,
with help of `org-list-bullet-string'.
* org-list.el (org-indent-item-tree): Use `org-list-bullet-string'.
* org-list.el (org-fix-bullet-type): Use `org-list-bullet-string'.
* org-list.el (org-toggle-checkbox): send an error when
`org-toggle-checkbox' is trying to insert a checkbox at a
description item.
* org-list.el (org-item-re): modified regexp so it can catch correct
number of white space before item body.
* org-list.el (org-list-at-regexp-after-bullet-p): Take into
consideration new `org-item-re'.
* org-list.el (org-list-insert-item-generic): the second item in a
list will be separated from its predecessor with the number of blank
lines separating the first item from its parent, if any, or no blank
line.
* org-list.el (org-indent-item-tree): Fix and reorder every list and
sublist, from parent of list that has moved if indenting, or from
list at point if outdenting.
* org-list.el (org-list-replace-bullet): New internal function.
* org-list.el (org-indent-item-tree): Try to keep relative position on
line. It can't if point is in white spaces before bullet because
mixed tabs and spaces make some columns unattainable.
* org-list.el (org-cycle-item-indentation): Cycle when the whole item
only contains bullet and maybe a checkbox. Previously, TAB would
cycle when the first line of the item was blank.
* org-list.el (org-indent-item-tree): If indent rule is activated, it
should be impossible to outdent an item having children without
moving its subtree. Improved reordering of lists modified by cycling
indentation.
* org-list.el (org-maybe-renumber-ordered-list): Removed call for
`org-fix-bullet-type' to prevent infinite loop, and some checks
already done in `org-renumber-ordered-list'.
* org-list.el (org-fix-bullet-type): Remove a check and call directly
`org-maybe-renumber-ordered-list'
* org-list.el (org-indent-item-tree): It shouldn't be possible to
indent the first item of a sublist (though outdent is possible) as
it would break list's structure.
* org-list.el (org-list-insert-item-generic): When local search
doesn't help, search the list globally for blank lines. Moreover,
don't bother with new lists, and add 1 blank line.
* org-capture.el (org-capture-place-item): use `org-search-forward-unenclosed'
and `org-search-backward-unenclosed' and new variable `org-item-beginning-re'.
* org-list.el (org-item-beginning-re): regexp matching beginning of an item.
* org-list.el (org-in-item-p): Handle case when point is at an
heading.
* org-list.el (org-list-make-subtree): Add protection when used
outside of list
* org-list.el (org-insert-item): Removed useless hack now
`org-in-item-p' is fixed.
* org-timer.el (org-timer-item): Removed useless hack now
`org-in-item-p' is fixed.
* org-list.el (org-cycle-list-bullet): prevent description items from
being numbered. String argument is also recognized now, as long as
it is a valid bullet.
* org-list.el (org-indent-item-tree): moving indentation of top list
item will make the whole list move.
* org-list.el (org-apply-on-list): function is less sensitive to
changes of indentation.
Before this patch, cycling indentation of top list item would just
break list. Now, it does something useful.
* org-list.el (org-at-item-checkbox-p): add whitespaces at the end of
the regexp.
* org-list.el (org-checkbox-blocked-p): use new checkbox regexp.
* org-list.el (org-cycle-item-indentation): allow cycling description
items and checkbox items.
* org-list.el (org-toggle-checkbox): use new checkbox regexp.
* org-list.el (org-reset-checkbox-state-subtree): use new checkbox regexp.
* org-list.el (org-search-unenclosed-internal): new function to handle
both `org-search-forward-unenclosed' and
`org-search-backward-unenclosed'.
* org-list.el (org-search-backward-unenclosed): Can send errors now.
Removed useless usage of COUNT.
* org-list.el (org-search-forward-unenclosed): Can send errors now.
Removed useless usage of COUNT.
* org-list.el (org-update-checkbox-count): Use
`org-search-forward-unenclosed' and `org-search-backward-unenclosed'
instead of `re-search-forward' and `re-search-backward'.
* org-list.el (org-sort-list): Use
`org-search-forward-unenclosed' and `org-search-backward-unenclosed'
instead of `re-search-forward' and `re-search-backward'.
* org-list.el (org-list-make-subtree): Use
`org-search-forward-unenclosed' and `org-search-backward-unenclosed'
instead of `re-search-forward' and `re-search-backward'.
* org-list.el (org-insert-item-internal): New function to handle
positionning and contents of an item being inserted at a specific
pos. It is not possible anymore to split a term in a description
list or a checkbox when inserting a new item.
* org-list.el (org-insert-item): Refactored by using the new
`org-insert-item-internal' function.
* org-timer.el (org-timer-item): Refactored by using the new
`org-insert-item-internal' function.
* org-list.el (org-list-bottom-point): Be sure to check real
ORG-OUTLINE-REGEXP and not outline-regexp, that might be modified.
* org.el (org-cycle-internal-local): cycle up to end of subtree or end
of item if we are in a list.
in a special block now move before block.
* org-list.el (org-insert-item): Move before any special block in a
list prior to add a new item.
* org-timer.el (org-timer-item): When in a timer list, insert a new
timer item like `org-insert-item'. If in another list, send an
error. Otherwise, start a new timer list.
* org-timer.el (org-timer-item): Insert description list item at the
right column.
* org-list.el (org-insert-item): Insert the right number of blank
lines before a relative timer.
* org-list.el (org-search-backward-unenclosed): Do not stop in
protected places.
* org-list.el (org-search-forward-unenclosed): Do not stop in
protected places.
* org-latex.el (org-export-latex-lists): Use the fact that
org-search-forward do not stop anymore at protected places.
* org-list.el (org-search-backward-unenclosed): Do not prevent list
items from being inside LaTeX blocks.
* org-list.el (org-search-forward-unenclosed): Do not prevent list
items from being inside LaTeX blocks.
* org-list.el (org-in-item-p): Do not widen before checking if we are
in item.
* org-list.el (org-list-send-list): We cannot count on
`org-list-top-point' and `org-list-bottom-point' before buffer is
narrowed. Find bounds of list otherwise.
* org-list.el (org-list-end-regexp): New customizable variable to
define what string should end lists.
* org-list.el (org-list-end-re): Function is now aware of
`org-list-end-regexp'.
* org-exp.el (org-export-mark-list-ending): fix number of blank lines
inserted after a list.
* org-list.el (org-list-parse-list): fix case when `org-list-end-re'
would have an indentation greater than current list.
* lisp/org-list.el (org-apply-to-list): Now a return value is handed
at each new call of the function applied.
* lisp/org-list.el (org-fix-bullet-type): Use the new
`org-apply-to-list' format.
* lisp/org-list.el (org-renumber-ordered-list): Use the new
`org-apply-to-list' format.
* lisp/org-list.el (org-search-forward-unenclosed): fix behavior when
last occurence was enclosed.
* lisp/org-list.el (org-search-backward-unenclosed): fix behavior when
last occurence was enclosed.
* lisp/org-list.el (org-list-parse-list): Better handling of
restrictions when function is called on a list with sublists.
* lisp/org-list.el (org-list-send-list): find the true ending of the
list being sent.
* lisp/org-list.el (org-list-radio-list-templates): templates are more
specific to lists.
This is the third patch in a series that makes some straightforward
corrections to a number of docstrings. Each change is normally to:
- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
and tips given in the Elisp manual
No attempt is made to provide missing docstrings or document arguments.
Cheers,
Phil
* lisp/org-list.el (org-list-send-list): Parse list from its true beginning.
* lisp/org.el (org-ctrl-c-ctrl-c): Maybe send the list when at a list item.
* doc/org.texi (Radio lists): Fix bug in description of radio lists.
* lisp/org-latex.el: items are no longer skipped when their first line
ends on a protected element.
* lisp/org-list.el: protected environments looking like lists are not
exported anymore.
Thanks to Nicolas Goaziou <n.goaziou@gmail.com> for this patch.
* doc/org.texi (Plain lists): Document
`org-list-demote-modify-bullet'.
* lisp/org-list.el (org-list-demote-modify-bullet): Improve docstring
by showing an example.
This change was triggered by a request by Livin Stephen Sharma.
This behavior is now parallel to the treatment of outline nodes.
This commit also introduces another change. When an outline node or a
plain list item is folded by outline and contains hidden children,
M-left/right will refuse to act on this item. You must either open
the tree, or use the subtree commands M-S-left and M-S-right.
Based on a patch by Matti De Craene, but significantly modified after
a discussion involving Bernt Hansen and others.
David Maus writes:
> When `org-previous-item' is called on an item with nothing above it
> Orgmode enters an infinite loop. The reason is that
> `org-previous-item' searches for non-empty lines by moving point up
> line by line and if there is nothing above an item point gets stuck on
> begin of buffer.
>
> example.org
> ,----
> |
> | - Item
> `----
>
> Move point on Item, M-x org-previous-item RET and Orgmode enters the
> infinite loop.
>
> Attached patch adds a conditional clause to `org-previous-item' that
> leaves the search loop if point reaches beginning of buffer.
Nicolas Girard writes:
> My point was, in the following two examples, the empty lines right
> before "C" should be preserved in the LaTeX output.
>
> Cheers,
> Nicolas
>
> #===
> - A2
> - B2
>
> C
> #===
>
>
> #===
> - A3
> - B3
>
>
> C
> #===
Daniel Hackney writes:
> When attempting to use radio lists for exporting in LaTeX, I
> found that they didn't work. I am using the example file shown
> below:
>
> ---BEGIN_EXAMPLE---
>
> #+LaTeX: % BEGIN RECEIVE ORGLST programs
> #+LaTeX: % END RECEIVE ORGLST programs
>
> #+ORGLST: SEND programs org-list-to-latex
> - Emacs text editor
> - Ubuntu Linux
> - Git version control system
> - Firefox web browser
> - Drupal content management system
> - Subversion version control system
> - Eclipse integrated development environment
>
> ---END_EXAMPLE---
>
> I eventually ran `org-list-send-list' manually on the list, and
> got the following error:
>
> funcall: Wrong type argument: number-or-marker-p, (unordered
> #("Emacs text editor" [snip...]
>
> I started debugging `org-list-send-list' and found that the error
> occurred when calling (funcall transform list). Looking back, I
> saw that `transform' was assigned (in the let*) after
> `item-beginning'. Stepping through the execution, I saw that
> `transform' was being assigned a value of `-'. It turns out when
> assigning to `item-beginning', (org-list-item-beginning) is
> called, which runs a regular expression with a capture group,
> overwriting the previously matched capture group.
>
> Luckily, the fix is simple; all that needs be done is to switch
> the assignment to `transform' with `item-beginning' so the regex
> in (org-list-item-beginning) doesn't override the match-string
> data. I tried this fix out and it worked perfectly.
Dan Davison writes:
> If you start a numbered list with
>
> 1.
>
> and hit M-RET then you get
>
> 2.
> ^
> with a space, i.e. '2. '
>
> However, when creating the 10th list item, there is no space after
> '10.'. Same for 99 -> 100. This isn't entirely trivial, because if you
> start typing blindly after hitting M-RET, then the line you have created
> (lacking the space) will not be recognised as a list item and so
> e.g. the next M-RET will create a new heading, not a list item. [Has
> this changed recently? This seems like something obvious that others
> would have noticed.]
>
> Here's my patch.
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-list.el b/lisp/org-list.el
> index 2fea57b..8ece3ea 100644
> --- a/lisp/org-list.el
> +++ b/lisp/org-list.el
> @@ -813,7 +813,7 @@ with something like \"1.\" or \"2)\"."
> (buffer-substring (point-at-bol) (match-beginning 3))))
> ;; (term (substring (match-string 3) -1))
> ind1 (n (1- arg))
> - fmt bobp old new)
> + fmt bobp old new delta)
> ;; find where this list begins
> (org-beginning-of-item-list)
> (setq bobp (bobp))
> @@ -835,7 +835,9 @@ with something like \"1.\" or \"2)\"."
> (delete-region (match-beginning 2) (match-end 2))
> (goto-char (match-beginning 2))
> (insert (setq new (format fmt (setq n (1+ n)))))
> - (org-shift-item-indentation (- (length new) (length old))))))
> + (setq delta (- (length new) (length old)))
> + (org-shift-item-indentation delta)
> + (if (= (org-current-line) line) (setq col (+ col delta))))))
> (org-goto-line line)
> (org-move-to-column col)))
> --8<---------------cut here---------------end--------------->8---
>
> Dan
Rainer Stengele writes:
> using org-mode for quite some time now I always look at
> operations (key sequences) I repeat a lot of times.
>
> A lot of times I start a list with an item and immediately
> indent the next item as subitem.
>
> From
>
> - item 1
> - subitem 11
>
> I go to
>
> - item 1
> - subitem 11
>
> via "M-right". Then I always want to change the style of the
> subitem list to "*". I do this via "S-right-right".
>
> I wonder how others work. I would like to automatically have
> changed the subitem list type to "*" as soon as I indent via
> "Alt-right". Next indentation should go back to "-". etc.
>
> Maybe we could introduce a variable that sets the order of
> standard list item types, in my case: "- * - * - * - *" as
> in
>
>
> - item 1
> * subitem 11
> - subitem 111
> * subitem 111
> ...
>
> very special I know but I try to reduce the keypressings as
> much as possible. Any other suggestions?
This commits adds the variable
`org-list-demote-modify-bullet' for this purpose.
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'.
Setting the new option `org-hierarchical-todo-statistics' to nil will
make TODO statistics to be computed recursively. This means, not only
the direct children of a node contribute to its TODO statistics, but
the entire subtree.
You can also set the COOKIE_DATA property and add the word "recursive"
there to get recursive statistics for a specific tree.
When inserting new list entries, sometime empty lines will be
inserted automatically. This, however, makes only sense if empty
lines do not terminate the list, as configured by
`org-empty-line-terminates-plain-lists'.
This commit makes sure that, if
`org-empty-line-terminates-plain-lists' is set, automatic empty lines
will never be inserted.
Using `C-c C-x C-b' in a headline now again toggles all checkboxes
below hat headline. This feature got lost during a recent overhaul of
this function.
Reported by Chris Randle.
When a line now contains several statistics cookies, all of them will
be updated.
Jari Aalto submitted a patch to this effect which I did end up not
using. Thanks anyway!
Emacs 23 introduces `shift-selection-mode', and even turns it on by
default. Therefore, it is fair to assume that users of Emacs 23 will
expect to be able to select a region by holding down shift will moving
the cursor. This conflicts with the use of shifted cursor keys in
Org-mode for other purposes, in particular to "change the item under
the cursor", like it is done for time stamps, item bullet types, TODO
keywords and priorities.
This commit tries to support `shift-selection-mode' as much as possible,
while retaining these valuable commands keys for Org-mode. The
following things are changed:
1. The range of contexts where Org's commands do act is reduced.
- S-up and S-down no longer jump to the previous and next plain list
item - you can use the paragraph commands C-up and C-down for this
quite well.
- S-left and S-right only change the bullet type of a plain list
item when the cursor is *exactly* on the bullet, not just anywhere
in the item line.
2. When a S-cursor key is used outside a special context, a region is
started or extended.
3. When a region has already been started, it will be continue to
extend even if the S-cursor keys move the cursor into a special
context.
4. If you want S-cursor selection to work in headlines as well, you
can set the variable `org-support-shift-select' to
`even-in-headlines'. Then you need to rely on `C-c C-t' to set
TODO keywords, and on `C-c ,' to set priorities.
If you want everything to behave the way it was, set
`org-support-shift-select' to nil.
The variable `org-blank-before-new-entry' regulates if Org should
insert a blank line before a new entry, when making a new headline or
plain list item. Up to now, the possible values in each case where t
or nil, i.e. unconditionally do or don't insert a blank line.
Now each setting can also be `auto'. If this is the case, Org will
look if the current entry, of which the command creates a sibling,
does have a blank line before it. If yes, it will also make a blank
line. If not, it will not. This seems so useful that I have made
this behavior the default.
This commit removes some of the stuff that was specific for the LaTeX
exporter, and falls back to the default configuration that works for
all backends.
Here is what the commit does:
- The variable `org-export-latex-remove-from-headlines' is now
obsolete. Instead, also LaTeX export now responds to the settings
in the variables org-export-with-todo-keywords',
`org-export-with-priority', and `org-export-with-tags' and in the
corresponding OPTION settings.
- Removal of time stamps and related keywords now already happens in
the preprocessor, so that it will be perfectly the same for all
backends.
- The list functions have been extended to accept an additional
parameter list, to overrule the default setting for a particular
list function. This is used to make the checkbox appearance in
LaTeX configurable, through the new variable
`org-export-latex-list-parameters'.