0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-23 14:10:43 +00:00
Commit graph

8575 commits

Author SHA1 Message Date
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
Bastien Guerry 68114fb650 Replace remaining htmlp and latexp conditions. 2011-02-18 09:49:12 +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
David Maus 51e665622c Unescape functions moved and renamed from org-protocol.el
* org.el (org-link-unescape, org-link-unescape-compound)
(org-link-unescape-single-byte-sequence): Functions moved and renamed
from org-protocol.el.
2011-02-17 19:26:48 +01:00
David Maus 465940d6c2 Inline function to properly decode utf8 characters in Emacs 22
* org-macs.el (org-char-to-string): Inline function to properly decode
utf8 characters in Emacs 22.  Moved and renamed from org-protocol.el.

* org-protocol.el (org-protocol-unhex-compound): Use renamed inline
function.
2011-02-17 19:26:48 +01:00
David Maus 27915744a2 New optional argument: Merge user table with default table
* org.el (org-link-escape): New optional argument.  Merge user table
with default table.
2011-02-17 19:26:48 +01:00
David Maus 41c771378a Fixup doc string
* org.el (org-link-escape): Fixup doc string.
2011-02-17 19:26:48 +01:00
David Maus 1a68b67939 New format of percent escape table
* org.el (org-link-escape-chars, org-link-escape-chars-browser): New
format of percent escape table.
(org-link-escape): Use new table format.

Just a plain list with the chars that should be escaped.
2011-02-17 19:26:48 +01:00
David Maus 0c4bb0e406 New unicode aware percent encoding algorithm
* org.el (org-link-escape): New unicode aware percent encoding
algorithm.
2011-02-17 19:26:48 +01:00
Sebastian Rose 196a9d7b2b Decode single byte sequence if decoding unicode failed.
* org-protocol.el (org-protocol-unhex-single-byte-sequence): New
function.  Decode hex-encoded singly byte sequences.
(org-protocol-unhex-compound): Use new function if decoding sequence
as unicode character failed.
2011-02-17 19:26:48 +01:00
Bastien Guerry 17351b924f org-clock.el: require 'org-exp to set `org-export-default-language'.
Thanks to Matt Lundin for reporting this.
2011-02-17 17:38:57 +01:00
Bastien Guerry c7700d7bbe * org-html.el (org-export-as-html): expand the HTML title.
This fix is a modified version of a patch submitted by Pierre Téchoueyres.
2011-02-16 11:53:28 +01:00
Bastien Guerry 045214f9d2 org-special-blocks.el: mention that backend is dynamically scoped. 2011-02-16 11:40:53 +01:00
Bastien Guerry 4b8d74150f Fix bug: fetch the updated title of a page when creating the sitemap.
* org-publish.el (org-publish-cache-ctime-of-src): improve
docstring.
(org-publish-find-title): New option to explicitly reset the
title in the cache.
(org-publish-format-file-entry): Use this new option.

