0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 23:10:43 +00:00
Commit graph

461 commits

Author SHA1 Message Date
Nicolas Goaziou da6a10b02d Modified behavior in searches specific to lists
* 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
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 8aa95608e5 org-list: small refactoring 2011-02-18 12:45:09 +01:00
Nicolas Goaziou 504b497b7f org-list: handle case when moving top item without its subtree 2011-02-18 12:45:09 +01:00
Nicolas Goaziou f66e9cbfd5 org-list: fix insert-item with added data to structure 2011-02-18 12:45:09 +01:00
Nicolas Goaziou 69e02a73de Modified export engines for lists
* 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.
2011-02-18 12:45:09 +01:00
Nicolas Goaziou bf1776b494 org-list: added new accessors
* 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
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 0f589a33b2 org-list: added description tag as data in structures 2011-02-18 12:45:09 +01:00
Nicolas Goaziou 6c81e8cc05 Move org-get-string-indentation out of org-list.el
* 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.
2011-02-18 12:45:09 +01:00
Nicolas Goaziou fa1ed96d00 org-list: code comments and doc-strings improvements 2011-02-18 12:45:08 +01:00
Nicolas Goaziou 148deffd4e org-list: move error messages in interactive indent/outdent functions
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou 9230df2e0d org-list: rewrite of org-apply-on-list
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou e2c1ec92a4 org-list: new parsing of lists
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou 14df1d59d4 org-list: various fixes to accessors
* 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'.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou ddcd5d480f org-list: rewrite of insert-item code.
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou e865ce445a org-list: interactive navigation functions use accessors
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou b2c369725a org-list: keep byte-compiler happy 2011-02-18 12:45:08 +01:00
Nicolas Goaziou af8da7965c org-list: interactive tools use new structures
* 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.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou d48a6cf50d 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-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
2011-02-18 12:45:07 +01:00
Nicolas Goaziou 1829aa79b5 org-list: use list structure to update checkboxes and cookies
* lisp/org-list.el (org-toggle-checkbox): use structures to fix
  checkboxes of a list
(org-update-checkbox-count): use structures to update cookies
2011-02-18 12:45:07 +01:00
Nicolas Goaziou 8a3a81c08e org-list: fix checkboxes directly from list structures
* lisp/org-list.el (org-list-struct-fix-checkboxes): new function
(org-checkbox-blocked-p): removed function
2011-02-18 12:45:07 +01:00
Nicolas Goaziou 7e57111524 org-list: implement new accessors to list structures
* 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
2011-02-18 12:45:07 +01:00
Nicolas Goaziou cad24d757d org-list: add checkbox to list structures
* 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
2011-02-18 12:45:07 +01:00
Julien Danjou 84d7165d74 org: remove org-invisible-p
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>
2011-01-26 18:26:46 +01:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Nicolas Goaziou 9966f922f3 Do not break lists with blocks within when exporting
* 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.
2010-12-09 09:54:42 +01:00
Nicolas Goaziou acd6126300 Exporting lists to LaTeX respects blank lines
* 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.
2010-11-28 21:27:20 +01:00
Nicolas Goaziou 85501c0623 Fix cycling bullet with point not at column 0
* org-list.el (org-cycle-list-bullet): ensure point is at bol before
  checking item indentation.
2010-11-19 23:47:02 +01:00
Nicolas Goaziou 065675cdc7 list: use compatibility code whenever possible 2010-11-14 08:58:41 +01:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Carsten Dominik d5e2031bc7 XEmacs compatibility patch
* lisp/org-list.el (org-list-parse-list): Use `org-looking-at-p'.
2010-11-03 23:16:37 +01:00
Nicolas Goaziou 0778fb8748 Fix list end with non-empty blank lines. Fix sorting.
* 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.
2010-10-30 18:20:52 +02:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Carsten Dominik c41409c530 Enhance XEmacs compatibility
* lisp/org-list.el (org-list-search-unenclosed-generic): Replace call
to booleanp.

* lisp/org-compat.el (org-decompose-region): New defsubst.
* lisp/org.el (org-toggle-pretty-entities):
(org-unfontify-region): Use `org-decompose-region'.
2010-10-17 18:39:26 +02:00
Nicolas Goaziou ce0d35a51c Fix "invalid search bound" when toggling a checkbox
* org-list.el (org-toggle-checkbox): avoid some boundary error when
  inserting a checkbox in an empty last item of a list.
2010-10-11 20:35:30 +02:00
Nicolas Goaziou da92f40876 Correct LaTeX export with sublists. Minor fix of bullet cycling.
* 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.
2010-09-19 10:31:49 +02:00
Nicolas Goaziou 1caba219da Small refactoring and docstrings update 2010-09-15 11:07:42 +02:00
Nicolas Goaziou 385c2666b1 More general regexp for descriptions items
* org-list.el (org-list-to-generic): Descriptions labels can be any
  suit of symbols, and will end at double colons.
2010-09-09 19:24:55 +02:00
Nicolas Goaziou 0f44a66523 Don't insert item when tree is folded
* org-list.el (org-insert-item): check invisibility of point at a
  meaningful location.
