Commit graph

7879 commits

Author SHA1 Message Date
Bastien Guerry f01ce85026 Merge branch 'maint' 2012-12-24 01:25:38 +01:00
Bastien Guerry 40cb44e795 Fix regression: allow editing HTML and LaTeX source blocks again
* org.el (org-table-map-tables): Fix allowed blocks.
(org-edit-special): Fix regression: allow editing HTML and
LaTeX source blocks again.

* org-src.el (org-edit-src-code): Ditto.

Thanks to Nicolas Richard and Bernt Hansen for reporting bugs
in this area.
2012-12-24 01:25:33 +01:00
Bastien Guerry f0b35a6379 Merge branch 'master-fixes' 2012-12-24 01:15:57 +01:00
Bastien Guerry 4adf17f811 Merge branch 'maint' 2012-12-24 00:08:20 +01:00
Bastien Guerry 73d506a8dc org.el (org-nonsticky-props): Add `htmlize-link'
* org.el (org-nonsticky-props): Add `htmlize-link'.

Thanks to Samuel Wales for reporting a bug related to this.
2012-12-24 00:08:02 +01:00
Bastien Guerry 317a96a471 org.el (org-nonsticky-props): Add `htmlize-link'
* org.el (org-nonsticky-props): Add `htmlize-link'.

Thanks to Samuel Wales for reporting a bug related to this.
2012-12-23 21:17:43 +01:00
Bastien Guerry 5fa52d9a93 org.el: Add new startup keywords
* org.el (org-startup-options): New startup keywords.
(org-log-into-drawer): Update docstring to explain how to set this
variable through the startup keyword "logdrawer" and "nologdrawer".
(org-log-states-order-reversed): Document the new startup keywords
"logstatesreversed" and "nologstatesreversed".

* org.texi (In-buffer settings): Document new startup keywords.
Thanks to John J Foerch for this idea.
2012-12-23 18:51:24 +01:00
Bastien Guerry 88555aab22 Merge branch 'maint' 2012-12-23 17:54:47 +01:00
Bastien Guerry 98a5f3df32 Don't allow special edit in verbatim blocks.
* org.el (org-edit-special): Don't edit in verbatim blocks.

* org-src.el (org-edit-src-code): Ditto.
2012-12-23 17:54:42 +01:00
Bastien Guerry ae7516b0e1 Sync `org-babel-temp-file' definition with maint 2012-12-23 17:47:20 +01:00
Bastien Guerry 953b920c9b Merge branch 'maint' 2012-12-23 17:31:57 +01:00
Bastien Guerry f0a64ab3b5 org-table.el: Use `org-delete-backward-char' which doesn't modify match data anymore
* org-table.el (org-table-fedit-lisp-indent)
(orgtbl-self-insert-command): Use `org-delete-backward-char'
instead of `backward-delete-char'.

* org.el (org-delete-backward-char, org-delete-char): Save
match data.
2012-12-23 17:31:41 +01:00
Bastien Guerry c2e662cf79 Revert "Save match data in org-delete-backward-char' and org-delete-char'"
This reverts commit c800836d7c.
2012-12-23 17:26:45 +01:00
Bastien Guerry 8c53cc820e Merge branch 'master-fixes' 2012-12-23 17:20:55 +01:00
Bastien Guerry 9f1f0535be Merge branch 'maint' 2012-12-23 17:20:51 +01:00
Bastien Guerry 54731c965d Merge branch 'maint-fixes' into maint 2012-12-23 17:20:38 +01:00
Bastien Guerry a118ae4e1c org-src.el (org-edit-src-code): Fix another bug about editing special blocks "example" and "verbatim"
* org-src.el (org-edit-src-code): Fix another bug about
editing special blocks "example" and "verbatim".
2012-12-23 17:20:27 +01:00
Bastien Guerry 9f4ecf79b1 org.el (org-edit-special): Fix bug about editing special blocks "example" and "verbatim"
* org.el (org-structure-template-alist): Add verbatim.
(org-edit-special): Fix bug about editing special blocks
"example" and "verbatim".
2012-12-23 17:18:47 +01:00
Bastien Guerry 3684f84aee Merge branch 'maint' 2012-12-23 12:46:49 +01:00
Jambunathan K 293a14d13f Update OpenDocument schema files to v1.2 OASIS standard
* etc/schema/od-schema-v1.2-os.rnc: OASIS standard
* etc/schema/od-manifest-schema-v1.2-os.rnc: OASIS standard
* etc/schema/schemas.xml: Fix uri to rnc files.
* lisp/org-odt.el (org-export-odt-schema-dir): Modified to
accommodate change in rnc file names.
* contrib/lisp/org-e-odt.el (org-e-odt-schema-dir): Modified
to accommodate change in rnc file names.
2012-12-23 12:44:42 +01:00
Jambunathan K 7ab4464ea4 org-odt.el: Fix Emacs Bug#13254
* lisp/org-odt.el (org-export-as-odt-batch): Init
`org-odt-zip-dir'.  Fix Emacs Bug#13254.
2012-12-23 12:42:43 +01:00
Jambunathan K b495c92239 org-odt.el: Correctly format link to headlines that have description
* lisp/org-odt.el (org-odt-format-org-link): Add check for
presence of description in headline links.

Fix
http://lists.gnu.org/archive/html/emacs-orgmode/2012-11/msg00841.html
2012-12-23 12:42:43 +01:00
Bastien Guerry c800836d7c Save match data in org-delete-backward-char' and org-delete-char'
* org.el (org-delete-backward-char, org-delete-char): Save
match data (`delete-backward-char' and `delete-char' don't.)
(org-enable-table-editor, org-insert-heading)
(org-remove-timestamp-with-keyword, org-self-insert-command):
Use `delete-backward-char' instead of `backward-delete-char'.

* org-table.el (org-table-fedit-lisp-indent)
(orgtbl-self-insert-command): Ditto.

* org-latex.el (org-export-latex-subcontent): Ditto.

* org-clock.el (org-clocktable-write-default): Ditto.

* org-ascii.el (org-export-ascii-preprocess): Ditto.

Thanks to Vegard Vesterheim for raising this issue and proposing a patch,
and to Carsten for pointing at the root of the problem.
2012-12-23 12:30:40 +01:00
Bastien Guerry 2861bfc712 org.el (org-mode-map): Use org-remap' instead of binding M-t'
* org.el (org-mode-map): Use `org-remap' instead of binding
`M-t' to `org-transpose-words' directly.
2012-12-23 12:15:24 +01:00
Bastien Guerry e815ab5f8e Merge branch 'master-fixes' 2012-12-23 00:34:49 +01:00
Bastien Guerry b6eede54b2 Merge branch 'maint' 2012-12-23 00:34:42 +01:00
Bastien Guerry a0fd83976a Fix compiler warnings 2012-12-23 00:32:40 +01:00
Bastien Guerry 0f7500704e org.el: Introduce a tiny syntax table for a new function `org-transpose-words'
* org.el (org-syntax-table): New variable.
(org-transpose-words): New command, simply wrapping the new
syntax table around `transpose-words'.
(org-mode-map): Bind `org-transpose-words' to `M-t'.

Thanks to Eric Abrahamsen for this idea.
2012-12-23 00:31:14 +01:00
Bastien Guerry 416357c82c org.el (org-store-link): Use keyword at point as the search string
* org.el (org-store-link): Use keyword at point as the search
string.

Thanks to Thomas Dye for reporting this.
2012-12-22 23:20:47 +01:00
Bastien Guerry a0be28eeb6 org.el (org-make-org-heading-search-string): Rewrite using org-element.el
* org.el (org-make-org-heading-search-string): Rewrite using
org-element.el.  Not an interactive function anymore.
2012-12-22 23:06:08 +01:00
Bastien Guerry f015ae5b8b org.el (org-todo): Ignore the comment string when changing a TODO state
* org.el (org-todo): Ignore the comment string when changing
the TODO state of a headline.

Thanks to Samuel Wales for reporting this.
2012-12-22 20:16:17 +01:00
Bastien Guerry dd0c6a4440 Use delq nil' instead of delete nil' in a few functions
* org.el (org-store-link): Use `delq nil' instead of `delete nil'.

* org-pcomplete.el (pcomplete/org-mode/drawer): Ditto.

* org-mobile.el (org-mobile-files-alist): Ditto.
2012-12-22 19:45:26 +01:00
Bastien Guerry 1db82b269a org.el: Don't add curly braces to bracket links within internal links
* org.el (org-store-link): When creating a link to a heading
with a bracket link, don't escape this link with curly braces
as the escaped link is not active anyway; use the description
instead.  If the headline only consists of a bracket link, add
a star to the description so that the user knows this is an
internal link.

