Commit graph

477 commits

Author SHA1 Message Date
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
Nicolas Goaziou 073ab7de83 org-list: check with-case argument when sorting a list alphabetically
* lisp/org-list.el (org-sort-list): no longer ignore with-case
  argument: the function sorted case-sensitively, regardless of
  argument.
2011-05-07 02:17:19 +02:00
Nicolas Goaziou 7327b483f1 org-list: small docstring fix 2011-04-24 11:25:40 +02:00
Nicolas Goaziou fc91845fa5 org-list: fix bug with structure and blocks/drawers indentation
* lisp/org-list.el (org-list-struct): when walking down the list, the
  function would not pay attention to drawers or blocks indentation.
  Thus, such constructs couldn't consistently end an item or a list.
  This patch ensures line indentation is stored (if applicable) before
  skipping them. Also fixed doc-string and comments.
2011-04-24 11:23:01 +02:00
Nicolas Goaziou a7a4693f66 org-list: don't forget to allow alphabetical counters 2011-04-09 16:09:32 +02:00
Nicolas Goaziou abad1b4994 Auto-fill shouldn't insert new items
* lisp/org-list.el (org-list-in-valid-context-p): renamed from
  org-list-in-valid-block-p.
  (org-at-item-p,org-list-search-generic): use renamed function.

* lisp/org.el (org-fill-item-nobreak-p): new function.
  (org-set-autofill-regexps): modify `fill-nobreak-predicate' to
  prevent auto-fill from breaking line just before an item regexp.
2011-04-09 13:20:37 +02:00
Nicolas Goaziou 2f72b3efcb org-list: fix cookie updating
* lisp/org-list.el: move org-update-checkbox-count-maybe call outside
  of save-excursion to get back to original position.
2011-03-30 19:00:45 +02:00
Nicolas Goaziou d9c5b384f8 org-list: org-keyword-time-regexp might be nil in other major modes
* lisp/org-list.el (org-toggle-checkbox): build value of
  org-keyword-time-regexp instead of using it directly, as it's
  buffer-local, and function might be called outside Org.
2011-03-23 21:02:38 +01:00
Nicolas Goaziou 051b5b291c org-list: fix infinite loop on erroneous block and drawer constructs
* lisp/org-list.el (org-list-struct,org-in-item-p): don't assume end
  of blocks or drawers necessarily start somewhere. It it isn't the
  case, treat them as normal text.
2011-03-23 18:33:05 +01:00
Nicolas Goaziou 06ca884162 org-list: fix bug with org-toggle-checkbox
* lisp/org-list.el (org-list-checkbox): when called from an headline,
  function would normally skip drawers, but not if a SCHEDULED or
  DEADLINE keyword is standing before the drawer. Also avoid problems
  if function is called in buffers not is Org mode.
2011-03-23 17:38:16 +01:00
Nicolas Goaziou 74169a8029 org-list: org-drawer-regexp is nil outside Org buffers
* lisp/org-list.el (org-in-item-p): re-build org-drawer-regexp,
  whatever the major mode is.
2011-03-20 09:10:53 +01:00
Nicolas Goaziou b6fc03b70c org-list: enhance list transformations and fix glitches
* lisp/org-list.el (org-list-to-generic): set a default term for
  ill-formed description lists. Do not insert newline characters
  unless told to.
  (org-list-to-texinfo,org-list-to-html): apply changes to
  `org-list-parse-liste'.
2011-03-17 16:11:04 +01:00
Nicolas Goaziou f8c627a44b org-list: fix parsing of counters
* lisp/org-list.el (org-list-parse-list): fixed regexp.
2011-03-14 23:36:19 +01:00
Nicolas Goaziou df26ae8e69 Checkboxes should progress from intermediate state to checked
Thanks to Matt Lundin for pointing that out.
2011-03-12 16:40:37 +01:00
Nicolas Goaziou f8ca5d85ba org-list: small refactoring
* lisp/org-list.el (org-list-in-valid-block-p): new function.
(org-at-item-p,org-list-search-generic): use new function.
2011-03-09 20:30:18 +01:00
Nicolas Goaziou 4090006ab1 org-list: fix confusion due to indent-tabs-mode 2011-03-08 23:49:39 +01:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Nicolas Goaziou 38877e6cf9 org-list: update statistical cookies with check-boxes in an hidden subtree
* lisp/org-list.el (org-update-checkbox-count): Ensure cookies on an
  heading are correctly updated when checkboxes are hidden. It allows,
  for example, to use C-c C-x C-b on a collapsed tree and still get
  the update.
