* 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.