Thanks to Dave Abrahams for triggering this.
2012-12-22 19:39:03 +01:00
Bastien Guerry 12fd14b858 org-w3m.el (org-w3m-store-link): New function
* org-w3m.el (org-w3m-store-link): New function.
2012-12-22 19:19:26 +01:00
Bastien Guerry cb05900402 org.el (org-store-link): Remove handling w3m links from this function
* org.el (org-store-link): Update the error message when no
method is available for storing a link.  Use `user-error' for
this.  Remove handling w3m links from this function.
2012-12-22 19:18:33 +01:00
Bastien Guerry 8a78d1790e org.el (org-insert-heading, org-insert-todo-heading): C-u C-u inserts at the end of the parent subtree
* org.el (org-insert-heading, org-insert-todo-heading): A
double prefix arg force the insertion of the subtree at the
end of the parent subtree.

Thanks to Esben Stien for asking this.
2012-12-22 18:47:27 +01:00
Bastien Guerry 8fddddcbc8 org.el (org-store-link): A double prefix argument now skips module store-link functions
* org.el (org-store-link): A double prefix argument now skips
module store-link functions to only use Org's core functions.
Also, when several modular store-link functions match, ask for
which one to use.

Thanks to Jonas Bernoulli for this idea.
2012-12-22 17:13:43 +01:00
Sebastien Vauban ce4e0846b2 When pasting a copied subtree, respect the whitelines before and after
* org.el (org-copy-subtree, org-paste-subtree): Fix whitespace
handling when copying/pasting a subtree.
2012-12-22 16:22:12 +01:00
Bastien Guerry 43f7659664 org.el: Don't populate the *Messages* with messages from some functions.
* org.el (org-cycle, org-cycle-internal-global)
(org-cycle-internal-local, org-display-outline-path): Let-bind
`message-log-max' to nil so that messages don't populate the
*Messages*.

Thanks to Michael Heerdegen for raising this and to Christopher Schmidt
and Michael Brand for suggesting a fix.
2012-12-22 16:06:47 +01:00
Bastien Guerry 830e231ef1 Merge branch 'maint'
Conflicts:
	lisp/ob.el
	testing/lisp/test-org-src.el
2012-12-21 09:46:49 +01:00
Bastien Guerry 9333426c12 Re-apply commit 27bcf9a together with a workaround for `process-file'.
Thanks to Michael Albinus for hunting this bug and for providing
this workaround.
2012-12-21 09:45:53 +01:00
Bastien Guerry fa17bf12d5 Merge branch 'maint'
Conflicts:
	lisp/ob.el
2012-12-21 09:33:19 +01:00
Bastien Guerry 30922bd7e9 org.el (org-edit-special): Fix docstring.
* org.el (org-edit-special): Fix docstring.
(org-in-src-block-p): Small enhancement.
2012-12-21 09:32:38 +01:00
Bastien Guerry 483aa1312d Revert "Backport revno 111277 from Emacs trunk."
This reverts commit 27bcf9a70b.
2012-12-21 08:50:26 +01:00
Bastien Guerry 5827bb299c Revert "Backport revno 111277 from Emacs trunk."
This reverts commit 27bcf9a70b.

Conflicts:
	lisp/ob.el
2012-12-21 08:49:33 +01:00
Bastien Guerry 7a6ceacd2d Merge branch 'maint' 2012-12-20 19:01:36 +01:00
Bastien Guerry f8aab87141 Fix compiler warning. 2012-12-20 19:01:17 +01:00
Bastien Guerry 24dea073bc Merge branch 'maint'
Conflicts:
	testing/lisp/test-ob-exp.el
2012-12-20 18:56:27 +01:00
Bastien Guerry 44558f0bbd Unify the list of args for org-export-as-* functions.
* org-publish.el (org-publish-org-to): Call `org-export-as-*'
functions with the correct list of arguments.

* org-html.el (org-export-as-html): Delete obsolete arg
`hidden'.
(org-export-as-html-and-open, org-export-as-html-batch)
(org-export-region-as-html): Don't use obsolete arg.

* org-ascii.el (org-export-as-ascii): Delete obsolete arg
`hidden'.
(org-export-as-ascii-to-buffer): Don't use obsolete arg.
2012-12-20 18:54:33 +01:00
Bastien Guerry a14d2673a7 Merge branch 'maint'
Conflicts:
	lisp/org.el
2012-12-20 16:37:35 +01:00
Bastien Guerry 8165be3aa5 org.el: Prevent link activation in source code blocks
* org.el (org-in-fixed-width-region-p): Save match data.
(org-in-src-block-p): Use case-folding for searching the block
boundaries.
(org-activate-plain-links, org-activate-angle-links)
(org-activate-bracket-links): Prevent link activation in
source code blocks.

Thanks to Sébastien Vauban for reporting a related issue.
2012-12-20 16:34:27 +01:00
Bastien Guerry 8cee987f79 Merge branch 'maint' 2012-12-20 16:16:09 +01:00
Bastien Guerry e89994a75c Revert "org.el (org-set-font-lock-defaults): Don't activate links in source code blocks and fixed-width regions"
This reverts commit f983cf1729.
2012-12-20 16:15:54 +01:00
Bastien Guerry feacde6c71 Merge branch 'maint' 2012-12-20 16:07:52 +01:00
Bastien Guerry de84aadf8f org-odt.el: Fix Emacs bug #13197.
* org-odt.el (org-odt-cleanup-xml-buffers): Fix Emacs
Bug#13197 by setting the correct buffer before marking it
unmodified to silently kill him.

Thanks to Drew Adams for reporting this and to Jambunathan for
offering to fix it.
2012-12-20 16:06:25 +01:00
Bastien Guerry e5539d4d58 Merge branch 'maint'
Conflicts:
	lisp/ob.el
	lisp/org.el
2012-12-20 15:54:52 +01:00
Michael Albinus 27bcf9a70b Backport revno 111277 from Emacs trunk.
* ob.el (org-babel-temp-file): Fix setting of
`temporary-file-directory' on remote hosts.

* ob-eval.el (org-babel-shell-command-on-region): Use
`process-file' instead of `call-process-region'.  The latter one
does not work on remote hosts.
2012-12-20 15:49:19 +01:00
Bastien Guerry f983cf1729 org.el (org-set-font-lock-defaults): Don't activate links in source code blocks and fixed-width regions
* org.el (org-set-font-lock-defaults): Don't activate links in
source code blocks and fixed-width regions.

Thanks to Sébastien Vauban for reporting an error related to this.
2012-12-20 15:42:53 +01:00
Bastien Guerry ab5e372926 org-agenda.el (org-agenda-finalize): Fix links activation
* org-agenda.el (org-agenda-finalize): Fix links activation.
2012-12-20 15:34:10 +01:00
Bastien Guerry 5de94e46e4 Merge branch 'maint' 2012-12-20 13:16:47 +01:00
Dmitry Antipov bfb9f9d10f Use (point-marker) instead of (move-marker (make-marker) (point))
* org-agenda.el (org-agenda-get-restriction-and-command): Use `point-marker'.
* org-capture.el (org-capture-place-template): Likewise.
* org-colview-xemacs.el (org-dblock-write:columnview): Likewise.
* org-colview.el (org-dblock-write:columnview): Likewise.
* org-mobile.el (org-mobile-locate-entry): Likewise.
* org-table.el (org-table-convert-region): Likewise.
* org.el (org-update-statistics-cookies): Likewise.
* contrib/lisp/org-invoice.el (org-dblock-write:invoice): Likewise.
2012-12-20 13:16:41 +01:00
Achim Gratz 12d53240e9 Merge branch 'maint' 2012-12-20 13:00:04 +01:00
Achim Gratz b508943d32 org-compat: new macro org-no-popups
* lisp/org-compat.el (org-no-popups): New wrapper macro which
  let-binds the correct variables to suppress popup windows depending
  on the Emacs version in use.  This is a compile-time decision when
  byte-compiling.

* lisp/org.el (org-get-location, org-switch-to-buffer-other-window):
  Use the wrapper `org-no-popups´ to let-bind the correct variables
  for suppression of popup windows.
2012-12-20 12:57:52 +01:00
Bastien Guerry 096c5644f7 Merge branch 'maint' 2012-12-20 11:13:39 +01:00
Bastien Guerry dfa3c74e34 Fix commit 14ffe2. 2012-12-20 11:13:30 +01:00
Bastien Guerry 9be19e32d1 Merge branch 'maint' 2012-12-20 09:39:48 +01:00
Bastien Guerry 14ffe22b8f org.el (org-open-at-point): Handle non-links correctly.
* org.el (org-open-at-point): Throw the correct error on
non-links.  Use `user-error' instead of `error'.

