Commit graph

4571 commits

Author SHA1 Message Date
Carsten Dominik c654620d73 Allow file names in capture templates to be functions, forms, or variables
* lisp/org-capture.el (org-capture-expand-file): New function.
(org-capture-target-buffer):
(org-capture-set-target-location): Use `org-capture-expand-file'.

* doc/org.texi (Template elements): Document that files can be given
as function, form, or variable.
2011-02-22 10:10:22 +01:00
Eric Schulte 1e35a5ea37 ob: updates related to list changes
* lisp/ob.el (org-babel-read-list): Reading the value of a list has
  been updated to reflect the new structure of org-mode lists in
  elisp.
  (org-babel-insert-result): Writing code block results to lists has
  been updated to reflect the new list structure.
  (org-babel-result-end): Remove a previous change to end-of-list
  marker detection
2011-02-21 12:40:49 -07: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
Eric Schulte 39192b78d2 ob: allow elisp code in results header arguments
* lisp/ob.el (org-babel-process-params): Allow elisp code in
  specification of results header arguments.
2011-02-20 02:16:43 -07:00
Bastien Guerry 77c278c932 Fix small typos in docstrings. 2011-02-19 12:52:26 +01:00
Bastien Guerry 164367fbbe Merge branch 'master' of orgmode.org:org-mode 2011-02-19 12:13:56 +01:00
Bastien Guerry 3655dcbd37 New command `org-agenda-append-agenda' to append agendas.
* org-agenda.el (org-agenda-append-agenda): New command.
(org-agenda-mode-map): New keybinding to this new command.
2011-02-19 12:13:42 +01:00
Nicolas Goaziou 729564ae74 Send list only with cursor at top item
* lisp/org.el (org-ctrl-c-ctrl-c): call `org-list-send-list' only when
  cursor it at very first item of the list, as specified in the
  manual. Also refactored the list part of the function a bit.
2011-02-19 11:27:53 +01:00
Nicolas Goaziou 2366083b82 Remove org-entry-get from ignore-errors macro 2011-02-19 10:51:38 +01:00
Bastien Guerry c6dbde1bab Fix bug when redoing a block agenda command.
* org-agenda.el (org-agenda): Set the 'last-args property to
nil when calling `org-agenda'.  Don't kill the local variable
`org-agenda-current-span'.
(org-run-agenda-series): Use the new property 'last-args.
(org-agenda-change-time-span): Use the dynamically set
`org-agenda-overriding-arguments' variable when non-nil.

Thanks to Matt Lundin and Michael Brand for reporting this.
2011-02-18 15:15:54 +01:00
Eric Schulte 10d76f720a ob: adjust to changes in list format
* lisp/ob.el (org-babel-result-end): Adjust marker of list end to
  changes in the list format.
2011-02-18 06:13:29 -07: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 713262edc1 Preserve hierarchy when converting items to headlines and the other way
* lisp/org.el (org-toggle-item, org-toggle-heading): make sure every
  sub-item in a list is changed into a sub-heading and sub-headings
  are translated into sub-items. Also ignore inline tasks in the
  process.