Thanks to Jonathan Bisson for reporting this.
2011-02-16 11:39:13 +01:00
Bastien Guerry d03d3575cb Code cleanup: always use 'backend instead of htmlp, latexp, etc. 2011-02-16 10:58:04 +01:00
Bastien Guerry 4db5a1edcf `org-clock-clocktable-language-setup': added spanish translation.
Thanks to Juan Pechiar for providing the translation.
2011-02-16 00:48:05 +01:00
Paul M. Rodriguez 947158cf38 org-velocity templates
This patch allows full customization of org-remember or org-capture
templates for use with org-velocity.

Paul Rodriguez.
2011-02-15 23:06:52 +01:00
Bastien Guerry 0382a62303 `org-clock-clocktable-language-setup': Fix translation. 2011-02-15 18:27:36 +01:00
Bastien Guerry 0491e5305e `org-export-default-language': Better docstring. 2011-02-15 18:25:43 +01:00
Dan Davison fda90a9aad New function `org-clone-local-variables'.
* org-exp.el (org-export-preprocess-string): Set the source
buffer and use `org-clone-local-variables' to get local
variables from it.

* org.el (org-clone-local-variables): New function.
2011-02-15 18:03:58 +01:00
Bastien Guerry a9da06b1db org-latex.el: minor docstring clean up. 2011-02-15 15:01:25 +00:00
Dan Davison 695b15da6d Allow empty strings in minted/listings latex options
* lisp/org-exp.el (org-export-format-source-code-or-example):
Allow empty string as second element in minted/listings options

Both

    (setq org-export-latex-minted-options
          '(("frame" "lines")
            ("fontsize" "\\scriptsize")
            ("linenos" "")))

and

    (setq org-export-latex-minted-options
          '(("frame" "lines")
            ("fontsize" "\\scriptsize")
            ("linenos")))

will result in latex like

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{common-lisp}
2011-02-15 15:01:25 +00:00
Dan Davison 65d0b3d353 New UI for configuring latex src code export.
Three new user-customizable variables:

org-export-latex-listings-options (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list of options for the latex listings package.

These options are supplied as a comma-separated list to the
\\lstset command. Each element of the association list should be
a list containing two strings: the name of the option, and the
value. For example,

  (setq org-export-latex-listings-options
    '((\"basicstyle\" \"\\small\")
      (\"keywordstyle\" \"\\color{black}\\bfseries\\underbar\")))

will typeset the code in a small size font with underlined, bold
black keywords.

Note that the same options will be applied to blocks of all
languages.

See ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf

customization group: org-export-latex

org-export-latex-minted-options (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list of options for the latex minted package.

These options are supplied within square brackets in
\\begin{minted} environments. Each element of the alist should be
a list containing two strings: the name of the option, and the
value. For example,

  (setq org-export-latex-minted-options
    '((\"bgcolor\" \"bg\") (\"frame\" \"lines\")))

will result in src blocks being exported with

\\begin{minted}[bgcolor=bg,frame=lines]{<LANG>}

as the start of the minted environment. Note that the same
options will be applied to blocks of all languages."

customization group: org-export-latex

See minted.googlecode.com/files/minted.pdf

org-export-latex-custom-lang-environments (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list mapping languages to language-specific latex
environments used during export of src blocks by the listings
and minted latex packages. For example,

  (setq org-export-latex-custom-lang-environments
     '((python \"pythoncode\")))

* lisp/org-exp.el (org-export-format-source-code-or-example):
  Support new user-customizable options
(org-export-latex-custom-lang-environments): Ensure new variable is defined
(org-export-latex-listings-options): Ensure new variable is defined
(org-export-latex-minted-options): Ensure new variable is defined

* lisp/org-latex.el (org-export-latex-listings-options): New variable
(org-export-latex-minted-options): New variable
(org-export-latex-custom-lang-environments): New variable
2011-02-15 15:01:25 +00:00
Bastien Guerry e51aa0eaa5 Bugix: keep backward-compatible with the old default of `org-export-html-validation-link'.
* org-html.el (org-export-as-html): handle the case when
`org-export-html-validation-link' is nil to keep backward
compatible with the old default value of this variable.

Thanks to Sébastien Vauban for spotting this.
2011-02-15 15:57:20 +01:00
Bastien Guerry ed6d676026 Code cleanup: use a generic :for-backend parameter. 2011-02-15 11:07:46 +01:00
Bastien Guerry 0f01b842bb Small bug fix to org-ascii-level-start (again). 2011-02-15 10:47:26 +01:00
Eric Schulte e9cba96b0a ob: fix indentation bug when inserting results from inline code blocks
* lisp/ob.el (org-babel-insert-result): Don't choke if indent is not a number.
2011-02-14 23:51:40 -07:00
Bastien Guerry d9eeb15ab9 Fix bug when jumping to a datetree from the agenda.
Datetree entries have a fixed form now:

* 2011
** 2011-02 monthname
*** 2011-02-13 dayname

These headings will not be recognized as datetrees:

* 2011 A task for 2011
** 2011-02 several words
*** 2011-02-13 several words

Thanks to Detlef Steuer for reporting this.
2011-02-15 06:07:53 +01:00
Christian Moe 740afd558d org-bbdb-export: use a better description.
* org-bbdb.el (org-bbdb-export): When a link description has been
added by org-export-normalize-links, use path instead (remove the
`bbdb:' prefix).

The existing code handled the case where desc is nil. However, this no
longer occurs, since org-export-normalize-links now automatically adds
a desc to links, with a `bbdb:' prefix that would not usually be
wanted in exported text. The patch results in the same output as
originally intended.

TINYCHANGE
2011-02-15 05:37:17 +01:00
Bastien Guerry 8ee7408edb `org-export-ascii-underline' is now order from level 1 to n.
* org-ascii.el (org-export-ascii-underline): Put the level's
characters in the right order, as documented by the docstring.
(org-ascii-level-start): select the right char for underlining
headlines.
2011-02-15 05:30:00 +01:00
Bastien Guerry 846a2d13d3 Code cleanup: use (org-mode-p) when possible. 2011-02-15 05:18:22 +01:00
Bastien Guerry a923f528cd org-src.el: allow source editing from modes derived from Org.
* org-src.el (org-edit-src-code): allow to edit source code
from modes derived from Org.
2011-02-15 05:04:22 +01:00