This fixes a bug introduced in ad35e2.

Thanks to Samuel Loury for spotting this and for submitting a patch.
2012-12-20 09:39:35 +01:00
Bastien Guerry beeb9168dd org-table.el: Handle localized time-stamps in formulas evaluation
* org-table.el (org-table-eval-formula): Handle localized
time-stamps by internally converting them to english during
formulas evaluation.

Thanks to Viktor Rosenfeld for suggesting this.
2012-12-20 01:36:05 +01:00
Bastien Guerry 15426c6fd0 Merge branch 'maint' 2012-12-20 01:20:21 +01:00
Bastien Guerry fd9b262d94 Fix more compiler warnings.
* org.el (org-clock-timestamps-up): Fix declarations.

* ob-core.el (org-split-string): Declare function.
2012-12-20 01:20:17 +01:00
Bastien Guerry 963ede0a9d Fix some compiler warnings.
* org.el (org-in-fixed-width-region-p): Define before use.

* org-src.el (org-in-src-block-p): Declare function.
2012-12-20 01:16:01 +01:00
Nicolas Goaziou 90de5ee463 ob-core: Fix the #+END_ directive from the :wrap param
* lisp/ob.el: Only use the :wrap argument up to the first space when creating
  the #+END_ directive.

Using an option like ":wrap SRC fundamental" was generating and end marker of
"#+END_SRC fundamental", which caused the new exporter to fail to handle to
block properly.

Patch from Michael Gauland.
2012-12-19 21:16:57 +01:00
Bastien Guerry b63128a312 Merge branch 'maint' 2012-12-19 17:44:08 +01:00
Bastien Guerry 23e2346c4c org-compat.el: Fix bug: don't use eval-when-compile' when aliasing user-error'.
* org-compat.el: Fix bug: don't use `eval-when-compile' when
aliasing `user-error'.

Thanks to Bernt Hansen for reporting this bug.
2012-12-19 17:43:57 +01:00
Achim Gratz c74c62606d Merge branch 'maint' 2012-12-19 15:34:40 +01:00
Achim Gratz b9ea74a195 Backwards compatibility for `user-error´
* lisp/org-compat.el (user-error): Defalias to `error´ for Emacsen
  that don't have it.
2012-12-19 15:33:29 +01:00
Achim Gratz bdc95549dd Backwards compatibility: use compatibility macro
* lisp/org-agenda.el (org-agenda-write): Use
  org-called-interactively-p instead of called-interactively-p.
2012-12-19 15:30:23 +01:00
Achim Gratz ea5e54f93d Merge branch 'maint' 2012-12-19 11:05:17 +01:00
Achim Gratz 9a71174348 Backwards compatibility: check for possibly undefined variables in org-find-invisible-foreground
* lisp/org.el (org-find-invisible-foreground): Do not use the value of
  variables `default-frame-alist´, `initial-frame-alist´ and
  `window-system-default-frame-alist´ when their symbol is not bound.

This avoids an error with Emacs 22, which does not define
`window-system-default-frame-alist´, that prevents the test suite from
even starting, the other variables are treated the same as a defensive
measure.
2012-12-19 11:04:22 +01:00
Bastien Guerry db28a7a0ab Merge branch 'maint' of orgmode.org:org-mode into maint 2012-12-19 00:23:59 +01:00
Bastien Guerry 77a6acff0b Merge branch 'master' of orgmode.org:org-mode 2012-12-19 00:23:46 +01:00
Bastien Guerry 57e0814ac0 Merge branch 'maint' 2012-12-19 00:23:39 +01:00
Bastien Guerry 1c57cd5a7d org-agenda.el (org-agenda-skip): Only check if point is inside a code block, not at a code block.
* org-agenda.el (org-agenda-skip): Only check if point is
inside a code block, not at a code block.

Thanks to Eric Fraga for reporting this problem.
2012-12-19 00:23:30 +01:00
Nicolas Goaziou bc4351ce0d org-element: Fix parsing of links expanded from an abbreviation
* lisp/org-element.el (org-element-object-variables): New variable.
(org-element-parse-secondary-string): Copy some buffer-local variables
to the temporary buffer created to parse the string so links can still
be properly expanded.
(org-element-link-parser): Link expansion and translation are applied
transparently for the parser.
2012-12-18 21:59:05 +01:00
Nicolas Goaziou 76cf2538bb Merge branch 'maint' 2012-12-18 19:33:47 +01:00
Nicolas Goaziou 7739e8b5f7 Small refactoring
* lisp/org.el (org-fill-paragraph): Small refactoring.
2012-12-18 19:32:50 +01:00
Ingo Lohmar 0f3264f690 org-agenda.el: Use `org-todo-keyword-faces' to highlight selected TODO keywords.
* org-agenda.el
(org-agenda-propertize-selected-todo-keywords): New function
to highlight the current agenda todo keywords depending on
`org-todo-keyword-faces'.
(org-todo-list): Use the new function.

TINYCHANGE
2012-12-18 18:47:49 +01:00
Bastien Guerry 0db5f28dd4 org-html.el and org-e-html.el: Add CSS classes to list tags.
* org-html.el (org-html-export-list-line): Add CSS classes to
these list HTML tags: <ul> <dl> and <ol>.

* contrib/lisp/org-e-html.el (org-e-html-begin-plain-list): Add
CSS classes to these list HTML tags: <ul> <dl> and <ol>.
2012-12-18 18:38:20 +01:00
Bastien Guerry bbb451a7b6 Merge branch 'maint' 2012-12-18 15:09:54 +01:00
Bastien Guerry 374efdd63e org.el (org-in-fixed-width-region-p): Rewrite using org-element.el.
* org.el (org-in-fixed-width-region-p): Rewrite using
org-element.el.

Thanks to Nicolas Goaziou for suggesting this.
2012-12-18 15:09:40 +01:00
Bastien Guerry 4996e5bd8e Merge branch 'maint' 2012-12-18 15:04:43 +01:00
Bastien Guerry 9d4dd69b30 org.el (org-fill-paragraph): Fill correctly in source code block.
* org.el (org-fill-paragraph): Fill correctly in source code
block.

Thanks to Sébastien Vauban for reporting this.
2012-12-18 12:49:49 +01:00
Bastien Guerry 1af0b39c01 Allow C-S-<up/down> to sync update clock timestamps by several units.
* org-clock.el (org-clock-timestamps-up)
(org-clock-timestamps-down, org-clock-timestamps-change): Add
an optional argument N to change timestamps by several units.

* org.el (org-shiftcontrolup, org-shiftcontroldown): Ditto.

Thanks to Rainer Stengele for this idea.
2012-12-18 12:16:20 +01:00
Achim Gratz 709bf92950 Backwards compatibility for `user-error´
* lisp/org-compat.el (user-error): Defalias to `error´ for Emacsen
  that don't have it.
2012-12-17 19:08:12 +01:00
Nicolas Goaziou 442b2ad15d Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2012-12-16 00:49:22 +01:00
Nicolas Goaziou 20839ced71 org-element: Fix parsing of a list in a block in a list
* lisp/org-element.el (org-element--parse-elements,
  org-element-at-point): Fix parsing of a list in a block in a list.
* testing/lisp/test-org-element.el: Add test.
2012-12-16 00:45:17 +01:00
Eric Schulte 458824493d Revert "tangled files should not be writable"
This reverts commit 5e3b8259c7.
2012-12-15 15:14:01 -07:00
Bastien Guerry db51b80d2b Merge branch 'maint' 2012-12-14 10:34:49 +01:00
Bastien Guerry df099175e7 org.el (org-edit-special): Fix bug about editing special environments.
* org.el (org-in-fixed-width-region-p): New function.
(org-edit-special): Fix bug: make sure to DTRT in every
special environment.  Also use the new function to check
against fixed-width environment.

Thanks to Bernt Hansen for reporting a bug in this area.
2012-12-14 10:30:16 +01:00
Bastien Guerry 81d5ebce8d org-src.el (org-edit-src-code): Check if we are in a source code block with `org-in-src-block-p'.
* org-src.el (org-edit-src-code): Check if we are in a source
code block with `org-in-src-block-p'.  Slightly reformat the
docstring.
2012-12-14 10:10:40 +01:00
Bastien Guerry a7afe7df1a org.el (org-in-src-block-p): Return t when on #+BEGIN|END_SRC lines.
* org.el (org-in-src-block-p): Return t when point is at the
#+BEGIN_SRC/#+END_SRC lines unless the new optional parameter
'inside is set to t.
2012-12-14 10:02:25 +01:00
Bastien Guerry 2c164be668 Merge branch 'maint' 2012-12-13 23:47:17 +01:00
Michael Gauland 4524a02b39 Edit source: fix 'end' initialisation
* org-src.el: Create a marker to pass to copy-marker.

This fixes a 'wrong type argument' error when running
org-edit-src-code (observed on Emacs 23.2.1).

The problem was that copy-marker expects a marker, and it was given
nil. This change gives it a marker that doesn't point anywhere, but
still lets us set the insertion type of the end marker.

TINYCHANGE
2012-12-13 23:47:07 +01:00
Bastien Guerry 22e4a4ecb9 Revert "org-src.el (org-edit-src-code): Fix bug on Emacs <24.1."
This reverts commit 7a770c10c1.
2012-12-13 23:45:55 +01:00
Bastien Guerry 26d24900e1 Merge branch 'maint' 2012-12-13 17:37:04 +01:00
Bastien Guerry 0584dffefe ob-exp.el (obe-marker): Delete useless var.
* ob-exp.el (obe-marker): Delete useless var.
2012-12-13 17:36:52 +01:00
Bastien Guerry 22ee29b5ef Merge branch 'maint' 2012-12-13 17:04:48 +01:00
Bastien Guerry 7a770c10c1 org-src.el (org-edit-src-code): Fix bug on Emacs <24.1.
* org-src.el (org-edit-src-code): Fix bug triggered by the
sexp (copy-marker nil) on Emacs <24.1.

Thanks to Bernt Hansen for reporting this.
2012-12-13 17:04:38 +01:00
Bastien Guerry 8c04fb72cb org-exp.el (org-export-copy-to-kill-ring): Add a new choice 'if-interactive and use it as the default.
* org-exp.el (org-export-copy-to-kill-ring): Add a new choice
'if-interactive and use it as the default.
(org-export-push-to-kill-ring): Use the new choice.
2012-12-13 00:38:46 +01:00
Nicolas Goaziou 6e37a4d114 org-element: Fix line break parsing
* lisp/org-element.el (org-element-line-break-parser): Line break
  includes the newline character following the backslashes.
(org-element-line-break-interpreter): Apply changes to line break
parsing.
2012-12-12 22:47:12 +01:00
Eric Schulte 2c34715ae6 option to byte-compile elisp loaded from Org files
* lisp/ob-tangle.el (org-babel-load-file): When called with a prefix
  argument the tangled emacs-lisp file will be byte compiled.
2012-12-12 10:48:57 -07:00
Eric Schulte 5e3b8259c7 tangled files should not be writable
Hopefully this will help keep people from editing tangled source files
  by accident.

* lisp/ob-tangle.el (org-babel-tangle): Tangled files should not be
  writable.
2012-12-12 10:48:57 -07:00
Eric Schulte ff0081847c requiring ob now pulls in all of Babel 2012-12-12 10:48:56 -07:00
Eric Schulte 0694965865 renaming lisp/ob.el to lisp/ob-core.el 2012-12-12 10:48:56 -07:00
Achim Gratz ba59eebb12 ob-python: specify defcustom parameters
* lisp/ob-python.el (org-babel-python-hline-to,
  org-babel-python-None-to): Specify customize group as 'org-babel and
  widget type as 'string.
2012-12-12 10:48:56 -07:00
Achim Gratz 01bf706f7f org-babel: fix bug introduced in commit 78cdf149
* lisp/ob.el (org-babel-result-cond): Macro expansion needs to unquote
  formal parameter `result-params´.
