org-mode.git
6 hours agoob-core.el: inline src block removal bugfix master
Charles Berry [Sat, 31 Jan 2015 03:27:54 +0000]
ob-core.el: inline src block removal bugfix

* ob.core.el (org-babel-remove-inline-result): Removing an inline src
  block result removes all whitespace preceding it. The function is
  now `interactive'.

  * ob-core.el (org-babel-insert-result): The call to
  `org-babel-remove-inline-result' preceeds insertion of whitespace
  and setting location of local variable `inlinep'.

  Daniele Pizzolli reported that cleaning a buffer by evaluating
  `org-babel-remove-inline-result' can leave unwanted whitespace.  That
  bug is fixed, and the function is made `interactive'.

15 hours agoSmall refactoring
Nicolas Goaziou [Fri, 30 Jan 2015 18:41:02 +0000]
Small refactoring

* lisp/org.el (org-log-beginning):
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Small
  refactoring.

15 hours agoReplace `org-end-of-meta-data-and-drawers'
Nicolas Goaziou [Fri, 30 Jan 2015 18:26:36 +0000]
Replace `org-end-of-meta-data-and-drawers'

* lisp/org.el (org-end-of-meta-data): New function.
(org-end-of-meta-data-and-drawers): Remove function.

* lisp/org-capture.el (org-capture-place-plain-text): Use new
  function.

* testing/lisp/test-org.el (test-org/end-of-meta-data): New test.

* etc/ORG-NEWS: Document removal.

16 hours agoReplace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe'
Sebastien Vauban [Fri, 30 Jan 2015 13:23:54 +0000]
Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe'

* testing/lisp/test-ob-emacs-lisp.el, test-ob-ruby.el, test-ob.el: Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe'.

24 hours agoorg-agenda: Add only-window setup option
Kyle Meyer [Fri, 30 Jan 2015 05:04:54 +0000]
org-agenda: Add only-window setup option

* lisp/org-agenda.el (org-agenda-window-setup, org-agenda-prepare-window):
  Add option to show agenda as the only window in the current frame.

24 hours agoFix `org-agenda-insert-diary-make-new-entry'
Nicolas Goaziou [Fri, 30 Jan 2015 09:23:47 +0000]
Fix `org-agenda-insert-diary-make-new-entry'

* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Ensure
  point is at a real body line and not in front of meta data, so
  regular contents can be inserted safely after a call to this
  function.

Reported-by: Samuel Loury <konubinix@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94482>

25 hours agoFix special properties list
Nicolas Goaziou [Fri, 30 Jan 2015 08:52:09 +0000]
Fix special properties list

* lisp/org.el (org-special-properties): Add missing "CATEGORY".

* doc/org.texi (Special properties): Remove "NOBLOCKING" as a special
  property, since it can only be set through a properties drawer.
  This is a reserved property.

Reported-by: Samuel Loury <konubinix@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94483>

25 hours agoFix ORG-NEWS typo from 173b0cb6d6
Kyle Meyer [Fri, 30 Jan 2015 05:16:33 +0000]
Fix ORG-NEWS typo from 173b0cb6d6

34 hours agoox-html: Do not output "nil" for empty sections
Nicolas Goaziou [Thu, 29 Jan 2015 23:31:33 +0000]
ox-html: Do not output "nil" for empty sections

* lisp/ox-html.el (org-html-section): Do not output "nil" when section
  has no contents.

Reported-by: T.F. Torrey <tftorrey@tftorrey.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94464>

34 hours agoob-core: Silence byte-compiler
Nicolas Goaziou [Thu, 29 Jan 2015 23:24:22 +0000]
ob-core: Silence byte-compiler

34 hours agoBe more cautious when preserving visibility
Nicolas Goaziou [Thu, 29 Jan 2015 23:20:01 +0000]
Be more cautious when preserving visibility

* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-list.el (org-list-swap-items):
(org-list-send-item): In order to preserve visibility of moved items
or elements, only consider inner overlays.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94320>

37 hours agotesting/*: Inline result tests modified to follow current schema
Charles Berry [Thu, 29 Jan 2015 20:05:31 +0000]
testing/*: Inline result tests modified to follow current schema

* test/examples/babel.org: Miscellaneous fixes for new inline src
block schema.  Return a scalar to avoid unwanted error.  Return a raw
result from `src_emacs-lisp' to make checking results cleaner than
dealing with `results' macro.

* testing/lisp/test-ob-exp.el: Wrap some expected results in
  `{{{results(' and ')}}}' and drop `=%s=' formatting of others.

