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