2012-12-12 10:48:56 -07:00
Bastien Guerry cf9838febd org.el: Display the blocking heading when a TODO state change is blocked.
* org.el (org-block-entry-blocking): New variable.
(org-todo): Use it.  Also use `user-error' when a TODO state
change is blocked.
(org-block-todo-from-children-or-siblings-or-parent): Display
`org-block-entry-blocking' in the user-error message.

Thanks to Mirko Vukovic for triggering this change.
2012-12-12 15:59:27 +01:00
Bastien Guerry 1bfea39fd4 Support C-1' prefix for org-agenda-capture' and `org-capture'.
* org.el (org-get-cursor-date): New optional argument
WITH-TIME to add the time of the day.

* org-capture.el (org-capture): When capturing from the agenda
and with a non-nil value for `org-capture-use-agenda-date', a
`C-1' prefix will set the capture time to the HH:MM of the
current line or the current HH:MM.

* org-agenda.el (org-agenda-capture): New optional argument
WITH-TIME: when set to 1, the capture time will be set to the
HH:MM time of the current line, or the current HH:MM time.

From an agenda buffer, C-1 k (i.e. org-agenda-capture) and
C-1 M-x org-capture RET will use the time of the day of the
current line, or the current time of the day.  The date is
not changed by using this prefix.

Thanks to Rene for triggering this change.
2012-12-12 15:21:10 +01:00
Bastien Guerry 275f07c16a Merge branch 'maint' 2012-12-12 13:53:37 +01:00
Bastien Guerry 488eea6d25 org-latex.el: Escape raw path when exporting links to files.
* org-latex.el (org-export-latex-links): Escape raw path when
exporting links to files.

Thanks to John Smith for reporting this.
2012-12-12 10:57:34 +01:00
Bastien Guerry 47ea16660e Merge branch 'maint' 2012-12-12 10:14:59 +01:00
Bastien Guerry 570ecb4e31 org-src.el: Fix bug: the S-TAB key should not trigger a native TAB command.
* org-src.el (org-src-native-tab-command-maybe): Fix bug: the
S-TAB key should not trigger a native TAB command.
2012-12-12 09:09:04 +01:00
Bastien Guerry 20b3d550e0 org.el: Allow to open any link within footnotes definition, not only bracket links.
* org.el (org-open-at-point): Allow to open any link within
footnotes definition, not only bracket links.
2012-12-12 08:42:55 +01:00
Bastien Guerry 5508053d63 Merge branch 'maint' 2012-12-11 18:14:00 +01:00
Bastien Guerry 7f0e7cb9b9 org.el (org-sort-entries): Bugfix: keep track of the clock marker when sorting entries.
* org.el (org-sort-entries): Bugfix: keep track of the clock
marker when sorting entries.  Enhance the docstring.
2012-12-11 18:13:41 +01:00
Bastien Guerry 0c68a27ac9 org-clock.el (org-clock-out): Use `user-error'.
* org-clock.el (org-clock-out): Use `user-error' when the user
tries to clock out while there is no running clock.
2012-12-11 18:11:24 +01:00
Bastien Guerry c3a0dc11a3 org-table.el: Ensure table coordinates are correctly displayed when sorting.
* org-table.el (org-table-sort-lines): Ensure coordinates are
correctly displayed when sorting.

* org.el (org-do-sort): Enhance prompt.
2012-12-11 17:29:38 +01:00
Bastien Guerry 980e52282d org-agenda.el (org-agenda-finalize): Fix order of link activation.
* org-agenda.el (org-agenda-finalize): Fix order of link
activation.
2012-12-11 17:20:33 +01:00
Bastien Guerry 08e411109e org-agenda.el (org-agenda-finalize): Activate plain links.
* org-agenda.el (org-agenda-finalize): Activate plain links.
2012-12-11 17:08:00 +01:00
Bastien Guerry 57a13ab9d9 org-timer.el (org-timer-stop): Add message.
* org-timer.el (org-timer-stop): Add message.
2012-12-11 16:56:00 +01:00
Bastien Guerry 5d673e890a org-agenda.el (org-agenda-schedule, org-agenda-deadline): Fix redundant messages.
* org-agenda.el (org-agenda-schedule, org-agenda-deadline):
Fix redundant messages.
2012-12-11 16:53:44 +01:00
Bastien Guerry 1a41eeae1d org-agenda.el (org-agenda-finalize): Fix clock highlighting.
* org-agenda.el (org-agenda-finalize): Fix clock highlighting.

Thanks to Rares Pop who reported this.
2012-12-11 16:44:03 +01:00
nrichard (geodiff-mac3) 2f9ddaf699 ob: Fix org-babel-edit-distance for insertion/deletion
* lisp/ob.el (org-babel-edit-distance): When insertion or deletion are
  needed, make sure the distance is incremented.  In addition, the now
  obsolete mmin function was removed.
2012-12-07 12:41:53 -07:00
Nicolas Goaziou 31052f1c91 Fix radio targets detection
* lisp/org.el (org-all-targets): Fix radio targets detection when
  object is directly followed by a non-whitespace character.

* testing/lisp/test-org.el: Add test.
2012-12-04 23:50:26 +01:00
Bastien Guerry 6c82226406 org.el (org-latex-preview-ltxpng-directory): Fix docstring formatting.
* org.el (org-latex-preview-ltxpng-directory): Fix docstring
formatting.
2012-12-04 15:56:38 +01:00
Ivan Vilata i Balaguer 513507ee74 Allow relative times in clocktable tstart and tend options
* lisp/org-clock.el (org-clock-get-table-data): Pass tstart and tend
time strings through `org-matcher-time' to allow relative times besides
absolute ones, convert result to encoded time.
* doc/org.texi (The clock table): Document acceptance of relative times
in tstart and tend, link to syntax description and provide example.

