Commit Graph

525 Commits

Author SHA1 Message Date
Nicolas Goaziou 809318dd5b Better handling of ill-formed lists
* lisp/org-list.el (org-list-parents-alist): When no parent is found
  for an item, set it as the closest less indented item above.  If
  none is found, make it a top level item.
(org-list-write-struct): Externalize code.
(org-list-struct-fix-item-end): New function.
(org-list-struct): Remove a now useless fix.
* lisp/org.el (org-ctrl-c-ctrl-c): Use new function.
2011-10-02 23:17:11 +02:00
Nicolas Goaziou 0019b6f193 org-list: fix code typo 2011-08-24 02:11:36 +02:00
Nicolas Goaziou 08ca5be491 org-list: tiny code change
* lisp/org-list.el (org-list-struct-apply-struct): don't
  use (copy-marker (point)) instead of (point-marker).
2011-08-23 22:20:55 +02:00
Nicolas Goaziou 8bb1a0c57f org-list: forgot a double space 2011-08-23 22:19:14 +02:00
Nicolas Goaziou 969baac557 org-list: corrections to commentary section and add linefeed 2011-08-23 22:17:20 +02:00
Nicolas Goaziou 065c5c3241 Make some files pass checkdoc test 2011-08-23 21:43:30 +02:00
Nicolas Goaziou 405ebb43df org-list: remove dependency on `org-back-over-empty-lines'
* lisp/org-list.el (org-list-separating-blank-lines-number): the
  behaviour of `org-back-over-empty-lines' depends on the associated
  value of `headline' in `org-blank-before-new-entry', which is out of
  context in a list.
2011-08-21 21:39:56 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Nicolas Goaziou b6fab3770b org-list: remove left-over commented code and clean white space 2011-08-16 10:23:04 +02:00
Bastien Guerry ad23b7d173 Fix bzg email address (s/altern/gnu). 2011-08-15 21:22:30 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Nicolas Goaziou dfda5fc8b4 org-list: get correct structure with empty items
* lisp/org-list.el (org-list-full-item-re): when an item has only
  a bullet and no space after it, list structure would not be
  recognized correctly.
2011-08-15 18:29:37 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
Bastien Guerry d9b7afd835 org-list.el: Allow the generic list exporter to trim line breaks in items.
* org-list.el (org-list-item-trim-br): New function.
(org-list-to-generic): New parameter :nobr to use the new
function.
2011-08-14 16:38:55 +02:00
John Wiegley d24a141d96 Renamed unnecessary use of sort* to sort 2011-08-13 16:43:22 -05:00
Nicolas Goaziou 1bbfec57af org-list: don't clear marker while still in use
* lisp/org-list.el (org-toggle-checkbox): don't clear lim-down while
  used in the while loop.
2011-08-12 15:17:48 +02:00
Nicolas Goaziou b4aee73ef1 org-list: fix bug in `org-toggle-checkbox' on current item
* lisp/org-list.el (org-toggle-checkbox): lim-down must be a marker.
2011-08-12 15:11:19 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Nicolas Goaziou 4f85aa21c6 org-list: fix a small error when guessing blank lines before items
* lisp/org-list.el: search blank lines down to the end of the item
  instead of stopping at the item, in order to possibly match such
  lines within the item.
2011-07-26 17:46:55 +02:00
Nicolas Goaziou ba092ec08d Do not add an extraneous blank lines when parsing lists
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): don't remove the ending regexp
  when it consists in blank lines.
* lisp/org-list.el (org-list-parse-list): ditto, but remove it
  completely when it isn't made of blank lines (i.e. during export process).
2011-07-24 20:03:30 +02:00
Bastien Guerry 5c53026d32 Fix (a lot of) compiler warnings.
Also introduce `org-pop-to-buffer-same-window' as a compatibility
function for Emacs =>24.1.
2011-07-18 19:25:10 +02:00
Nicolas Goaziou a161ecfd6a org-list: move point after asking for new term when inserting an item
* lisp/org-list.el (org-list-insert-item): actualize code comments.
(org-insert-item): for consistency, point cannot be moved at
a surprising place when the user is being asked to choose a new
description term to insert in the list. Point should stay where the
user called the command.
2011-07-18 13:51:15 +02:00
Nicolas Goaziou f7f2394448 org-list: clean left-over markers
* lisp/org-list.el (org-list-send-item, org-list-struct-apply-struct,
  org-apply-on-list, org-toggle-checkbox): make markers point nowhere
  when they have become useless.