org-toggle-item on headlines preserves hierarchy
2011-02-18 13:43:49 +01:00
Nicolas Goaziou de3d3652bb org-html: use non breaking space for empty checkboxes 2011-02-18 13:43:48 +01:00
Nicolas Goaziou 1ac0ac16ac org-html: remove unused local variable 2011-02-18 13:43:48 +01:00
Nicolas Goaziou 3d34dd47dd org-html: remove unneeded newline characters in list export 2011-02-18 13:43:48 +01:00
Nicolas Goaziou 4fd61d8021 org-html: unchecked boxes should not appear checked without CSS 2011-02-18 13:43:48 +01:00
Nicolas Goaziou feb1a17083 org-exp: set correct text properties when replacing special blocks
* lisp/org-exp.el (org-export-select-backend-specific-text): add
  `original-indentation' property when replacing #+begin_backend and
  #+backend blocks with their content. This is needed for lists, as
  they must know if the block belonged to them.
2011-02-18 13:43:46 +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 f7dbea5989 Fix small bug in org-toggle-item
* lisp/org.el (org-toggle-item): when used on normal text, ensure
  every line in region is included in the new item, regardless of its
  original indentation.
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 304e8f1cd2 Change behavior of org-toggle-item when used with normal text.
* lisp/org.el (org-toggle-item): Now accepts a prefix argument. When
  used without argument on normal text, it will make the whole region
  one item. With an argument, it defaults to old behavior: change each
  line in region into an item.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou 89c066a10c Newline-and-indent respects list structure
* lisp/org.el (org-return): when called from inside an item with the
  indent flag, function should keep text moved inside the item. This
  allows to use C-j to separate lines in an item: cursor won't go back
  to column 0.
2011-02-18 12:45:11 +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
Nicolas Goaziou 4efa974264 Fix for `org-beginning-of-line' at an item
* lisp/org.el (org-beginning-of-line): apply changes to
  `org-item-beginning-re' to correct sub-expression reference.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou 3e274d0290 org-list: small refactoring and comments improvements 2011-02-18 12:45:11 +01:00
Nicolas Goaziou 4636453e93 Do not enforce type of ordered lists upon exporting
* lisp/org-docbook.el (org-export-docbook-list-line): even with
  alphabetical lists, Org shouldn't enforce a particular list type to
  exporters. This is a job for style files.
* lisp/org-html.el (org-html-export-list-line): ib idem.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou 212828c556 org-list: correctly handle counters in `org-list-parse-list'
* lisp/org-list.el (org-at-item-counter-p): new function.
(org-list-parse-list): handle counters and list depth.
(org-list-to-generic): a special string is used when an item has a
counter.
(org-list-to-latex): use new special string for counters. This fixes
the counter bug in LaTeX export, as the enumi counter was the only one
modified.
* lisp/org-latex.el (org-export-latex-lists): use new
`org-list-parse-list' output.
2011-02-18 12:45:11 +01:00
Nicolas Goaziou cddea8c542 org-list: new accessor returning type of list
* lisp/org-list.el (org-list-get-list-type): new function.
(org-list-parse-list): use new function.
* lisp/org-html.el (org-html-export-list-line): use new function.
* lisp/org-docbook.el (org-export-docbook-list-line): use new function.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou 781228183a org-list: implement alphabetical lists
* lisp/org-list.el (org-alphabetical-lists): new variable
(org-item-re, org-list-full-item, org-cycle-list-bullet,
org-list-struct-fix-bul, org-list-inc-bullet-maybe): reflect
introduction of the new variable.
(org-item-beginning-re): changed into a function, so any modification
of `org-alphabetical-lists' will not require reloading Org.
(org-at-item-p, org-toggle-checkbox, org-update-checkbox-count,
org-list-parse-list, org-list-send-list): reflect changes to
`org-item-beginning-re'.
(org-list-use-alpha-bul-p): new function.
* lisp/org.el (org-check-for-hidden): reflect changes to
`org-item-beginning-re'.
* lisp/org-capture.el (org-capture-place-item): reflect changes to
`org-item-beginning-re'.
* lisp/org-docbook.el (org-export-docbook-list-line): handle new type
of items.
* lisp/org-exp.el (org-export-mark-list-end,
org-export-mark-list-properties): reflect changes to
`org-item-beginning-re'.
* lisp/org-html.el (org-html-export-list-line): handle new type of
items.
* lisp/org-latex.el (org-export-latex-lists): handle new type of items
and reflect changes to `org-item-beginning-re'.
* lisp/org-ascii.el (org-export-ascii-preprocess): handle new counters.

Modified from a patch by Nathaniel Flath.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou e5293ba347 org-list: checkbox count code cleanup 2011-02-18 12:45:10 +01:00
Nicolas Goaziou 2c79244687 Change function org-list-end-re into a variable
* lisp/org-list.el (org-list-end-re): removed function and made it a
  variable. There's no need for the overhead of calling the function
  every at every line in a list. User will have to reload Org if he
  change value of either `org-list-end-regexp' or
  `org-empty-line-terminates-plain-lists'.
(org-in-item-p,org-list-struct,org-list-parse-list): apply change.
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): apply change
* lisp/org-latex.el (org-export-latex-lists): apply change. Also
  prevent items with org-example property to be considered as real
  items.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou 215d3fa030 Improve usage of `org-in-item-p'