* testing/lisp/test-ob-lob.el: Wrap some expected results in
   `{{{results(' and ')}}}'.

* testing/lisp/test-ob.el: Wrap some expected results in `{{{results('
  and ')}}}'.

* testing/lisp/test-ob.el
  (test-org-babel/org-babel-get-inline-src-block-matches,
  test-org-babel/inline-src_blk-results-silent): Tests of inline src
  block matches (and `org-ctrl-ctrl-c') conform to the `:begin' and
  `:end' properties of `org-element-context'.

* testing/lisp/test-ob.el
  (test-org-babel/inline-src_blk-default-results-replace-line-1,
  test-org-babel/inline-src_blk-default-results-replace-line-2):
  Inline results are self replacing.

37 hours agolisp/ob-core.el: Inline source block / babel call results are replaceable
Charles Berry [Thu, 29 Jan 2015 20:05:31 +0000]
lisp/ob-core.el: Inline source block / babel call results are replaceable

* lisp/ob-core.el (org-babel-remove-inline-result): Delete results of
  current inline src block or inline babel call if it is wrapped in a
  "{{{results(.*)}}}" macro call.

* lisp/ob-core.el (org-babel-get-lob-one-liner-matches): Ensure that
  the point ends up on the same line as, and just before, `call_'
  before setting match-data.

* ob-core.el (org-babel-get-inline-src-block-matches): Use
  `org-element-context' and friends to find inline-src-block.  When
  point is in an inline-src-block (including white space determined by
  :post-blank) set match-data and return `t'.

* lisp/ob-core.el (org-babel-insert-result): Delete any `results'
  macro following current inline src block or babel call; insert
  current value in 'results' macro possibly wrapping RESULT in an
  export snippet or inline source block first.  Use of `:results list'
  or `:results table', or use of a multiline RESULT (after stripping a
  trailing newline) or a list RESULT from an inline src block or babel
  call throws an error.

37 hours agoob-exp.el: Enable removal of {{{results(...)}}}
Charles Berry [Thu, 29 Jan 2015 20:05:31 +0000]
ob-exp.el: Enable removal of {{{results(...)}}}

* ob-exp.el (org-babel-exp-do-export): `clean' lambda form removes inline
  results wrapped in `results{{{(' and `)}}}' by calling
  `org-babel-remove-inline-result'.

37 hours agolisp/ox.el: Enable removable inline src results
Charles Berry [Thu, 29 Jan 2015 20:05:31 +0000]
lisp/ox.el: Enable removable inline src results

* lisp/ox.el: (org-export-as): Treat `results' as an `identity' macro
  with one argument after Babel executes.

39 hours agoox-org: Allow custom export for links
Nicolas Goaziou [Thu, 29 Jan 2015 18:31:03 +0000]
ox-org: Allow custom export for links

* lisp/ox-org.el (org-org-link): New function.

This patch allows to handle `org' export format in EXPORT argument
from `org-add-link-type'.

Suggested-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94439>

2 days agoorg-element: Remove :alt-title property for headlines
Nicolas Goaziou [Wed, 28 Jan 2015 10:41:39 +0000]
org-element: Remove :alt-title property for headlines

* lisp/org-element.el (org-element-headline-parser): Remove :alt-title.
* lisp/ox.el (org-export-get-alt-title): Check regular :ALT_TITLE
  property instead of :alt-title.

`:alt-title' is an export-specific property. As a consequence, it's
value doesn't need to be parsed at "org-element.el"'s level. There, it
is treated as a regular property : `ALT_TITLE'.

This also removes the last call to
`org-element-parse-secondary-string' from "org-element.el".

2 days agoox-ascii: Fix indentation for description lists with links in tags
Nicolas Goaziou [Wed, 28 Jan 2015 10:29:43 +0000]
ox-ascii: Fix indentation for description lists with links in tags

* lisp/ox-ascii.el (org-ascii--current-text-width): Compute contents'
  text width according to exported tag instead of original one.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/94416>

3 days agoorg-element: Avoid `org-element-parse-secondary-string'
Nicolas Goaziou [Tue, 27 Jan 2015 21:25:15 +0000]
org-element: Avoid `org-element-parse-secondary-string'

* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser, org-element-item-parser,
  org-element--collect-affiliated-keywords): Use
  `org-element--parse-objects' instead of
  `org-element-parse-secondary-string' when parsing live objects in
  secondary strings.

`org-element-parse-secondary-string' parses a given string in
a temporary buffer, rendering buffer position related
properties (e.g., :begin) invalid.

Reported-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94397>

3 days agoorg-element: Tiny refactoring
Nicolas Goaziou [Tue, 27 Jan 2015 16:49:22 +0000]
org-element: Tiny refactoring

* lisp/org-element.el (org-element-headline-interpreter,
  org-element-inlinetask-interpreter): Use format control string
  instead of calling `char-to-string'.

3 days agoMerge branch 'master' of orgmode.org:org-mode
Nicolas Goaziou [Tue, 27 Jan 2015 14:35:56 +0000]
Merge branch 'master' of orgmode.org:org-mode

4 days agoox-html: Remove extra HTML_HEAD, HTML_HEAD_EXTRA
Rasmus [Tue, 27 Jan 2015 02:27:33 +0000]
ox-html: Remove extra HTML_HEAD, HTML_HEAD_EXTRA

* ox-html.el (html): Fix typo.

4 days agocontrib/README: more precise doc about org-eww.el
Marco Wahl [Mon, 26 Jan 2015 23:50:40 +0000]
contrib/README: more precise doc about org-eww.el

Actually using the same wording as for org-w3m.el now.

4 days agoorg-element: Tiny refactoring
Nicolas Goaziou [Mon, 26 Jan 2015 18:45:45 +0000]
org-element: Tiny refactoring

* lisp/org-element.el (org-element-map): Reduce consing and improve
  readability at the price of a tiny code duplication.

5 days agocontrib: Fix error messages.
Aaron Ecay [Mon, 26 Jan 2015 07:54:17 +0000]
contrib: Fix error messages.

* contrib/lisp/ob-eukleides.el (org-babel-execute:eukleides):
* contrib/lisp/ob-oz.el (org-babel-execute:oz):
* contrib/lisp/ob-tcl.el (org-babel-prep-session:tcl):
(org-babel-tcl-evaluate):
* contrib/lisp/org-contacts.el (org-contacts-view-send-email):
* contrib/lisp/org-drill.el (org-drill-hide-heading-at-point):
* contrib/lisp/org-mew.el (org-mew-search):
(org-mew-capture):
* contrib/lisp/org-toc.el (org-toc-forward):
* contrib/lisp/ox-freemind.el (org-freemind--build-node-contents): Fix
formatting of error messages.

5 days agoFix error messages.
Aaron Ecay [Mon, 26 Jan 2015 07:53:15 +0000]
Fix error messages.

* lisp/ob-coq.el (org-babel-coq-initiate-session):
* lisp/ob-latex.el (org-babel-execute:latex):
* lisp/org-macro.el (org-macro-replace-all):
* lisp/org.el (org--get-display-dpi): Fix formatting of error
messages.

5 days agoorg-element: Optimize `org-element-map'
Nicolas Goaziou [Sun, 25 Jan 2015 11:32:03 +0000]
org-element: Optimize `org-element-map'

* lisp/org-element.el (org-element--parsed-properties-alist): New
  variable.
(org-element-map): Remove unnecessary funcalls.  Externalize some
computations in the variable above.

5 days agorework fix in82599d37e1 to use should-error macro
Achim Gratz [Sun, 25 Jan 2015 10:15:10 +0000]
rework fix in82599d37e1 to use should-error macro

* testing/lisp/test-org-table.el: Use `should-error' instead of
  `condition-case' as that is what ERT provides for these sort of
  tests.

5 days agocompatibility fixes for fda70440f4
Achim Gratz [Sun, 25 Jan 2015 10:20:02 +0000]
compatibility fixes for fda70440f4

* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
  Replace `cl-letf' with `letf' for compatibility with older Emacsen.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
  Also check for 'error since 'user-error is not used by older Emacsen.

6 days agoob-core: Fix error messages
Nicolas Goaziou [Sat, 24 Jan 2015 22:20:46 +0000]
ob-core: Fix error messages

* lisp/ob-core.el (org-babel--script-escape-inner,
  org-babel-script-escape): Error messages do not end with a full
  stop.

7 days agoox: Prune parse tree before calling tree filter
Nicolas Goaziou [Fri, 23 Jan 2015 22:59:23 +0000]
ox: Prune parse tree before calling tree filter

* lisp/ox.el (org-export-collect-tree-properties): Do not
  set :ignore-list.
(org-export--populate-ignore-list): Remove function.
(org-export--selected-trees): Small refactoring.
(org-export-prune-tree): New function.
(org-export-remove-uninterpreted-data): Fix docstring.
(org-export-as): Prune tree before calling tree filter.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Fix macro.

This patch introduces two changes in the export process:

  1. Non-exported elements are removed from the tree instead of being
     moved into an ignore list (with the exceptions of tables rows
     and cells)

  2. Parse tree filter is called on the tree being exported, not the
     original one.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/94162>

7 days agoob-R: Convert some defvars to defconsts.
Aaron Ecay [Fri, 23 Jan 2015 17:31:33 +0000]
ob-R: Convert some defvars to defconsts.

* lisp/ob-R.el (org-babel-R-eoe-indicator):
(org-babel-R-eoe-output): Convert from defvar to defconst.
(org-babel-R-write-object-command): Convert from defvar to defconst.
Add line breaks and indentation.

7 days agobabel: fix up org-babel-script-escape
Aaron Ecay [Fri, 16 Jan 2015 22:47:32 +0000]
babel: fix up org-babel-script-escape

* lisp/ob-core.el (org-babel--script-escape-inner): New function.
(org-babel-script-escape): Use it.
* testing/lisp/test-ob.el (test-org-babel/script-escape): New test.

7 days agobabel: Remove functions which are just indirection around org-babel-script-escape
Aaron Ecay [Fri, 16 Jan 2015 22:42:04 +0000]
babel: Remove functions which are just indirection around org-babel-script-escape

* lisp/ob-groovy.el (org-babel-groovy-table-or-string): Remove.
(org-babel-groovy-evaluate): Call `org-babel-script-escape' instead.
* lisp/ob-haskell.el (org-babel-haskell-table-or-string): Remove.
(org-babel-execute:haskell): Call `org-babel-script-escape' instead.
* lisp/ob-io.el (org-babel-io-table-or-string): Remove.
(org-babel-io-evaluate):Call `org-babel-script-escape' instead.
* lisp/ob-scala.el (org-babel-scala-table-or-string): Remove.
(org-babel-scala-evaluate): Call `org-babel-script-escape' instead.

7 days agobabel: Remove functions which are never called.
Aaron Ecay [Fri, 16 Jan 2015 22:40:24 +0000]
babel: Remove functions which are never called.

* lisp/ob-awk.el (org-babel-awk-table-or-string):
* lisp/ob-shell.el (org-babel-sh-table-or-results): Remove.

8 days agotest-org-src: Fix failing tests
Nicolas Goaziou [Thu, 22 Jan 2015 23:24:29 +0000]
test-org-src: Fix failing tests

* testing/lisp/test-org-src.el (test-org-src/basic,
  test-org-src/empty-block): Do not rely on `word-at-point'.

8 days agoorg-table: Fix typo
Nicolas Goaziou [Thu, 22 Jan 2015 23:16:58 +0000]
org-table: Fix typo

* lisp/org-table.el (org-table-show-reference): Fix typo.

9 days agoob-python: Convert two defvars to defconsts.
Aaron Ecay [Thu, 22 Jan 2015 06:55:23 +0000]
ob-python: Convert two defvars to defconsts.

* lisp/ob-python.el (org-babel-python-wrapper-method):
(org-babel-python-pp-wrapper-method): Convert from defvar to defconst.

9 days agoObsolete ‘org-at-regexp-p’.
Aaron Ecay [Thu, 22 Jan 2015 06:39:37 +0000]
Obsolete ‘org-at-regexp-p’.

* lisp/org.el (org-at-regexp-p): Remove, adding an obsolete function
alias.
(org-in-regexp): Tidy docstring.
(org-open-at-point):
(org-between-regexps-p):
* lisp/org-table.el (org-table-fedit-shift-reference):
(org-table-show-reference): Call ‘org-in-regexp’ instead.

9 days agotest: Fixes for running tests interactively.
Aaron Ecay [Thu, 22 Jan 2015 05:59:04 +0000]
test: Fixes for running tests interactively.

* testing/examples/babel.org: Change spaces to dashes in  #+name
lines.

* testing/lisp/test-ob-exp.el (org-test-with-expanded-babel-code):
(ob-exp/evaluate-all-executables-in-order):
(ob-exp/exports-inline-code):
(ob-exp/exports-inline):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-exp/use-case-of-reading-entry-properties):
(ob-exp/export-from-a-temp-buffer):
(ob-export/export-with-results-before-block):
(ob-export/export-under-commented-headline):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
* testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1):
(test-org-babel/inline-src_blk-default-results-replace-line-2):
(test-org-babel/inline-src_blk-manual-results-replace):
(test-org-babel/inline-src_blk-results-scalar):
(test-org-babel/inline-src_blk-results-verbatim):
(test-org-babel/inline-src_blk-preceded-punct-preceded-by-point):
* testing/lisp/test-ox.el (test-org-export/export-scope):
Bind ‘org-babel-inline-result-wrap’ and/or ‘org-export-babel-evaluate’
so tests work when users have customized these variables.

* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
Add ‘org-trim’ where an extra newline was creeping in.

* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Neutralize org-babel-insert-result, which was stomping on the buffer
contents and disrupting the test

* testing/lisp/test-org-element.el (test-org-element/block-switches):
Replace (should (and ...)) with multiple (should ...).  This gives
more precise indications of what is wrong when a test fails.
(test-org-element/link-parser): Require org-docview.

* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Add the error type for ‘should-error’.

* testing/lisp/test-ox.el (test-org-export/set-title):
(test-org-export/handle-options):
(test-org-export/with-timestamps):
(test-org-export/comment-tree):
(test-org-export/handle-inlinetasks): Let
‘org-export-filter-body-functions’ and
‘org-export-filter-final-output-functions’ to nil where an empty
string is the expected result.  ‘org-export-filter-apply-functions’
treats an empty string as special, and changes it to nil.  This
creates test failures when the user has customized these variables.

* testing/org-test.el (org-test-with-temp-text): Let ‘org-mode-hook’
to nil.
(org-test-table-target-expect): Require ert since this function calls
some of its should* functions.

9 days agobabel: Fix bug in ‘org-babel-lob-get-info’.
Aaron Ecay [Thu, 22 Jan 2015 05:47:48 +0000]
babel: Fix bug in ‘org-babel-lob-get-info’.

* lisp/ob-lob.el (org-babel-lob-get-info): Use `save-match-data'.

Callers rely on the match data being set to
‘org-babel-lob-one-liner-regexp’.

9 days agobabel: Fix bug in org-babel-get-inline-src-block-matches.
Aaron Ecay [Thu, 22 Jan 2015 05:44:42 +0000]
babel: Fix bug in org-babel-get-inline-src-block-matches.

* lisp/ob-core.el (org-babel-get-inline-src-block-matches): Use
`org-looking-at-p' instead of `thing-at-point'.

The latter could give odd results depending on the syntax table.  In
particular, for me (thing-at-point 'word) was returning src_foo in
this context.

9 days agoox: Fix docstrings
Nicolas Goaziou [Wed, 21 Jan 2015 23:23:06 +0000]
ox: Fix docstrings

* lisp/ox.el (org-export-dictionary, org-export-translate): Fix spaces
  at the end of sentences.  Do not upcase `car' and `cdr'.

9 days agoox: Remove `org-export-ignore-element'
Nicolas Goaziou [Wed, 21 Jan 2015 23:11:35 +0000]
ox: Remove `org-export-ignore-element'

* lisp/ox.el (org-export-ignore-element): Remove function.
(org-export-collect-tree-properties): Do not assume users can
modify :ignore-list export property.

* testing/lisp/test-ox.el (test-org-export/user-ignore-list): Remove
  test.

:ignore-property is an implementation detail, which should not be
exposed to users.  Also, it is easier to simply remove the element to
ignore from the parse tree with `org-element-extract-element'.

9 days agoorg.texi: Minor fixes
Nicolas Goaziou [Wed, 21 Jan 2015 22:50:19 +0000]
org.texi: Minor fixes

* doc/org.texi (Export settings): Add UNNUMBERED property to concept
  index.  Fix number of spaces at the end of a sentence.  Use @code
  instead of @samp for reserved properties.

9 days agoFix docstrings
Nicolas Goaziou [Wed, 21 Jan 2015 22:44:21 +0000]
Fix docstrings

* lisp/org.el (org-next-visible-heading,
  org-previous-visible-heading): Shorten summary.  Fix typo.

9 days agoorg.texi: Documentation for 464cd96
rasmus [Wed, 21 Jan 2015 17:04:14 +0000]
org.texi: Documentation for 464cd96

* org.texi (Export settings): Document the UNNUMBERED property.

10 days agoAdd new functions to move to the next/prev headline skipping inline tasks.
Aaron Ecay [Mon, 19 Jan 2015 04:57:55 +0000]
Add new functions to move to the next/prev headline skipping inline tasks.

* lisp/org.el (org-next-visible-heading):
(org-previous-visible-heading): New functions.
(org-speed-commands-default, org-mode-map): Use them.

10 days agoob-asymptote, ob-emacs-lisp: remove spurious declare-function calls.
Aaron Ecay [Tue, 20 Jan 2015 23:41:30 +0000]
ob-asymptote, ob-emacs-lisp: remove spurious declare-function calls.

* lisp/ob-asymptote.el:
* lisp/ob-emacs-lisp.el: Remove spurious `declare-function's.

10 days agoox-rss: Handle RSS_TITLE property
Nicolas Petton [Tue, 20 Jan 2015 23:33:08 +0000]
ox-rss: Handle RSS_TITLE property

* contrib/lisp/ox-rss.el (org-rss-headline): Title use :RSS_TITLE
  instead of headline text, when available.

10 days agomacro: Implement argument extracting and escaping functions
Nicolas Goaziou [Tue, 20 Jan 2015 23:25:47 +0000]
macro: Implement argument extracting and escaping functions

* lisp/org-macro.el (org-macro-escape-arguments,
  org-macro-extract-arguments): New functions.

* lisp/org-element.el (org-element-macro-parser): Use new function.

* testing/lisp/test-org-macro.el (test-org-macro/escape-arguments,
  test-org-macro/extract-arguments): New tests.

10 days agoorg-index.el: bugfix for command occur
Marc-Oliver Ihm [Tue, 20 Jan 2015 21:00:26 +0000]
org-index.el: bugfix for command occur

10 days ago`org-open-link' follows timestamps in properties
Nicolas Goaziou [Tue, 20 Jan 2015 20:40:11 +0000]
`org-open-link' follows timestamps in properties

* lisp/org.el (org-open-at-point): Follow timestamps in properties
  drawers.  Refactor.

Suggested-by: Marco Wahl <marcowahlsoft@gmail.com>

11 days agoVersion 3.1.0 of org-index with rewritten command occur.
Marc-Oliver Ihm [Mon, 19 Jan 2015 20:25:58 +0000]
Version 3.1.0 of org-index with rewritten command occur.

12 days agoorg: Calculate dpi directly.
Aaron Ecay [Mon, 19 Jan 2015 05:19:27 +0000]
org: Calculate dpi directly.

* lisp/org.el (org--get-display-dpi): New function.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Use it.

The previous method tried to calculate the display dpi from the font
height, but this is wonky and not necessary, since it can be
calculated directly.

12 days agoorg.el: org-toggle-inline-images: Only display messsages when interactive.
Aaron Ecay [Mon, 19 Jan 2015 05:16:51 +0000]
org.el: org-toggle-inline-images: Only display messsages when interactive.

* lisp/org.el (org-toggle-inline-images): Only message if
called-interactively-p.

The old code made a halfhearted attempt to do this; this patch
provides the other half of the heart.

12 days agoob-ocaml: Add a cautionary comment about dodgy regex use.
Aaron Ecay [Mon, 19 Jan 2015 04:47:36 +0000]
ob-ocaml: Add a cautionary comment about dodgy regex use.

* lisp/ob-ocaml.el (org-babel-ocaml-read-list): Add comment

12 days agoorg-footnote: Use a simpler method to generate random labels.
Aaron Ecay [Mon, 19 Jan 2015 04:46:02 +0000]
org-footnote: Use a simpler method to generate random labels.

* lisp/org-footnote.el (org-footnote-new): Improve generation of
random labels.

12 days agoorg-compat: obsolete org-activate-mark.
Aaron Ecay [Mon, 19 Jan 2015 04:42:32 +0000]
org-compat: obsolete org-activate-mark.

* lisp/org-compat.el (org-activate-mark): Make obsolete.

The activate-mark function was introduced in Emacs 23 and
org-activate-mark wasn’t called anywhere in the code base.

12 days agoFix `org-set-visibility-according-to-property'
Nicolas Goaziou [Sun, 18 Jan 2015 16:00:49 +0000]
Fix `org-set-visibility-according-to-property'

* lisp/org.el (org-set-visibility-according-to-property): Ensure state
  is exctracted from a real node property.  Ignore narrowing.

13 days agoRemove `org-in-drawer-p'
Nicolas Goaziou [Sat, 17 Jan 2015 22:42:00 +0000]
Remove `org-in-drawer-p'

* lisp/org.el (org-in-drawer-p): Remove function.

The function is unused, and slightly wrong.

2 weeks agomanual: Further rewrite :session doc.
Aaron Ecay [Sat, 17 Jan 2015 03:36:00 +0000]
manual: Further rewrite :session doc.

* doc/org.texi (session): Spruce up.

2 weeks agomanual: Rewrite :session doc.
Thierry Pellé [Mon, 22 Dec 2014 09:39:16 +0000]
manual: Rewrite :session doc.

* doc/org.texi (session): Spruce up.

2 weeks agoorg.texi: Replace parenthesis comment style
rasmus [Tue, 13 Jan 2015 16:11:05 +0000]
org.texi: Replace parenthesis comment style

* org.texi (Table of contents): Replace parenthesis comment style with
  @r{} comment style in examples.

2 weeks agoFix "Args out of range" when demarcating blocks
Nicolas Goaziou [Tue, 13 Jan 2015 16:18:12 +0000]
Fix "Args out of range" when demarcating blocks

* lisp/ob-core.el (org-babel-demarcate-block): Return value from
  `org-babel-where-is-src-block-head' may be nil.

Reported-by: Sébastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/93978>

2 weeks agoob-core: Refactor `org-babel-where-is-src-block-head'
Nicolas Goaziou [Tue, 13 Jan 2015 16:16:45 +0000]
ob-core: Refactor `org-babel-where-is-src-block-head'

* lisp/ob-core.el (org-babel-where-is-src-block-head): Refactor.  In
  particular, do not return a marker, ever.  Also update docstring.
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-org):
  Fix tests containing invalid Org syntax.

2 weeks agoorg.texi: Fix typo
Nicolas Goaziou [Tue, 13 Jan 2015 14:20:47 +0000]
org.texi: Fix typo

* doc/org.texi (Table of contents): Fix typo.

2 weeks agoorg.texi: Footonote on titletoc-hyperref issue
rasmus [Tue, 13 Jan 2015 11:53:31 +0000]
org.texi: Footonote on titletoc-hyperref issue

* org.texi (Table of contents): Add footnote on hyperref and
titletoc conflict with LaTeX export.

2 weeks agoMerge branch 'maint'
Marco Wahl [Mon, 12 Jan 2015 12:02:20 +0000]
Merge branch 'maint'

2 weeks agoorg*.el: Fix call to calendar API maint
Marco Wahl [Mon, 12 Jan 2015 11:35:10 +0000]
org*.el: Fix call to calendar API

* lisp/org-clock.el: Replace occurances of
'calendar-absolute-from-iso' with 'calendar-iso-to-absolute'.

* lisp/org-agenda.el: Same as above.

* lisp/org.el: Same as above.

Some (long marked obsolete) calendar entities have been dropped from
Emacs recently.  One of those is 'calendar-absolute-from-iso'.

2 weeks agoox-html.el: Fix bug introduced in 077a24b
Rasmus [Mon, 12 Jan 2015 11:00:49 +0000]
ox-html.el: Fix bug introduced in 077a24b

* ox-html.el (org-html-format-list-item): Check that contents in
  non-nil.

2 weeks agoox: Implement local table of contents
Nicolas Goaziou [Sat, 25 Oct 2014 15:14:34 +0000]
ox: Implement local table of contents

* lisp/ox.el (org-export-collect-headlines): Allow to collect
  headlines locally.
* testing/lisp/test-ox.el (test-org-export/collect-headlines): Add
  tests.

* lisp/ox-ascii.el (org-ascii--build-toc):
(org-ascii-keyword):
* lisp/ox-html.el (org-html-toc):
(org-html-keyword):
* lisp/ox-odt.el (org-odt-toc): Allow local table of contents.
(org-odt--format-toc): New function.
(org-odt-begin-toc, org-odt-end-toc): Remove functions.

* lisp/ox-latex.el (org-latex-logfiles-extensions): Optionally remove
  "ptc" files.
(org-latex-headline, org-latex-keyword): Implement partial table of
contents assuming "titletoc" package is loaded.

* etc/ORG-NEWS:
* doc/org.texi (Table of contents): Document new parameter.

2 weeks agoorg.texi: Fix typo
Rasmus [Sat, 10 Jan 2015 23:33:44 +0000]
org.texi: Fix typo

* org.texi (Customizing tables in ODT export): Fix typo.

Reported by: Thomas <thomas@friendlyvillagers.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93914>

2 weeks agoFix docstring
Oleh Krehel [Sat, 10 Jan 2015 21:27:17 +0000]
Fix docstring

* lisp/org.el (org-insert-time-stamp): Add a reference to
  `format-time-string'.

3 weeks agoox-html.el: Add exporting of priority
Zane D. Purvis [Sat, 10 Jan 2015 09:21:54 +0000]
ox-html.el: Add exporting of priority

* list/ox-html.el (org-html--priority): New function.
(org-html-format-headline-default-function): Call `org-html--priority'.
(org-html-style-default): Add `.priority'.

HTML export previously did not support exporting of priority simply by setting
`org-export-with-priority' to `t'.

TINYCHANGE

3 weeks agoox-html.el: DONE is monospace for consistency
Zane D. Purvis [Fri, 9 Jan 2015 03:26:43 +0000]
ox-html.el: DONE is monospace for consistency

* lisp/ox-html.el (org-html-style-default): `.done' gets `font-family:
monospace;'

Other items on the headline that aren't the text itself are monospaced,
including non-DONE todo's.

TINYCHANGE

3 weeks agoorg-colview: Fix user properties display
Nicolas Goaziou [Wed, 7 Jan 2015 17:08:51 +0000]
org-colview: Fix user properties display

* contrib/lisp/org-colview-xemacs.el (org-columns-display-here):
(org-columns-display-here-title):
(org-columns-edit-value):
(org-columns-next-allowed-value):
(org-columns-new):
(org-columns-widen):
(org-columns-get-autowidth-alist):
(org-columns-update):
(org-columns-compute):
(org-agenda-columns):
(org-agenda-colview-summarize):
(org-agenda-colview-compute):

* lisp/org-colview.el (org-columns-display-here):
(org-columns-display-here-title):
(org-columns-edit-value):
(org-columns-next-allowed-value):
(org-columns-new):
(org-columns-widen):
(org-columns-get-autowidth-alist):
(org-columns-update):
(org-columns-compute):
(org-agenda-columns):
(org-agenda-colview-summarize):
(org-agenda-colview-compute): Properties are case-insensitive.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/93854>

3 weeks agoorg-table: Fix `orgtbl-to-unicode'
Nicolas Goaziou [Tue, 6 Jan 2015 23:30:34 +0000]
org-table: Fix `orgtbl-to-unicode'

* lisp/org-table.el (orgtbl-to-unicode): Remove dummy property.

3 weeks agoox-latex: Ignore width parameter in tabular environment
Nicolas Goaziou [Tue, 6 Jan 2015 22:30:54 +0000]
ox-latex: Ignore width parameter in tabular environment

* lisp/ox-latex.el (org-latex--org-table): Ignore width parameter in
  tabular environment.

Reported-by: Giuseppe Lipari <giulipari@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93815>

3 weeks agoFix `org-read-date-prefer-future' when rescheduling
Nicolas Goaziou [Tue, 6 Jan 2015 22:19:42 +0000]
Fix `org-read-date-prefer-future' when rescheduling

* lisp/org.el (org-read-date-analyze): When
  `org-read-date-prefer-future', offer a date in the future even if
  default date is different from now.

* testing/lisp/test-org.el (test-org/org-read-date): Add tests.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/93805>

3 weeks agotest-org-clocktable: fix batch testing
Achim Gratz [Mon, 5 Jan 2015 19:20:07 +0000]
test-org-clocktable: fix batch testing

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): New
  function, refactor the original test sequence.
  (test-org-clock/clocktable1, test-org-clock/clocktable2): New tests
  using the new function.

ert-deftest is a macro.  Let-binding a defvar before it is defined
causes the variable to be undefined later on, so the second test
fails for Emacsen that do not perform eager macro expansion.

3 weeks agoFix docstring
Nicolas Goaziou [Mon, 5 Jan 2015 16:47:53 +0000]
Fix docstring

* lisp/org.el (org-add-link-type): Remove reference to non-existent
  `org-export-normalize-links' function.

3 weeks agoorg-agenda: Fix issues with restoring windows
Kyle Meyer [Mon, 5 Jan 2015 03:18:46 +0000]
org-agenda: Fix issues with restoring windows

* lisp/org-agenda.el (org-agenda-prepare-window): Update window
  configuration even when agenda buffer exists in background.
* lisp/org-agenda.el (org-agenda-Quit): Use buffer value for
  org-agenda-pre-window-conf to allow for local values used with sticky
  agenda buffers.
* lisp/org-agenda.el (org-agenda-quit): Reset local, not global, value for
  org-agenda-pre-window-conf.
* lisp/org-agenda.el (org-agenda--quit): New function.

Update the pre-agenda window configuration on the next agenda call even
if org-agenda-pre-window-conf is non-nil (which occurs when the agenda
buffer is exited without q, Q, or X).  This prevents restoring a window
configuration that is not the one prior to the most recent agenda call.

Make org-agenda-Quit (Q) restore the buffer-local, not the global, value
for org-agenda-pre-window-conf so that it works correctly with sticky
agenda buffers.

Along with these changes, merge the duplicated functionality of
org-agenda-quit and org-agenda-Quit into a new function,
org-agenda--quit.

3 weeks agoorg-agenda: Track last indirect buffer
Kyle Meyer [Mon, 5 Jan 2015 03:18:40 +0000]
org-agenda: Track last indirect buffer

* lisp/org-agenda.el (org-agenda-tree-to-indirect-buffer): Record last
  indirect buffer for agenda.
* lisp/org-agenda.el (org-agenda-quit): Delete window for
  org-agenda-last-indirect-buffer, not org-last-indirect-buffer.

Introduce a new variable, org-agenda-last-indirect-buffer, that is
specific for the agenda (and perhaps a particular agenda buffer, if
org-agenda-sticky is set).  This prevents org-agenda-quit from deleting
a window if it is displaying a buffer that was created through a
org-tree-to-indirect-buffer call outside of
org-agenda-tree-to-indirect-buffer.

Make org-agenda-Quit check for indirect buffer windows, like
org-agenda-quit does.

3 weeks agoorg-table: Ignore filters and hooks in radio tables
Nicolas Goaziou [Mon, 5 Jan 2015 11:39:26 +0000]
org-table: Ignore filters and hooks in radio tables

* lisp/org-table.el (orgtbl-to-generic): Ignore user-defined filters
  and hooks.

* testing/lisp/test-org-table.el (test-org-table/to-generic): Add
  tests.

Suggested-by: Aaron Ecay <aaronecay@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93795>

3 weeks agoImplement `org-export-custom-protocol-maybe' and use it
Nicolas Goaziou [Sun, 4 Jan 2015 20:54:41 +0000]
Implement `org-export-custom-protocol-maybe' and use it

* lisp/ox.el (org-export-custom-protocol-maybe): New function.
* contrib/lisp/ox-groff.el (org-groff-link):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-link): Use new function.

* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe): New
  test.

3 weeks agoox: Tiny refactoring
Nicolas Goaziou [Sun, 4 Jan 2015 20:13:27 +0000]
ox: Tiny refactoring

* lisp/ox.el (org-export-inline-image-p): Tiny refactoring.

3 weeks agoorg-agenda-Quit: Remove unnecessary function calls
Kyle Meyer [Fri, 2 Jan 2015 22:38:30 +0000]
org-agenda-Quit: Remove unnecessary function calls

* lisp/org-agenda.el (org-agenda-Quit): Remove unnecessary function calls.

- org-agenda-Quit turns off column view if it is active, instead of
  killing the agenda buffer, so there is no need to call
  org-columns-remove-overlays when killing the buffer.
- org-agenda-reset-markers is already called when the kill-buffer-hook
  is run.

3 weeks agoorg-agenda-exit: Check column view
Kyle Meyer [Fri, 2 Jan 2015 22:38:24 +0000]
org-agenda-exit: Check column view

* lisp/org-agenda.el (org-agenda-exit): Exit column view before trying to
  exit agenda.

Running org-agenda-exit in column view deleted all buffers loaded by the
agenda, but it didn't actually exit the agenda because, if the agenda is
in column view, org-agenda-Quit turns off column view instead of killing
the agenda.  So org-agenda-exit should either just quit column view if
it is active (and not delete the loaded buffers or quit the agenda) or
make sure that the agenda is not in column view before killing it.
Since org-agenda-Quit and org-agenda-quit already do the former, make
org-agenda-exit completely exit the agenda regardless of whether it is
in column view.

3 weeks agoorg-agenda: Fix exiting function docstrings
Kyle Meyer [Fri, 2 Jan 2015 22:38:19 +0000]
org-agenda: Fix exiting function docstrings

* lisp/org-agenda.el (org-agenda-Quit):
* lisp/org-agenda.el (org-agenda-quit):
* lisp/org-agenda.el (org-agenda-exit): Correct and expand docstrings.

4 weeks agoox-ascii: Handle (custom-)id links to unnumbered headlines
Nicolas Goaziou [Thu, 1 Jan 2015 20:37:35 +0000]
ox-ascii: Handle (custom-)id links to unnumbered headlines

* lisp/ox-ascii.el (org-ascii--describe-links): When a headline is
  unnumbered, refer to its title instead of dropping the ball.

4 weeks agoox-ascii: Handle custom export functions for links
Nicolas Goaziou [Thu, 1 Jan 2015 20:28:02 +0000]
ox-ascii: Handle custom export functions for links

* lisp/ox-ascii.el (org-ascii-link): Obey to export function provided
  through `org-add-link-type'.
(org-ascii--describe-links): Do not turn links above into notes.

4 weeks agoorg-table: Fix freeze with invalid hline reference
Nicolas Goaziou [Tue, 30 Dec 2014 21:37:44 +0000]
org-table: Fix freeze with invalid hline reference

* lisp/org-table.el (org-table-find-row-type): Don't end up on the
  last hline, which doesn't exist, per
  e793158bc8492752745170e20839ddbb613fcb63.

Reported-by: Artis Rozentāls <artis.rozentals@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93654>

4 weeks agoorg.texi: Fix typo
Nick Dokos [Mon, 29 Dec 2014 17:15:46 +0000]
org.texi: Fix typo

* doc/org.texi (Headlines): Typo in footnote.

Reported-by: Daniel E. Doherty <ded-law@ddoherty.net>

5 weeks agoMerge branch 'include'
Rasmus [Wed, 24 Dec 2014 17:43:34 +0000]
Merge branch 'include'

5 weeks agoFix typo
Nicolas Goaziou [Wed, 24 Dec 2014 16:28:48 +0000]
Fix typo

* lisp/org.el (org-outline-level): Fix typo.

5 weeks agoox.el: Infer :minlevel for INCLUDE-keywords
Rasmus [Thu, 18 Dec 2014 15:48:49 +0000]
ox.el: Infer :minlevel for INCLUDE-keywords

* ox.el (org-export-expand-include-keyword): Infer :minlevel for
included Org documents if not set explicitly.
* test-ox.el (org-export-expand-include-keyword): Add tests for inferred :minlevel.

5 weeks agoox.el: Fix footnote-bug in #+INCLUDE-keyword
rasmus [Tue, 9 Dec 2014 11:40:52 +0000]
ox.el: Fix footnote-bug in #+INCLUDE-keyword

* ox.el (org-export--prepare-file-contents): Preserve footnotes
when using the LINES argument.  New optional argument FOOTNOTES.
 (org-export-expand-include-keyword): New optional argument
 FOOTNOTES.
* test-ox.el (test-org-export/expand-include): Add test for INCLUDE
  with :lines and footnotes.

5 weeks agoFix some tests when run interactively
Nicolas Goaziou [Wed, 24 Dec 2014 09:48:24 +0000]
Fix some tests when run interactively

* testing/lisp/test-ob.el (test-org-babel/nested-code-block,
  test-ob/blocks-with-spaces, test-ob/results-in-narrowed-buffer,
  test-ob/specific-colnames):
* testing/lisp/test-org-clock.el (test-org-clock/clocktable):
* testing/lisp/test-org-element.el (test-org-element/src-block-interpreter):
* testing/lisp/test-org-src.el (test-org-src/basic,
  test-org-src/empty-block, test-org-src/blank-line-block): Ensure
  default values are used for defcustoms.

5 weeks agotest-org-element: Fix test
Nicolas Goaziou [Wed, 24 Dec 2014 09:47:46 +0000]
test-org-element: Fix test

* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
  Fix test: degenerate inlinetasks cannot contain planning info.