2011-07-18 00:57:01 +02:00
Nicolas Goaziou 054230b138 org-list: never add useless blank lines when inserting an item
* lisp/org-list.el (org-list-insert-item): when insertion point is in
  some white line after the end of the list, remove all unnecessary
  white lines there before proceeding. Also refactor a snippet of
  code.
2011-07-17 22:54:21 +02:00
Nicolas Goaziou 108bd48e25 org-list: introduce a variable to distinguish sub-items better
* lisp/org-list.el (org-list-indent-offset): new variable.
(org-list-struct-fix-ind): make use of the new variable.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou aad4a7d4d3 Complete default values for check-boxes in LaTeX exporter
* lisp/org-latex.el (org-export-latex-list-parameters): complete
  default value with cbtrans option.
* lisp/org-list.el (org-list-to-latex): set a more consistent default
  value.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 90ef02a02b org-list: move and rename org-list-exchange-items
* lisp/org-list.el (org-list-swap-items): move it to a meaningful
  position in source code (i.e. before any function using it), and
  rename it to an easier name.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 688a29c0d6 org-list: change heuristics for number of lines separating items
* lisp/org-list.el (org-list-separating-blank-lines-number): if there
  are blank lines already in the whole list, add a blank line.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 41355053e6 org-list: introduce a variable to consider lists as rings
* lisp/org-list.el (org-list-use-circular-move): new variable.
(org-previous-item, org-next-item): make use of the new variable.
(org-move-item-down, org-move-item-up): make use of the new
variable. Simplify code.
2011-07-12 09:12:13 +02:00
Nicolas Goaziou 6338eb72a6 org-list: add a new method on lists (org-list-send-item)
* lisp/org-list.el (org-list-delete-item, org-list-send-item): new
  functions.
2011-07-12 09:09:34 +02:00
Nicolas Goaziou ecabda5603 org-list: docstring update
* lisp/org-list.el (org-plain-list-ordered-item-terminator): remove
  incorrect assumption.
2011-07-10 10:40:03 +02:00
Nicolas Goaziou dc85f45194 More forbidden blocks for lists and footnotes
* lisp/org-footnote.el (org-footnote-forbidden-blocks): add missing
  exporter specific blocks.
* lisp/org-list.el (org-list-forbidden-blocks): ditto.
2011-07-10 10:33:25 +02:00
Nicolas Goaziou d29fcc50ea org-list: make use of new `org-in-block-p' function
* lisp/org-list.el (org-list-in-valid-context-p): use `org-in-block-p'.
2011-07-08 18:08:34 +02:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Nicolas Goaziou 934aae8812 Allow white spaces between the counter and the check-box in an item
* lisp/org-list.el (org-list-full-item-re): allow counter and
  check-box to be separated by white spaces.