When the function needs to know if cursor is in a plain list and move
to item beginning if it is the case, a fast way is to ignore errors on
(goto-char (org-in-item-p)).
2011-02-18 12:45:10 +01:00
Nicolas Goaziou d7a799cc86 org-inlinetask: fix export of inline tasks within lists
* lisp/org-inlinetask.el (org-inlinetask-export-templates): slightly
  modify templates so environment boundaries don't interfere with
  content of task. Unprotect content of task so it might benefit from
  further transformations. Set original-indentation property to a high
  value to ensure that task is always in the last item of the list.
  Also, apply templates later in export process.
* lisp/org-list.el (org-list-struct): fix inline task skipping.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou 79553c4764 org-list: fixes for incorrect number of arguments 2011-02-18 12:45:10 +01:00
Nicolas Goaziou eeea385b0b org-latex: during export process, only unprotected items are valid
* lisp/org-latex.el (org-export-latex-lists): Search for unprotected
  items only, and redefine `org-at-item'. This change is required when
  verbatim lists are inserted during export, usually by Babel.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou b219690f05 ob: compute correct end position when results are a list
* lisp/ob.el (org-babel-result-end): end position is end of current
  sublist instead of bottom point, as results might be inserted in a
  list themselves.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou c82805fc57 org-list: small fixes for org-list-struct 2011-02-18 12:45:10 +01:00
Nicolas Goaziou fc6c418726 org-list: remove code preventing insertion of an item in a block
* lisp/org-list.el (org-list-automatic-rules): removed insert rule.
(org-list-insert-item-generic): removed code preventing user to insert
another item in a block within a list. It is because new list context
make it impossible to see if a point in a block is also in a list.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou 23e5d5720e org-exp: split list processing in two parts to better handle org-babel
* lisp/org-exp.el (org-export-preprocess-string): mark list endings
  before babel blocks preprocessing starts, so blank lines that may be
  inserted do not break list's structure. Then, mark list with special
  properties required by exporters. Thus output from babel can easily
  be included in lists.
(org-export-mark-list-end): new function
(org-export-mark-list-properties): new function
(org-export-mark-lists): removed function. It was split into the two
  preceding functions.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou 39d85b5e39 org-list: small optimization for cookies updating
* lisp/org-list.el (org-update-checkbox-count): do not recompute every
  list before next heading when there are more than one cookie in an
  headline. Moreover, ignore the case where cookie is inserted neither
  at an heading nor at an item.
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 2621fe0461 Do not remove empty list items in HTML and DocBook export 2011-02-18 12:45:09 +01:00
Nicolas Goaziou c32e39786d org-list: small corrections to sort list
* lisp/org-list.el (org-sort-list): fix number of arguments to
  `org-list-repair', plus make end-record go to end of item before any
  blank line to keep them from being swallowed in the sorting.
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 884d983188 org-list: fix code typo 2011-02-18 12:45:09 +01:00
Nicolas Goaziou b37761715e Added variable to configure where lists should be interpreted
* lisp/org-list.el (org-list-forbidden-blocks): variable renamed from
  org-list-blocks.
(org-list-export-context): new variable

* list/org-exp.el (org-export-mark-lists): use new variable.