Inspired in the original relative times proposal by Ilya Shlyakhter,
this is less invasive and it doesn't modify core functions, thus it
avoids the original's infinite recursion when hitting normal dates in
other locations.

TINYCHANGE
2012-11-30 16:07:13 +01:00
Le Wang 8d22b11978 org-src: Fix org-edit-src-code for empty blocks and block with just an empty line
* lisp/org-src.el (org-edit-src-code): Use marker with insertion type
t to track end and remove hack requiring delete from beg to (1- end).
2012-11-30 14:19:27 +01:00
Le Wang 206257aa7e org-src: Fix org-edit-src-code for empty blocks and block with just an empty line
* lisp/org-src.el (org-edit-src-code): Use marker with insertion type
t to track end and remove hack requiring delete from beg to (1- end).
2012-11-30 14:11:27 +01:00
Nicolas Goaziou 8783b89311 ob: Rename *org-babel-use-quick-and-dirty-noweb-expansion*
* lisp/ob.el (org-babel-use-quick-and-dirty-noweb-expansion): Renamed
  from *org-babel-use-quick-and-dirty-noweb-expansion*.
(org-babel-expand-noweb-references): Use new variable name.

This patch brings back the variable in the expected namespace.
2012-11-30 13:58:31 +01:00
John Foerch a3490b140d org-store-log-note: access org-log-note-headings in org buffer
This change allows org-mode to respect a buffer-local value of
org-log-note-headings, by accessing its value in the org buffer
instead of in the "*Org Note*" buffer.
2012-11-25 19:45:45 +01:00
Nicolas Goaziou a51b8fa308 org-element: Fix timestamp interpreter
* lisp/org-element.el (org-element-timestamp-interpreter): Fix
  timestamp interpreter when raw value isn't available.
* testing/lisp/test-org-element.el: Update test.
2012-11-25 01:16:39 +01:00
Nicolas Goaziou 2f4c85e6b4 ob-exp: Repair inline code evaluation after last commit.
* lisp/ob-exp.el (org-babel-exp-non-block-elements): Make sure to
  parse inline babel call or inline src block instead of the following
  object.
2012-11-24 22:30:06 +01:00
Nicolas Goaziou ce8819f18d Merge branch 'maint' 2012-11-23 23:49:19 +01:00
Nicolas Goaziou 89b8a8ca6d org-element: Fix `org-element-context'
* lisp/org-element.el (org-element-context): When point is between two
  objects, be sure to return the second one.
* testing/lisp/test-org-element.el: Add test.
2012-11-23 23:46:52 +01:00
Nicolas Goaziou cb32494e24 org-element: Timestamp with time range has active/inactive-range type
* lisp/org-element.el (org-element-timestamp-parser): Timestamp with
  time range has active/inactive-range type.
* testing/lisp/test-org-element.el: Add test.

In order to know if starting date/time is really the same as ending
date/time, this patch permits to use the following:

  (memq (org-element-property :type timestamp) '(active inactive))
2012-11-22 22:32:48 +01:00
Toby S. Cubitt 6d01be052d Fix org-minutes-to-clocksum-string to cope with floating point arguments. 2012-11-20 20:22:59 +01:00
Nicolas Goaziou c3407d3c98 org-element: Do not reset `org-element-block-name-alist' at each reload
* lisp/org-element.el (org-element-block-name-alist): Do not reset
`org-element-block-name-alist' at each reload.
2012-11-19 22:57:17 +01:00
Nicolas Goaziou 807e4af09c org-element: Allow timestamps in parsed keywords (i.e. DATE)
* lisp/org-element.el (org-element-object-restrictions): Allow
  timestamps in parsed keywords (i.e. DATE).
2012-11-19 21:53:58 +01:00
Eric Schulte f8a69a4250 passing as many tests as before
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Better about
  when to fully escape the results or just print them close to verbatim.
2012-11-18 22:06:12 -07:00
Eric Schulte 78cdf14939 org-babel-result-cond - unified handling of results
* lisp/ob.el (org-babel-result-cond): This function should now be used
  by all language backends to handle the processing of raw code block
  output into scalar results, table results, or ignored results
  depending on the value of result-params.

* lisp/ob-C.el (org-babel-C-execute): Use org-babel-result-cond.
* lisp/ob-R.el (org-babel-R-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-R-evaluate-session): Use org-babel-result-cond.
* lisp/ob-awk.el (org-babel-execute:awk): Use org-babel-result-cond.
* lisp/ob-clojure.el (org-babel-execute:clojure): Use
  org-babel-result-cond.
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Use
  org-babel-result-cond.
* lisp/ob-fortran.el (org-babel-execute:fortran): Use
  org-babel-result-cond.
* lisp/ob-io.el (org-babel-io-evaluate): Use org-babel-result-cond.
* lisp/ob-java.el (org-babel-execute:java): Use org-babel-result-cond.
* lisp/ob-lisp.el (org-babel-execute:lisp): Use org-babel-result-cond.
* lisp/ob-maxima.el (org-babel-execute:maxima): Use
  org-babel-result-cond.
* lisp/ob-picolisp.el (org-babel-execute:picolisp): Use
  org-babel-result-cond.
* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-python-evaluate-session): Use org-babel-result-cond.
* lisp/ob-scala.el (org-babel-scala-evaluate): Use org-babel-result-cond.
* lisp/ob-sh.el (org-babel-sh-evaluate): Use org-babel-result-cond.
* lisp/ob-shen.el (org-babel-execute:shen): Use org-babel-result-cond.
* lisp/ob-sql.el (org-babel-execute:sql): Use org-babel-result-cond.
* lisp/ob-sqlite.el (org-babel-execute:sqlite): Use
  org-babel-result-cond.
2012-11-18 21:58:38 -07:00
Eric Schulte c2223c8979 still execute code block even if :results none
* lisp/ob.el (org-babel-execute-src-block): Fixed bug introduced in
  d4b739f.
2012-11-17 17:54:08 -07:00
Eric Schulte d4b739fbf2 "none" header avoids result post-process
This patch introduces a new header argument which hide all code block
results from Emacs so that they are not processed into Emacs-lisp
objects; a process which may take a great deal of time for large
objects.

* lisp/ob.el (org-babel-common-header-args-w-values): Adding the new
  "none" header argument.
  (org-babel-execute-src-block): Don't do *any* result processing if the
  "none" header argument has been specified.
  (org-babel-sha1-hash): Remove the none header argument from
  header arg lists when calculating cache sums.
  (org-babel-insert-result): Flesh out some documentation.
2012-11-17 10:08:45 -07:00
Nicolas Goaziou 4c7dcd0830 Silence byte compiler
* contrib/lisp/org-invoice.el (org-invoice-info-to-table,
  org-invoice-list-to-table): Silence byte compiler.
* lisp/org-agenda.el (org-agenda-show-clocking-issues,
  org-agenda-format-item): Silence byte compiler.
* lisp/org-colview-xemacs.el (org-agenda-columns): Silence byte
  compiler.
* lisp/org-colview.el (org-agenda-columns): Silence byte compiler.
* lisp/org.el (org-properties-postprocess-alist): Silence byte
  compiler.

Function renaming was necessary as of
a00a7b2918.
2012-11-17 15:51:26 +01:00
Toby S. Cubitt a00a7b2918 Allow more flexible customization of clocksum format
* lisp/org.el (org-time-clocksum-format, org-time-clocksum-fractional-format):
in addition to a single format string, the clocksum formats can now be
plists specifying separate formats for different time units.

* lisp/org.el (org-minutes-to-clocksum-string): new function to
replace org-minutes-to-hh:mm-string, which converts a number of
minutes to a string according to the customization options.

* lisp/org-colview.el (org-columns-number-to-string): use new
org-minutes-to-clocksum-string function to format clocksum durations.

* lisp/org-clock.el: always call new org-minutes-to-clocksum-string
function when formatting time durations, instead of calling
org-minutes-to-hh:mm-string or passing org-time-clocksum-format
directly to format.
2012-11-17 15:39:07 +01:00
Christophe Junke 60abb38ee3 Change fontification order for links
* lisp/org.el (org-set-font-lock-defaults): let footnote fontifications
  be done before other links' fontification. This allows links appearing
  inside footnotes to be both visible and active.

TINYCHANGE
2012-11-16 18:19:47 +01:00
Nicolas Goaziou b46b5d1c44 org-element: Return nil for unspecified time values
* lisp/org-element.el (org-element-timestamp-parser): Return nil for
  unspecified :hour-end and :minute-end properties.
* testing/lisp/test-org-element.el: Add tests.
2012-11-15 21:02:26 +01:00
Nicolas Goaziou 0421be2cee Merge branch 'maint' 2012-11-13 15:46:33 +01:00
Nicolas Goaziou 5dbccdb432 org-list: Fix infloop when inserting an item
* lisp/org-list.el (org-list-separating-blank-lines-number): When
  computing number of blank lines separating items, also count those
  in unparsed blocks, like example blocks.
* testing/lisp/test-org-list.el: Add tests.

In the following situation, with `org-blank-before-new-entry' set to
`auto' for `plain-list-item, a blank line should be inserted when
inserting the following item:

