Commit graph

477 commits

Author SHA1 Message Date
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
Nicolas Goaziou 4a4c4f2cf1 Ensure new indentation cycles always start with same bullet
* org-list.el (org-cycle-item-indentation): org-tab-ind-state stores
  both indentation and bullet when cycle started.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 3f762cf76d Refactoring
* 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'.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 66bf386e25 Correctly handle bullets with two spaces.
* 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'.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou cbc337f285 Bug fix. First bullet of *-list would not become "-" when hitting column 0. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou 3a91400baa Modified default number of blank lines when inserting an item.
* 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.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou a905db7db7 Smarter fix and reordering of list when indenting items.
* 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.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou d99f7fcf05 Try to keep relative column in line when indenting item.
* 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.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou eabb018913 `org-cycle-item-indentation' works only on empty items.
* 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.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 7c424b33ea Cycle indentation for newly created description items or checkboxes.
* org-list.el (org-cycle-item-indentation): Allow a point just after a
  description item or a checkboxed item to start cycling.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 25de94f3cc Take `org-plain-list-ordered-item-terminator' into consideration when cycling bullets.
* org-list.el (org-cycle-list-bullet): Check
  `org-plain-list-ordered-item-terminator' before allowing 1. or 1) as
  valid bullets when cycling.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 1bfe98bdf6 Minor refactoring. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou 91488c75d5 Added variable `org-list-automatic-rules'. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou ca106beabb New function `org-item-has-children-p'. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou c4d0151b28 Return value of `org-cycle-item-indentation' was broken.
* org-list.el (org-cycle-item-indentation): Do return t if and only if
  cycling is possible and succeded.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou a13ee91cbe Rules preserving integrity of a list now apply when moving subtree.
* org-list.el (org-indent-item-tree): when outdenting a subtree, the
  last item shouldn't have a children.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 330c27e4ec Fix cycling problems.
* org-list.el (org-cycle-item-indentation): cycling should play nicely
  with indent rule in `org-list-automatic-rules'.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 0a14598575 Added a rule for indentation and improved reordering.
* 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.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 19372845f9 Melt org-maybe-renumber-ordered-list-safe' into org-maybe-renumber-ordered-list'. 2010-09-01 19:05:49 +02:00
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 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 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 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 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 f677013276 Use org-search-forward-unenclosed' instead of re-search-forward'.
* lisp/org-list.el: Replaced `re-search-forward' by
  `org-search-forward-unenclosed' where it made sense.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou ecd5a4b0f1 Make `org-apply-to-list' more functional.
* 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.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou fb5cab814e Better regexps in searches unenclosed.
* lisp/org.el (org-in-regexps-block-p): minor fix: limit wasn't
  correctly used.
* lisp/org-list.el (org-search-forward-unenclosed): Better regexp
  used.
* lisp/org-list.el (org-search-backward-unenclosed): Better regexp
  used.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 2dec9eb473 Fix regression in `org-sort-list'.
* lisp/org-list.el (org-sort-list): end-rec function was ill-defined.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou f7f07198dd Fix for org-search-forward-unenclosed' and org-search-backward-unenclosed'.
* 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.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou a0ad769d0b Fixed blocks regexp.
* lisp/org-list.el (org-search-backward-unenclosed): fix block regexp.
* lisp/org-list.el (org-search-forward-unenclosed): fix block regexp.
* lisp/org-list.el (org-list-parse-list): minor fix.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 82f0bd75e7 Delete org-list-end-re' when org-list-parse-list' is used for
export.

* org-list.el (org-list-parse-list): Delete `org-list-end-re' when
  called with t argument.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou a0a86fbba0 Minor fix.
* lisp/org-list.el (org-list-bottom-point): No need for square
  brackets for `skip-chars-backward'.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 9996da73a3 Fix radio lists and radio templates.
* 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.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 5fda851968 Initial commit. 2010-09-01 19:05:44 +02:00
Glenn Morris e314478511 Fix some more Org `check-declare' issues.
* ob.el: Require org when compiling.
(org-save-outline-visibility): Remove macro declaration.
* ob-emacs-lisp.el: Require ob-comint when compiling, for macros.
Remove unnecessary/macro declarations.
* org-docview.el: Require doc-view when compiling.
(doc-view-goto-page): Autoload rather than declaring.
(doc-view-current-page): Remove macro declaration.
* ob.el (tramp-compat-make-temp-file, org-edit-src-code)
(org-entry-get, org-table-import): Fix declarations.
(org-match-string-no-properties): Remove declaration.
* ob-sh.el (org-babel-comint-in-buffer)
(org-babel-comint-wait-for-output, org-babel-comint-buffer-livep)
(org-babel-comint-with-output): Remove unnecessary declarations.
* ob-R.el (orgtbl-to-tsv): Fix declaration.
* org-list.el (org-entry-get): Fix declaration.
2010-08-27 14:45:48 -06:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Philip Rooke ef07f2afc2 Correct some docstrings [part 3]
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
2010-07-16 20:55:38 +02:00
Carsten Dominik 9c4f5725b4 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-16 14:15:47 +02:00
John Wiegley 332113111c Changed two uses of setq to let, to fix compiler warnings 2010-07-16 02:50:24 -04:00
David Maus 37ed35566b Locally bind variable `txt'
* org-list.el (org-list-send-list): Locally bind variable
`txt'.
2010-07-15 07:22:10 +02:00
Carsten Dominik acf44c879a Fix radio lists
* 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.
2010-07-13 13:36:14 +02:00
Nicolas Goaziou 3d69093339 Fix radio list templates
* lisp/org-list.el (org-list-radio-list-templates): Fix templates.
2010-07-12 19:04:48 +02:00
Nicolas Goaziou 94689a04b0 Fix regexp for `org-list-send-list'.
* lisp/org-list.el (org-list-send-list): regexp defining the start of
a radio list is now on par with the one used for radio tables.
2010-07-12 11:48:44 +02:00
Bastien Guerry 47996c02cb Fix and improve list exporting to latex.
* 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.
2010-06-16 21:26:49 +02:00
Carsten Dominik a49a64575b Document the use of `org-list-demote-modify-bullet'.
* 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.
2010-05-23 07:11:01 +02:00
Bernt Hansen 4f9c82fcf7 Fix typo in org-list-demote-modify-bullet docstring 2010-05-21 11:14:09 -04:00
Carsten Dominik 7aa1a46359 Require cl in org-list.el 2010-05-13 18:02:05 +02:00