Commit graph

6098 commits

Author SHA1 Message Date
Nicolas Goaziou aed0cb3b9e org-maybe-renumber-ordered-list' do not call org-fix-bullet-type'.
* 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'
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 4c9eb76846 Do not indent the first item in a sublist.
* 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.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 2c3157e34e Better guessing of blank lines when inserting an item.
* 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.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou ff6c147ac6 Defined `org-item-beginning-re'. Org capture should recognize new lists.
* 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.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 3d3e307c31 Fix list folding. Refactoring. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou 5b9857da7c Minor fix. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou 0bac5c248b Forgot to handle 'previous argument in `org-cycle-list-bullet'.
* org-list.el (org-cycle-list-bullet): Put back support for 'previous argument.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 3a084384f4 Refactoring. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou eebd8eb022 Fixed bug in `org-in-item-p' with point at an heading just beyond list.
* 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.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 42f82d1bad Descriptions items shouldn't be numbered.
* 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.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou 8241e9b652 Refactoring. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou a42f8066d4 Can't insert new item after `org-list-bottom-point' anymore. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou fb7183c619 Forgot a save-excursion' in org-apply-on-list'. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 9e3b3d023d List follows indentation of its top item.
* 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.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou d22d58acf1 Allow cycling indentation at creation of description and checkboxed items.
* 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.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou 85868125c2 Fix cycling indentation. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 8597bb25ee Description item regexp was too strict. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 97f857c9b7 Minor refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou abb490c572 Internal functions stay with org-list- prefix. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou d830b4b3ee Refactoring 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 8a215f56eb No checkboxes for description items. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 2b5b8cf8a2 Refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou c3bbbc0926 Blank lines number is guessed locally when inserting item.
* org-list.el (org-insert-item-internal): guessing of blank lines
  number is made by looking at neighbours items, if any.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 905ad49e9a Fixed some corner-case when inserting item. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 3dfc889cce Refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 0229bcc054 Sort also timer lists.
* org-list.el (org-sort-list): add the possibility to sort timer lists
  with the ?t or ?T options.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 802a3d1b3f Refactoring.
* 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'.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 7cf8ab06de Fix inserting item with point before first char of item's body.
* lisp/org-list.el (org-insert-item-internal): fixes the problem when
  point was before the first char of the item's body.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou deb6b0c504 Some comments changes. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 53c4b53e8f Less latency in org-timer-item.
* org-timer.el (org-timer-item): Refactoring. Compute timer string
  before inserting it in the buffer
* org-timer.el (org-timer): added an optional argument to return timer
  string instead of inserting it.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 8eece59f9e Refactoring and increased protection on item insertion.
* 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.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 472579fb96 Minor refactoring. 2010-09-01 19:05:46 +02:00
Nicolas Goaziou 1f41236014 Cycle lists properly.
* 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.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 7a17a37580 Reverting info changes. 2010-09-01 19:05:46 +02:00
Nicolas Goaziou 430279f2cf Added information on timer lists. 2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2dd3b8a2a8 Better support for timer lists. Trying to insert a new item with point
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.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2e4e05b3d6 Minor refactoring.
* lisp/org-list.el: Minor refactoring.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2b8aa4c406 Position items with relative timer at the right place.
* 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.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 292b52f596 Insert item even in LaTeX environments.
* org-list.el (org-insert-item): Remove restriction on latex blocks.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 47cd0c193d Make parsing of lists more powerful during export.
* 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.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 168a8b6007 Do not prevent list items from being inside LaTeX blocks.
* 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.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 968fa927c4 Fix for org-list-send-list.
* 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.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou b2433f9eb6 Changed default for end-list regexp.
* lisp/org-list.el (org-list-end-regexp): By default, list ending is
  exactly 2 blank lines.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 197ed8b273 Remove useless checks for `org-empty-line-terminates-plain-lists'.
* org-docbook.el (org-export-as-docbook): When we find an empty line,
  we do not need to check for `org-empty-line-terminates-plain-lists'
  because we would have found end-list marker before.
* org-html.el (org-export-as-html): Same.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 0c4770e661 Refactoring.
* org-list.el (org-insert-item): Simplify count of blank lines to insert.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 37733b77a4 List ending is now customizable.
* 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'.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 27cfeefc3b Code cleanup.
* org-html.el (org-export-as-html): Code cleanup.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 07eb3308c1 Docbook exporter now handles new list definition.
* org-docbook.el (org-export-as-docbook): Properly close any open list
  when seeing ORG-LIST-END. Removed any reference to now unneeded
  DIDCLOSE variable.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou a63ecfa89b Better handling of non-blank-lines types of list enders.
* 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.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou fe42a5e83e Export supports any list ender. Export to ascii has been fixed.
* org-exp.el (org-export-mark-list-ending): Differentiate between
  export backends, and replace `org-list-end-re' by a blank line upon
  exporting.
2010-09-01 19:05:45 +02:00