2011-03-06 21:34:35 +01:00
Nicolas Goaziou 1ecee90f47 org-list: slight speed-up for org-list-context 2011-03-06 16:00:34 +01:00
Nicolas Goaziou b65280ae2b org-list: fix infinite loop introduced by last refactoring 2011-03-01 12:22:13 +01:00
Nicolas Goaziou fcf66e74c6 org-list: refactor code 2011-02-28 22:33:31 +01:00
Nicolas Goaziou 7b211c86e7 org-list: fix insertion of item with indent-tabs-mode is non-nil
* lisp/org-list.el (org-list-insert-item): when computing size of item
  being inserted, function has to take into account that indentation
  may not only be made of spaces.
2011-02-25 20:48:27 +01:00
Nicolas Goaziou 7745ad28c3 org-list: fix checkbox toggling
* lisp/org-list.el (org-toggle-checkbox): fix bug where top item in
  list was omitted when checking boxes.

Patch from Nick Dokos.
2011-02-25 18:16:24 +01:00
Nicolas Goaziou 6489346093 Make byte-compiler happy 2011-02-22 20:55:41 +01:00
Nicolas Goaziou 90ad814703 org-list: indentation has precedence over visibility cycling
* lisp/org-list (org-cycle-item-indentation): do not break an
  indentation cycle because visibility cycling is requested. This
  happens when an item becomes a parent, due to indentation change.
  Not considered empty anymore, the function cannot change its
  indentation again.
2011-02-22 18:57:57 +01:00
Nicolas Goaziou 9dc1ac5660 org-list: refactor code 2011-02-22 18:46:33 +01:00
Nicolas Goaziou 99aa57fb20 org-list: cycling indentation must not add white spaces at eol
* lisp/org-list.el (org-cycle-item-indentation): each time the
  function moves item back to child position, a white space is added
  to the line.
2011-02-20 17:38:26 +01:00
Nicolas Goaziou fde7e150bb org-list: docstrings changes 2011-02-18 13:43:49 +01:00
Nicolas Goaziou 19ea827cd7 org-list: unwrap org-entry-get from ignore-errors
* lisp/org-list.el (org-toggle-checkbox, org-update-checkbox-count):
  no need to wrap org-entry-get in ignore-errors since commit
  7dd425cc5d
2011-02-18 13:43:49 +01:00
Nicolas Goaziou f6bbdaf7cc org-list: minor fix in regexp 2011-02-18 12:45:13 +01:00
Nicolas Goaziou b43ad47ad1 Insert a newline character before <\li> when exporting lists
* lisp/org-html.el (org-html-export-list-line): insert a newline
  character before ending an item, as anchor could be on a line
  going to be deleted, like a drawer ending string.
* lisp/org-list.el (org-list-to-html): same.
2011-02-18 12:45:13 +01:00
Nicolas Goaziou 2de0a87f7d org-list: apply removal of org-invisible-p 2011-02-18 12:45:12 +01:00
Nicolas Goaziou 5adafe0c8d Changes to filling in items
* lisp/org.el (org-set-autofill-regexps): use `org-item-re' in
  `paragraph-start' to recognize alphabetical lists.
(org-fill-paragraph): enforce a pre-computed fill-prefix before
  calling fill-paragraph when point in in an item. Also prevent
  paragraphs getting merged into an adjacent list upon filling.
(org-adaptive-fill-function): make sure to determine real fill-prefix
  for auto-fill.
(org-auto-fill-function): use a pre-computed fill-prefix before
  calling do-auto-fill.
* lisp/org-list.el (org-list-item-body-column): new function
2011-02-18 12:45:12 +01:00
Nicolas Goaziou b7f6a916b3 Fix toggling and cycling visibility for items and inline tasks
* lisp/org-inlinetask.el (org-inlinetask-at-task-p,
org-inlinetask-toggle-visibility): new functions.
* lisp/org-list.el (org-list-set-item-visibility): new function.
* lisp/org.el (org-cycle, org-cycle-internal-local): separate lists
  and inline tasks from headlines.
(org-outline-level): do not consider lists as headlines.
  Cycling visibility is using different tools.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou 69cc51fa43 C-c C-c also repairs ill-formed lists
* lisp/org-list.el (org-list-struct): mark items less indented than
  top item of the list, so that they will be modified.