* list/org-latex.el (org-export-latex-lists): use new variable
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 212a7ddced org-list: small fix in insert function 2011-02-18 12:45:09 +01:00
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 2adbcfffe1 Remove uses of deprecated top-point and bottom-point functions
* lisp/org.el (org-skip-over-state-notes,org-store-log-note): use new
  accessors.

* list/ob.el (org-babel-result-end): use new accessors.

* list/org-exp.el (org-export-mark-list-ending): use new accessors.
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 c12ce921d7 Checkboxes do not change indentation in lists
* org.el (org-indent-line-function): Indentation of item's body starts
  just after the bullet, not after a checkbox. Moreover, As
  `org-in-item-p' also returns item beginning position when point is
  in a list, do not compute it a second time.
2011-02-18 12:45:08 +01:00
Nicolas Goaziou e223357743 Lighten process when C-c C-c is called at a list item
* org.el (org-ctrl-c-ctrl-c): when called at a list item, replace
  usage `org-repair-list', forcing another reading of the list, with
  only needed subroutines.
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
Bastien Guerry e16c502b4a org-latex.el: fix bug about #+BIND directive not followed.
* org-latex.el (org-export-latex-content): bind local variables
for export in the temporary export buffer.

Thanks to Andreas Leha for reporting this.
2011-02-18 11:25:11 +01:00
David Maus 373caa4d1c Change date of obsolete declaration to 2011-02-17
* org-protocol.el (org-protocol-unhex-single-byte-sequence)
(org-protocol-unhex-string, org-protocol-unhex-compound): Change date
of obsolete declaration to 2011-02-17.
2011-02-17 20:21:54 +01:00
David Maus 0d6dacd978 Throw error if encoding character in utf8 fails
* lisp/org.el (org-link-escape): Throw error if encoding character in
utf8 fails.
2011-02-17 19:26:49 +01:00
David Maus 0590bb7fe1 Use `org-link-unescape' instead of obsolete unhex string function
* lisp/org-protocol.el (org-protocol-split-data) (org-protocol-open-source):
Use `org-link-unescape' instead of obsolete unhex string function.
2011-02-17 19:26:49 +01:00
David Maus 139cc1d4c2 Always percent escape the percent sign
* lisp/org.el (org-link-escape, org-link-escape-chars-browser)
(org-link-escape-chars): Always percent escape the percent sign.
2011-02-17 19:26:49 +01:00
David Maus 7b58cccddd Refactor unescaping functions
* org.el (org-link-unescape): Simpler algorithm for replacing percent
escapes.
(org-link-unescape-compound): Use cond statements instead of nested
if, convert hex string with string-to-number, save match data.
(org-link-unescape-single-byte-sequence): Use mapconcat and
string-to-number for unescaping single byte sequence.
2011-02-17 19:26:49 +01:00
David Maus dc76fd5d71 Rename lambda argument
* org.el (org-link-escape): Rename lambda argument.
2011-02-17 19:26:49 +01:00
David Maus 1350e57626 Add percent sign to list of escape chars
* org.el (org-link-escape-chars-browser, org-link-escape-chars): Add
percent sign to list of escape chars.
2011-02-17 19:26:49 +01:00
David Maus d8c2cad3ef Use new percent escape character table format
* org-mobile.el (org-mobile-escape-olp): Use new percent escape
character table format.
2011-02-17 19:26:48 +01:00
David Maus 98bf28c52f Remove obsolete argument in call to org-link-unescape
* org-mobile.el (org-mobile-locate-entry): Remove obsolete argument in
call to org-link-unescape.

`org-link-unescape' always unescapes all percent escaped sequences.
2011-02-17 19:26:48 +01:00
David Maus 17f3548e78 Declare obsolete & alias to respective org-link-unescape-* functions
* org-protocol.el (org-protocol-unhex-string)
(org-protocol-unhex-compound)
(org-protocol-unhex-single-byte-sequence): Declare obsolete and
alias to respective org-link-unescape-* functions.
2011-02-17 19:26:48 +01:00