- item1
  #+BEGIN_EXAMPLE

  contents

  #+END_EXAMPLE
2012-11-13 15:45:09 +01:00
Nicolas Goaziou 6d099eedc8 org-element: Allow footnote references in table cells
* lisp/org-element.el (org-element-object-restrictions): Add footnote
  references objects in table cells.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference,
  org-e-latex-table): Add support for footnote reference in table
  cells.
2012-11-12 21:14:43 +01:00
Nicolas Goaziou c40a0dbd38 org-element: Clear text properties when interpreting a string
* lisp/org-element.el (org-element-interpret-data): Clear text
  properties when interpreting a string .
2012-11-11 23:47:34 +01:00
Nicolas Goaziou 94605246e5 Merge branch 'maint' 2012-11-09 02:47:23 +01:00
Toby S. Cubitt 2aeb28d2af Bug fix in org-beginning-of-line visual line motion
* lisp/org.el (org-beginning-of-line): check `visual-line-mode'
instead of `line-visual-mode' to determine whether to move by visual
lines.

* lisp/org.el (org-kill-line): use of org-bound-and-true-p macro.

* testing/lisp/test-org.el: Add test
2012-11-09 02:46:21 +01:00
Achim Gratz c149e04ade Merge branch 'maint' 2012-11-07 18:45:25 +01:00
Achim Gratz ca5d5e9c9b Makefile: fix a bug with ORG_ADD_CONTRIB
* lisp/Makefile: The added files from contrib need to be known before
  LISPF is constructed.  Also, make all variables simply defined to
  avoid recursive evaluation.
2012-11-07 18:44:20 +01:00
Eric Schulte c2ebeea6f6 fix bug in drawer results (should not escape)
* lisp/ob.el (org-babel-insert-result): Don't escape results in drawers.
2012-11-06 06:20:43 -07:00
Nicolas Goaziou 854ddf635c Merge branch 'maint' 2012-11-05 17:40:48 +01:00
Nicolas Goaziou c20730be9a Fix `org-end-of-line' behaviour in visual line mode
* lisp/org.el (org-end-of-line): When visual line mode is on, really
  move by visual lines.  Small refactoring.
2012-11-05 17:39:06 +01:00
Nicolas Goaziou d94a0bcd61 org-capture: Fix docstring
* lisp/org-capture.el (org-capture--expand-keyword-in-embedded-elisp):
  Fix docstring.
2012-11-05 13:38:18 +01:00
Nicolas Goaziou 6e31cf5a1e Merge branch 'maint' 2012-11-05 09:51:02 +01:00
Rafael Laboissiere 209afadbf9 org-bibtex.el: Fix broken URL
* lisp/org-bibtex.el: In the documentation section of the file, fix
  the broken URL to Andrew Roberts' document on BibTeX entries.

TINYCHANGE
2012-11-05 09:50:04 +01:00
Ryo TAKAISHI fb143b6787 org-capture: Expand keywords within %(sexp) placeholder in template
* lisp/org-capture.el: (org-capture--expand-keyword-in-embedded-elisp): New function.
(org-capture-expand-embedded-elisp): Use new function.
2012-11-05 01:29:25 +01:00
Nicolas Goaziou 5acffad561 Merge branch 'maint' 2012-11-05 00:58:34 +01:00
Nicolas Goaziou f48a8b7bf8 Fix end of line function called on an hidden block
* lisp/org.el (org-end-of-line): On a hidden block make sure to
  delegate motion to `end-of-line' instead of `move-end-of-line' in
  order to stay on the current line.
* testing/lisp/test-org.el: Update test.
2012-11-05 00:57:56 +01:00
Eric Schulte 32a6bae7c0 better hline and None translations in ob-python
* lisp/ob-python.el (org-babel-python-hline-to): Customize hline
  conversion to python.
  (org-babel-python-None-to): Customize none conversion from python.
  (org-babel-python-var-to-python): Use new variable.
  (org-babel-python-table-or-string): Use new variable.
2012-10-30 18:04:50 -06:00
Nicolas Goaziou 3ea9372860 Fix error when filling items
* lisp/org.el (org-adaptive-fill-function): Items do not have
  a :post-affiliated property. Use :begin property instead.

This patch follows 86f2731125.
2012-10-30 18:38:39 +01:00
Nicolas Goaziou 5e30d4fa4e org-element: Remove :clockedp property from headlines and inlinetasks
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): Remove :clockedp property.

This property isn't even remotely related to the structure of the
document and, as such, doesn't belong to Org element.
2012-10-30 13:13:47 +01:00
Nicolas Goaziou 86f2731125 Fix error when auto filling
* lisp/org.el (org-adaptive-fill-function): All elements do not have
  a :post-affiliated property.
2012-10-30 13:05:56 +01:00
Nicolas Goaziou 6290da183c Signal an error when a circular macro expansion happens
* lisp/org.el (org-macro-replace-all): Signal an error when a circular
  macro expansion happens.
(org-macro-initialize-templates): Fix docstring.
* testing/lisp/test-org.el: Add test.
2012-10-30 09:24:55 +01:00
Nicolas Goaziou 1f3a2c42c6 org-element, org-export: Fix documentation typos
* contrib/lisp/org-export.el (org-export--get-subtree-options): Fix
  code comment.
* lisp/org-element.el (org-element-map): Fix docstring.
2012-10-29 21:57:46 +01:00
Nicolas Goaziou c7f4a9ebad org-element: Fix accessors and setters wrt secondary strings
* lisp/org-element.el (org-element-contents, org-element-set-contents,
  org-element-adopt-elements): Fix accessors and setters wrt secondary
  strings.
2012-10-29 19:03:54 +01:00
Nicolas Goaziou 07c8895705 org-element: Fix void-function org-clocking-buffer error
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): Fix void-function
  org-clocking-buffer error.
2012-10-29 16:26:34 +01:00
Nicolas Goaziou 2e8591783f org-element: Fix org-element-context on parsed keywords
* lisp/org-element.el (org-element-context): Fix org-element-context
  on parsed keywords.
* testing/lisp/test-org-element.el: Update test.
2012-10-29 14:01:49 +01:00
Nicolas Goaziou 99110c60a6 org-element: Find objects in document and parsed affiliated keywords
* lisp/org-element.el (org-element-context): Find objects in document
  and parsable affiliated keywords.
* testing/lisp/test-org-element.el: Add tests.
2012-10-29 11:09:41 +01:00
Nicolas Goaziou 89ec3f1abf org-element: Add `:post-affiliated' property to elements when applicable
* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-parser, org-element-dynamic-block-parser,
  org-element-footnote-definition-parser,
  org-element-plain-list-parser, org-element-property-drawer-parser,
  org-element-quote-block-parser, org-element-special-block-parser,
  org-element-babel-call-parser, org-element-comment-parser,
  org-element-comment-block-parser, org-element-diary-sexp-parser,
  org-element-example-block-parser, org-element-export-block-parser,
  org-element-fixed-width-parser, org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element-latex-environment-parser,
  org-element-paragraph-parser, org-element-src-block-parser,
  org-element-table-parser, org-element-verse-block-parser): Add
  `:post-affiliated' property to elements.
(org-element-inlinetask-parser): Remove affilated keywords.
* lisp/org.el (org-adaptive-fill-function): Use new property.

This property is cheap to compute during parsing and allows to
determine if point is on an affiliated keyword or not by checking if
it is between :begin and :post-affiliated positions.
2012-10-29 11:02:06 +01:00
Bastien Guerry 0513f11b16 Merge branch 'maint' 2012-10-29 07:41:29 +01:00
Le Wang d22e732d7a org-src.el (org-edit-src-exit): Fix editing source section with blank lines
* org-src.el (org-edit-src-exit): Fix editing source section
with blank lines.