2010-09-07 19:36:13 +02:00
Nicolas Goaziou 7e8aec9c09 Fix `org-list-insert-item-generic' when checkboxes are updated
* 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'.
2010-09-07 19:36:05 +02:00
David Maus 3ece67cc13 org-list.el: Declare functions and variables to fix compiler warning
* org-list.el (org-outline-regexp, org-ts-regexp)
(org-ts-regexp-both, org-in-regexps-block-p)
(org-level-increment, org-at-heading-p)
(outline-previous-heading, org-icompleting-read)
(org-time-string-to-seconds): Declare to fix compiler warning.
2010-09-05 17:58:30 +02:00
Nicolas Goaziou 045e3aea28 Fix checkbox statistics
* 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.
2010-09-05 17:46:01 +02:00
Nicolas Goaziou 15928db323 Implement new list definition
* 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.
2010-09-01 20:42:05 +02:00
Nicolas Goaziou 86b4d5e69d Keep byte-compiler happy 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 8e5729c466 Speed optimizations and docstring modifications. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou d05c77d6a5 Fix infinite loop when buffer was ending on a blank lines with whitespaces. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 421ba3a187 Correctly get bullet when point is not at bol. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 0932dac73d Fix `org-list-bottom-point' when point is after end of list. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou e2dc3cd985 Small modification to `org-list-ending-method' docstring. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7a46718ec6 Optimize search of top and bottom points when ending method is `both' 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 595ce4e7f8 Minor fix. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 5de49d2032 Optimize list indentation.
* 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.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7e6778c16f When indenting a region, first check if there is any item to move. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 668e5832c2 Bug fix: `org-list-struct' would get the last item twice sometimes. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 5dee2ec351 Fix code typo. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 86228b817c Changed default value of `org-list-ending-method'
* org-list.el (org-list-ending-method): default value is now `both',
  to ensure maximum compatibility before previous implementation.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou ebf5e1236b Fix bug when buffer is starting with a list.
* 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.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou df33ccb956 Do not drag outside items when moving whole list multiple times. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7b8352f94b Renamed org-indent-item-tree' to org-list-indent-item-generic'. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou bac9497d7a Handle drawers correctly. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 50f2c13ddc Modified docstrings according to `checkdoc-current-buffer'. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou c675061eb2 Speed optimization of indent method 2010-09-01 19:05:54 +02:00
Nicolas Goaziou c96c14a9d5 Fix bug in org-list-bottom-point' and org-list-top-point'. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 221ff58e19 Small optimization. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 113818cdf0 Bug fix: infinite loop while looking for top point with indent method 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 6b2468477e [@num] is valid to enforce a numbering (same as [@start:num]) 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 56542f799c Removed renumber rule. Documentation fixes. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 347f39445a Added some documentation to code. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou b5eb7047f3 Now both indentation and regexps can end lists
* org-list.el (org-list-ending-method): New customizable variable to
  tell Org Mode how lists end. See docstring.
2010-09-01 19:05:54 +02:00
Nicolas Goaziou 2cca510276 Fix structure for malformed lists. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 8b66f26920 Modified indentation of long lines of code. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou d2b3923b6a Keep byte-compiler happy. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou dae1ec63a9 org-fix-bullet-type is now org-list-repair. Created aliases for compatibility. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou dea5050dbc Ensure shifting top-level item can catch column 0
* org-list.el (org-indent-item-tree): shifting step of top-level item
  depends on `org-level-increment'.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 1230cf9f09 Fix bug when inserting an item after bottom point of list
* org-list.el (org-list-bottom-point): Take into consideration that
  bound of search can be before true ending of the list.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 8385393fe6 Optimize writing of structure to buffer.
* org-list.el (org-list-struct-apply-struct): No longer shift item's
  body twice: one after replacing bullet and one after changing
  indentation.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 8c89086e73 Refactoring of search functions. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou bed92c6863 Refactoring 2010-09-01 19:05:53 +02:00
Nicolas Goaziou 443afde30c Handle `org-list-demote-modify-bullet'
* org-list.el (org-list-struct-indent): Added code to replace bullets
  if needed when indenting.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 0c1b40bd6c Removed unused functions. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou 97c60a1a86 More rules to determine blank lines when inserting item
* 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.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou d726f924dd Fix bug when moving a *-list at column 0. Docstrings modifications.
* 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.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou a2a72f38fa Toggle checkbox even if not at beginning of line.
* org-list.el (org-toggle-checkbox): go to beginning of line before processing.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou e8967901fa Little bug fix.
* org-list.el (org-list-struct-apply-struct): check if ancestor exists.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5d196be958 Small refactoring. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 9eab167626 Indentation is faster and now correct. Indenting region is back. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 030fc40b1d Minor refactoring. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 0dab6a2e1b Do not enforce white spaces just after [@start:num]. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5a3113592a Allow multiple [@start:num] in a list.
* org-list.el (org-renumber-ordered-list): check for [@start:x] is
  done at each item.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou c5f4081221 Fix reordering bug when when cycling indentation above 10th item.
* org-list.el : Removed unused variable
  `org-suppress-item-indentation'.
* org-list.el (org-renumber-ordered-list): Skip item if bullet number
  is already good.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5903c08447 Moving top list item will move whole list only if moving by subtree.
* 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.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou ee568516e8 Bug fix when indenting items.
* 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.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou d9c4c52533 Documentation fix. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou a665ecb666 Fix bug when `org-list-two-spaces-after-bullet-regexp' would be nil.
* org-list.el (org-list-bullet-string): first check if
  `org-list-two-spaces-after-bullet-regexp' isn't nil.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 7eb193de1d Minor refactoring. 2010-09-01 19:05:51 +02:00
Nicolas Goaziou 80b269d947 `org-toggle-item' working as expected.
* 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'.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 884489c3fb When indenting an item, bullet should be more predictable.
* 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.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou a73ce76fe3 Checkbox rule forbids inserting checkboxes in description item 2010-09-01 19:05:51 +02:00
Nicolas Goaziou 4d40259e56 Better handling of checkboxes with regards to [@start:x] constructs
* 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.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou c444086ade Documentation fixes. 2010-09-01 19:05:51 +02:00