(org-list-struct-apply-struct): compare struct's indentation with
  line's indentation instead of old-struct's. This is needed because
  `org-list-struct' automatically fixes indentation so changes might not
  be seen otherwise.
* lisp/org.el (org-ctrl-c-ctrl-c): small refactoring.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou e5a61ab260 org-list: update cookies in special contexts
* lisp/org-list.el (org-update-checkbox-count): when a part of the
  buffer is processed to count checkboxes, lists are read from top to
  bottom, but inside lists (in drawers, blocks, or inline tasks) are
  skipped. Thus, cookies cannot be updated. This patch enforces
  reading of such lists if counter is itself in a special context.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou f7ebd6bcf0 org-list: ignore inline tasks when shifting an item, and fix indentation
* lisp/org-list.el (org-list-struct-apply-struct): inline tasks along
  with their content must stay at column 0 even if the item is gaining
  indentation. Moreover, fix indentation of text in an inline task,
  now it can be in such a task within a list.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou 349196def4 org-list: forgot a default case in org-list-struct 2011-02-18 12:45:12 +01:00
Nicolas Goaziou 7ce76a7acc org-list: refactor org-list-struct 2011-02-18 12:45:12 +01:00
Nicolas Goaziou 0148fac717 org-list: make org-at-item-p less permissive
* lisp/org-list.el (org-at-item-p): also verify context is valid.
  Otherwise it would recognize valid items where org-in-item-p
  wouldn't.
(org-in-item-p, org-list-struct-apply-struct): use shorter version of
org-at-item-p.
(org-cycle-list-bullet): fix typo.
(org-list-parse-list): avoid calling org-at-item-p two times by using
an appropriate regexp
* lisp/org.el (org-indent-line-function): use an appropriate regexp
  instead of calling org-at-item-p two times.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou 0bec47e9ab org-list: keep byte-compiler happy 2011-02-18 12:45:12 +01:00
Nicolas Goaziou 3017425c48 org-list: fix org-in-item-p when point is just after an ending regexp
* lisp/org-list.el (org-in-item-p): When point was just after
  org-list-end-re, check wouldn't be done for starting line. So, if
  the first line was an item, it wouln't be noticed and function would
  return nil. Simplify and comment code.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou 0850948dea org-list: small bug fix in org-list-struct-apply-struct
* lisp/org-list.el (org-list-struct-apply-struct): if end of list was
  at eol, for example, with list inside a block, the last list
  wouldn't be shifted. Thus, the patch ensures no blank lines is
  skipped.
2011-02-18 12:45:12 +01:00
Nicolas Goaziou dcf23c416f org-list: ignore lines with org-example property when creating structure
* lisp/org-list.el (org-list-struct): when a line has org-example
  property, skip the entire block. This is needed during export, for
  example when src blocks in org markup contain lists, and are
  returned verbatim because org isn't in the list of interpreted
  languages.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou d309256aff org-list: fix corner cases in org-in-item-p
* lisp/org-list.el (org-in-item-p): handle special cases when function
  is called with cursor amidst `org-list-end-re' or at an inline task.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou 12de47aa5a org-list: code cleanup 2011-02-18 12:45:11 +01:00
Nicolas Goaziou bd68169b4b org-list: reorder file, rename functions, improve comments
* lisp/ob.el (org-babel-result-end): apply renaming.
* lisp/org-exp.el (org-export-mark-list-properties): apply renaming.
* lisp/org-list.el (org-list-prevs-alist): renamed from
  org-list-struct-prev-alist.
(org-list-parents-alist): renamed from org-list-struct-parent-alist.
(org-list-write-struct): renamed from org-list-struct-fix-struct.
(org-list-parse-list, org-sort-list, org-list-indent-item-generic,
org-toggle-checkbox, org-update-checkbox-count, org-cycle-list-bullet,
org-list-repair, org-insert-item, org-move-item-up, org-move-item-up,
org-move-item-down, org-next-item, org-previous-item,
org-end-of-item-list, org-beginning-of-item-list, org-apply-on-list):
apply renaming.
(org-get-bullet): removed function, as it is not needed anymore.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou a02d2ad13e org-list: separate tasks needed to insert a new item more clearly
* lisp/org-list.el (org-list-insert-item-generic): change arguments.
  The function now accepts structure and previous items alist. This
  allow to insert an item programmatically more easily.
(org-insert-item): Apply changes to org-list-insert-item-generic. The
  function now takes care about repairing structure and updating
  checkboxes.
* lisp/org-timer.el (org-timer-item): Apply changes to
  org-list-insert-item-generic. The function now takes care about
  repairing structure.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou e7ca7c98dd org-list: modifications to org-list-to-generic
* lisp/org-list.el (org-list-make-subtree): function now uses
  org-list-parse-list mechanism.
(org-list-make-subtrees): removed function.
(org-list-to-generic): added a parameter and every parameter can be a
  sexp returning a string, for finer control.
(org-list-to-html, org-list-to-latex, org-list-to-texinfo): slight
  modifications to apply changes to org-list-to-generic.
(org-list-to-subtree): new function.
2011-02-18 12:45:11 +01:00