TINYCHANGE

This bug was introduced by commit aba9e2b9.
2012-10-29 06:37:41 +01:00
Rafael Laboissiere d0dd2a5308 org-remember.el: Correctly strip the comment lines in remember buffer
* org-remember.el (org-remember-handler): Correctly strip the comment lines
  in the temporary buffer *Remember* when handling a remember note.

TINYCHANGE
2012-10-29 06:30:14 +01:00
Nicolas Goaziou 98d5666bac org-element: Allow duals keywords with only secondary value
* lisp/org-element.el (org-element--collect-affiliated-keywords):
  Allow duals keywords with only secondary value.
* testing/lisp/test-org-element.el: Add test.

This patch allows to parse correctly the following:

    #+CAPTION[short caption]:
    #+CAPTION: Very long caption
    Some paragraph.
2012-10-28 22:45:34 +01:00
Nicolas Goaziou c1e3aaece3 org-element: Improve timestamps parsing
* lisp/org-element.el (org-element-timestamp-parser): Modify timestamp
  objects properties.
(org-element-headline-parser, org-element-inlinetask-parser): Remove
`:timestamp' and `:clock' property.  Add `:clockedp' property.  Also,
set `:closed', `:deadline' and `:scheduled' values to timestamp
objects, not strings.  Small refactoring.
(org-element-clock-parser): Rename `:time' property into `:duration'.
Also, set `:value' value as a timestamp object, not a string.
(org-element-planning-parser): Set `:closed', `:deadline' and
`:scheduled' values to timestamp objects, not strings.
(org-element-clock-interpreter, org-element-planning-interpreter)
(org-element-timestamp-interpreter): Update interpreters.
(org-element--current-element): Tiny refactoring.
* testing/lisp/test-org-element.el: Add tests.
2012-10-28 16:29:55 +01:00
Nicolas Goaziou 2f2a80fe06 ob: Fix block evaluation in a narrowed buffer
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
  keyword in current narrowed part of buffer, if necessary. Small
  refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted.  Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el
2012-10-28 16:21:30 +01:00
Nicolas Goaziou a729fae0f7 org-agenda: Tiny stylistic change
* lisp/org-agenda.el (org-agenda-get-deadlines): Tiny stylistic
  change.
2012-10-28 13:53:29 +01:00
Bastien Guerry a4660d4790 org.el (org-additional-option-like-keywords): Add "INDEX:"
* org.el (org-additional-option-like-keywords): Add "INDEX:".
2012-10-28 11:39:01 +01:00
Justus Piater 796fca3f18 org-agenda: New option: skip deadline prewarning if scheduled in the future
* lisp/org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled):
  Add an option to skip the deadline prewarning if the scheduled date is
  in the future.
2012-10-28 11:13:53 +01:00
Bastien Guerry 53a7683fd7 Merge branch 'maint' 2012-10-28 11:10:44 +01:00
Rafael Laboissiere f9e89cb849 org-remember.el: Start the commented lines with the appropriate characters
* org-remember.el (org-remember-apply-template): Start the commented
  lines in the Remember temporary buffer with the appropriate
  characters.

TINYCHANGE
2012-10-28 11:10:28 +01:00
Nicolas Goaziou d81982ae9d org-element: Parse diary-sexp elements
* lisp/org-element.el (org-element-paragraph-separate): Diary-sexp
  elements can separate paragraphs.
(org-element-all-elements): Install new `diary-sexp' type.
(org-element--current-element): Recognize new `diary-sexp' elements.
(org-element-diary-sexp-parser, org-element-diary-sexp-interpreter):
New functions.
* testing/lisp/test-org-element.el: Add tests.
2012-10-27 14:43:30 +02:00
Nicolas Goaziou 1d58b0b2cd org-element: Small refactoring
* lisp/org-element.el (org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element--current-element): Small
  refactoring.
2012-10-27 14:37:18 +02:00
Nicolas Goaziou 95c305490e org-element: Add :parent text property to strings in parse tree
* lisp/org-element.el (org-element-property): Access to text
  properties when argument is a string.
(org-element-put-property): Correctly set property when target is
a string.
(org-element-adopt-elements): Also put :parent properties on strings.
* testing/lisp/test-org-element.el: Add test.
2012-10-27 11:42:30 +02:00
Bastien Guerry 7221b88f6d Merge branch 'maint' 2012-10-27 09:39:12 +02:00
Erik Hetzner dda453eb7e org.el (org-log-into-drawer): Honor the nil value for the :LOG_INTO_DRAWER: property.
* org.el (org-log-into-drawer): Honor the nil value for the
:LOG_INTO_DRAWER: property.

TINYCHANGE
2012-10-27 09:37:54 +02:00
Bastien Guerry b0eeb260ef Merge branch 'maint' 2012-10-27 09:25:18 +02:00
Bastien Guerry b1f20bde27 org-install.el: Enhance warning
* org-install.el: Enhance warning.

Thanks to Simon Thum for requesting this.
2012-10-27 09:25:14 +02:00
Bastien Guerry 8866f86624 Merge branch 'maint' 2012-10-26 15:12:02 +02:00
Bastien Guerry 7a9d345707 Remove the obsolete argument hidden' from org-export-as-latex'.
* org-latex.el (org-export-as-latex): Remove obsolete argument
`hidden'.  Also fix the docstring: using 'string as the value
for `to-buffer' outputs a string with no LaTeX header.
(org-export-as-latex-batch)
(org-export-as-latex-to-buffer, org-export-region-as-latex)
(org-export-as-pdf): Don't use the obsoleted argument.

* ob-haskell.el (org-export-as-latex): Don't use the obsoleted
argument `hidden'.
2012-10-26 15:05:10 +02:00
Bastien Guerry 116c09053f Run bookmark-set' within with-demoted-errors'.
* org.el (org-refile): Run within `with-demoted-errors' so
that a corrupted bookmark file does not stop the refile
process.

* org-capture.el (org-capture-bookmark-last-stored-position):
Ditto for the capture process.

Note: we do not prevent such errors in org-remember.el as this
libary will be obsoleted for the next major release of Org.
2012-10-26 14:55:08 +02:00
Myles English db8e06147a Clocking: Move to task before calling org-clock-in-prepare-hook
* lisp/org-clock.el (org-clock-in): Moved the call to
org-clock-in-prepare-hook until the task's properties
can be accessed.

The problem was when using a function to add an effort
property via the hook, it would not recognise an existing
effort property when called with the prefix (C-u C-c C-x C-i)
with the point at a place other than at the task.

TINYCHANGE
2012-10-26 14:47:23 +02:00
Toby S. Cubitt 58551f1e5f Fix bug in org-agenda-diary-sexp-prefix
* lisp/org-agenda.el (org-agenda-get-sexps): Reset `extra' to nil at
beginning of re-search-forward loop, otherwise next iteration picks up
`extra' value from previous entry.
2012-10-26 14:46:24 +02:00
Achim Gratz b5aded108d Merge branch 'maint' 2012-10-26 08:18:59 +02:00
Achim Gratz 73cfba486b ob-ditaa: needs to require org-compat for org-find-library-dir
* lisp/ob-ditaa.el: Needs to (require 'org-compat) for org-find-library-dir.
2012-10-26 08:18:07 +02:00
Nicolas Goaziou 78c5838e4e ob-exp: Escape code when re-creating a src blocks
* lisp/ob-exp.el (org-babel-exp-code): Escape code when re-creating
  a src blocks.
2012-10-25 16:24:48 +02:00
Bastien Guerry 44ad106d69 Merge branch 'maint' 2012-10-25 10:56:47 +02:00
Caio Tiago Oliveira de7766f4b0 Babel: add results value support to Scala
* lisp/ob-scala.el (org-babel-scala-wrapper-method): Use a Scala
block enclosing the submitted code.

The string representing an well formed block was not an Scala code. I
put the string from the user into an block, surrounded by an call to
replace the default output stream.

TINYCHANGE
2012-10-25 10:56:24 +02:00
Bastien Guerry 5c171435ba Merge branch 'maint' 2012-10-25 10:49:35 +02:00
Bastien Guerry aba9e2b94d org-src.el (org-edit-src-exit): Fix bug when saving an empty source buffer
* org-src.el (org-edit-src-exit): Fix bug when saving an empty
source buffer.

Thanks to Hsiu-Khuern Tang for reporting this.
2012-10-25 10:48:33 +02:00
Bastien Guerry 53f7880d6f Merge branch 'maint' 2012-10-24 15:56:11 +02:00
Bastien Guerry c3390982cb org-lparse.el (org-lparse): Fix bug by returning the output of `org-do-lparse'.
* org-lparse.el (org-lparse): Fix bug by returning the output
of `org-do-lparse'.

Thanks to Jambunathan for reporting this.
2012-10-24 15:55:59 +02:00
Jarmo Hurri e375cfd834 Table lookup functions
* lisp/org-table.el: added macro org-define-lookup-function and the
calls to this macro that generate the lookup functions
org-lookup-first, org-lookup-last and org-lookup-all
* doc/org.texi: documented lookup functions
2012-10-24 14:59:33 +02:00
Bastien Guerry 1886af4337 Merge branch 'maint'
Conflicts:
	lisp/org.el
2012-10-24 12:49:30 +02:00
Bastien Guerry 1fc41ca61e org.el: Add more explicit errors. Fix some declarations and one autoload.
* org.el (org-refile-check-position): Throw an error when the
refile target is the current buffer and is not a file.
(org-agenda-file-to-front, org-remove-file): Throw an error
when the current buffer is not a file.
(org-check-agenda-file): Enhance the message.
(org-element-type): Autoload.
(org-element-context, org-element-paragraph-parser): Don't
declare as these two functions are not used in org.el.
2012-10-24 12:45:08 +02:00
Bastien Guerry b714a09af2 org-lparse.el (browse-url-file-url): Declare.
* org-lparse.el (browse-url-file-url): Declare.
2012-10-24 12:44:22 +02:00
Bastien Guerry d65f5c9298 org.el (org-refile-check-position): Fix typo in docstring.
* org.el (org-refile-check-position): Fix typo in docstring.
2012-10-24 12:23:08 +02:00
Bastien Guerry 886e4f56e5 Merge branch 'maint' 2012-10-24 11:21:48 +02:00
Bastien Guerry facb889b19 Use "mode-line" instead of "modeline".
* org-clock.el (org-clock-modeline-total): Make obsolete.
(org-clock-mode-line-total): Rename from
`org-clock-modeline-total'.
(org-clock-get-sum-start): Fix references to
`org-clock-modeline-total'.

* org-faces.el (org-agenda-filter-tags)
(org-agenda-filter-category, mode-line): Use the 'mode-line
face instead of the obsolete 'modeline.

Thanks to Brendan Halpin for reporting this.
2012-10-24 11:21:44 +02:00
Nicolas Goaziou 866d28d48e ob-exp: Fix small bug
* lisp/ob-exp.el (org-export-blocks-preprocess): Pos can sometimes be
  set to a value greater than start, because of indentation, and lead
  to a search bound error.
2012-10-23 22:27:58 +02:00
Bastien Guerry 2608bed9ea Merge branch 'maint' 2012-10-23 18:41:45 +02:00
Bastien Guerry 93b0934d12 Fix typos fixed in Emacs (part 2)
Thanks to Paul Eggert for the fixes:
http://lists.gnu.org/archive/html/emacs-diffs/2012-10/msg00069.html
2012-10-23 18:41:33 +02:00
Bastien Guerry 47486f4b90 Merge branch 'maint' 2012-10-23 18:39:32 +02:00
Bastien Guerry 95ca977411 Fix typos fixed in Emacs (part 1)
Thanks to Paul Eggert for the fixes:
http://lists.gnu.org/archive/html/emacs-diffs/2012-10/msg00069.html
2012-10-23 18:39:20 +02:00
Nicolas Goaziou 4dead66693 ob-exp: Remove comma-escaping special rule for Org blocks
* lisp/ob-exp.el (org-babel-exp-code): Remove comma-escaping special
  rule for Org blocks.
2012-10-22 19:23:05 +02:00
John Wiegley 09e3a24a2f Support using git-annex with Org attachments 2012-10-20 15:00:49 -04:00
Nicolas Goaziou bef53d7f67 Merge branch 'maint' 2012-10-20 11:59:07 +02:00
Nicolas Goaziou 93040f4671 Fix auto filling in a paragraph directly following a comment
* lisp/org.el (org-auto-fill-function): Make sure `adaptive-fill-mode'
  mode is nil when pre-computed `fill-prefix' is the empty string.
  Otherwise filling functions from fill.el think it has to be computed
  again and overwrite it.
2012-10-20 11:58:16 +02:00
Eric Schulte 6f7e92bdb6 adding ob-makefile to `org-babel-load-languages'
* lisp/org.el (org-babel-load-languages): Adding ob-makefile to
  `org-babel-load-languages'.
2012-10-17 15:07:58 -06:00
Thomas Dye 9b727c7554 * lisp/ob-makefile.el: Org-babel support for Makefile tangling. 2012-10-17 15:07:40 -06:00
Achim Gratz 4d6165b106 org-reload: don't report an error for features found in load-path
* lisp/org.el (org-reload): Remove babel-dir, since it would always
  coincide with org-dir.  Features found in load-path are not reported
  as a (possible) error, but keep a list of these to issue a message
  that the actual location may need checking.
2012-10-17 20:27:49 +02:00
Nicolas Goaziou 10f1c32f6d Merge branch 'maint' 2012-10-17 17:22:58 +02:00
Nicolas Goaziou 92199873c5 Fix bug related to agenda bulding with hour repeaters
* lisp/org.el: Make `org-closest-date' aware of hours repeaters.
2012-10-17 17:21:18 +02:00
Nicolas Goaziou 94232ab5c6 Merge branch 'maint' 2012-10-16 21:12:21 +02:00
Nicolas Goaziou 8f96754932 Do not call `end-of-visual-line' when moving to the end of line
* lisp/org.el (org-end-of-line): Do not call `end-of-visual-line' when
  moving to the end of line.  Also improve behaviour on elements that
  can be hidden.