(org-list-struct-apply-struct): reflect changes made to
`org-list-full-item-re'.
* lisp/org-html.el (org-html-export-list-line): recognize spaces
  between counter and check-boxes as valid.
* lisp/org-docbook.el (org-export-docbook-list-line): ditto.
2011-06-30 22:57:18 +02:00
Nicolas Goaziou e070ebe6b0 org-list: org-list-insert-item respects its POS argument value
* lisp/org-list.el (org-list-insert-item): make sure point is moved
  to the specified POS before starting the function.
2011-06-30 20:35:56 +02:00
Nicolas Goaziou cc76e76509 org-list: fix bug with item cycling
* lisp/org-list.el (org-cycle-item-indentation): cycling back to
  original position deleted any additional information in the item,
  like a counter or a tag.
2011-06-28 20:26:49 +02:00
Nicolas Goaziou c4086ad1e4 org-list: doc-strings white-spaces fixes 2011-06-28 20:26:49 +02:00
Carsten Dominik 67893d3158 Declare a function to keep compiler happy 2011-06-24 06:47:32 +02:00
Nicolas Goaziou a0bc3bdebc org-list: fix update of check-boxes cookies in whole trees
* lisp/org-list.el (org-reset-checkbox-state-subtree): make the
  command more robust, and correctly update check-boxes in the whole
  sub-tree.
(org-update-checkbox-count): fix bug accumulating count of checkboxes
when walking a subtree.
(org-update-checkbox-count-maybe): add an optional argument passed to
org-update-checkbox-count.

Thanks to Paul Mead for the report.
2011-06-20 21:59:58 +02:00
Nicolas Goaziou 432c53a474 org-list: add a way to configure transitional check-boxes export
* lisp/org-list.el (org-list-parse-list): replace transitional
check-boxes with "[CBTRANS]" string during parsing.
(org-list-to-generic): use the new property `:cbtrans' to configure
export string for transitional check-boxes.
2011-06-17 15:11:49 +02:00
Nicolas Goaziou 889a487ae4 org-list: fix item's start number in LaTeX exporter
* lisp/org-list.el (org-list-to-latex): the enumerate environment in
latex increments the counter before using it. Therefore, org-mode
should set the enumeration counter to the desired value minus one.

Patch from Darlan Cavalcante Moreira
TINYCHANGE
2011-06-10 15:50:51 +02:00
Nicolas Goaziou 51946c36d7 Keep byte-compiler happy 2011-06-06 20:46:31 +02:00
Nicolas Goaziou ddeab1a8af Changes automatically made to cookies shouldn't move tags
* lisp/org.el (org-auto-align-tags): change docstring.
(org-update-parent-todo-statistics): keep tags aligned even when
statistics cookies are shifting them.
* lisp/org-list.el (org-update-checkbox-count): keep tags aligned even
when statistics cookies are shifting them.
2011-06-05 18:55:25 +02:00
Nicolas Goaziou b39a271fcb Keep byte-compiler happy 2011-05-28 18:16:34 +02:00
Nicolas Goaziou ddc2467387 Fix list before first heading conversion to odd levels subtree
* lisp/org-list.el (org-list-to-subtree): if the list is before first
  heading and `org-odd-levels-only' is non-nil, the first item gets
  two stars instead of one.
* lisp/org.el (org-reduced-level): a level of 0 was reduced to 1 with
  `org-odd-levels-only' non-nil.
2011-05-28 14:13:11 +02:00
Nicolas Goaziou 8f0ea16167 Ignore lists within exporters specific blocks
* lisp/org-exp.el (org-export-mark-list-properties): even if context
  is invalid, mark list item with `list-context' property.
* lisp/org-list.el (org-list-forbidden-blocks): add exporters specific
  blocks to the list of forbidden blocks.

Thanks to Jai Bharat Patel for reporting this.
2011-05-27 16:53:54 +02:00
Nicolas Goaziou f194eb1719 org-list: fix bug when sorting a list with a custom function
* lisp/org-list.el (org-sort-list): function tries to intern
  getkey-func before it is defined, so it's always nil.

Based on a patch from Le Wang.
2011-05-26 17:48:25 +02:00
Nicolas Goaziou 2500c6b1c8 org-list: fix heuristics for number of lines to insert with a new item
* lisp/org-list.el (org-list-separating-blank-lines-number): fix
  confusion between point and item beginning. Now, if no information
  is avalaible, truly follow user preference when it inserts blank
  lines manually.
  (org-list-insert-item): send correct argument to the preceding
  function.
2011-05-15 22:38:56 +02:00
Nicolas Goaziou 946640d84d org-list: correctly identify description lists
* lisp/org-list.el (org-list-full-item-re): allow description term to
  have a newline character after the colons.
2011-05-07 02:33:13 +02:00