* testing/lisp/test-org.el: Add tests.
2012-10-16 21:11:06 +02:00
Nicolas Goaziou 93ebf24758 Merge branch 'maint' 2012-10-15 22:32:25 +02:00
Nicolas Goaziou 1fb3cca7c0 Allow to call `org-show-todo-tree' with an argument
* lisp/org.el (org-sparse-tree): Allow to call `org-show-todo-tree'
  with an argument.
* doc/orgcard.tex: Fix keybindings about `org-show-todo-tree'.
2012-10-15 22:31:37 +02:00
Nicolas Goaziou 0920e60c01 ob-exp: Fix removal of block results when exporting
* lisp/ob-exp.el (org-export-blocks-preprocess): Results of an
  evaluated code block can be inserted within the blank lines after
  the block.  Hence, if the block has to be removed, delete everything
  down to the first non-blank line after the end of block closing
  string, instead of removing everything down to the very end of the
  block.
* testing/lisp/test-ob-exp.el: Add test.
2012-10-15 22:29:30 +02:00
Nicolas Goaziou 23aa910259 Merge branch 'maint' 2012-10-14 21:51:59 +02:00
Nicolas Goaziou b7c5cf5d44 org-element: Fix parsing of objects of the same type in a single paragraph
* lisp/org-element.el (org-element--get-next-object-candidates): Fix
  parsing of objects of the same type in a single paragraph.
* testing/lisp/test-org-element.el: Add tests.
2012-10-14 21:49:41 +02:00
Nicolas Goaziou c65abd8577 org-element: Fix parsing of syntax at beginning of item
* lisp/org-element.el (org-element-sub/superscript-successor): Fix
  parsing of sub/superscript at beginning of item.
(org-element-latex-or-entity-successor): Fix parsing of latex
  fragments at beginning of item.
* testing/lisp/test-org-element.el: Add test.
2012-10-14 21:38:42 +02:00
Nicolas Goaziou f287ab418d Merge branch 'maint' 2012-10-13 12:54:21 +02:00
Nicolas Goaziou 9d00dd4a88 org-agenda: Fix `org-agenda-later' when called with an argument
* lisp/org-agenda.el (org-agenda-later): Fix function when span is
  a number and an argument was provided.  Also fix typo in docstring.
2012-10-13 12:52:43 +02:00
Tony Day 7f096ad379 org-insert-link: Use ido when inserting links
org.el (org-insert-link): Remove a list within the list of link
creation that causes a bug when using ido.  Remove the hard coded
iswitch and ido switches.

(org-iread-file-name): Create a function that can use
ido-read-file-name if flagged as ok.

(org-file-complete-link): Reference org-iread-file-name.
2012-10-13 12:27:02 +02:00
Nicolas Goaziou 56470de26d Merge branch 'maint'
Conflicts:
	testing/lisp/test-org.el
2012-10-12 18:22:04 +02:00
Nicolas Goaziou 5212d4fa6b Fix analyzing european dates with time but without year
* lisp/org.el (org-read-date-analyze): Fix analyzing for dates like
  "29.03 16:40".
* testing/lisp/test-org.el: Add test.
2012-10-12 18:17:25 +02:00