Commit Graph

11364 Commits

Author SHA1 Message Date
Rasmus 398165f5a1 ox-odt: Remove unnecessary space when no date
* ox-odt.el (org-odt-template): Remove unnecessary space in header
  when no date.
2015-02-26 15:49:34 +01:00
Nicolas Goaziou ce7b3fc74b ox-odt: Small fix
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Fix bug
  introduced in cebdec663d.
2015-02-26 15:45:24 +01:00
Nicolas Goaziou cebdec663d ox-odt: Preserve white space when converting LaTeX code
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Preserve white
  space when converting LaTeX code.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95472>
2015-02-26 15:41:35 +01:00
Nicolas Goaziou f8edfc9fb3 org-macs: Fix `org-string-nw-p'
* lisp/org-macs.el (org-string-nw-p): Return value doesn't depend
  anymore on the current syntax table.

Reported-by: Rasmus Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95467>
2015-02-26 15:14:40 +01:00
Nicolas Goaziou c1da4d01a9 Small fix
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Return a non-nil
  value in any case.  This fixes
  37d2a2d1cf.
2015-02-26 09:06:13 +01:00
Nicolas Goaziou 37d2a2d1cf Prevent invisible characters in keywords
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Forbid invisible
  characters (e.g. bracket links) in all keywords but TITLE, DATE,
  AUTHOR, CAPTION and EMAIL.  Also remove back-end specific keywords,
  which are treated just like any other regular keyword.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95415>
2015-02-26 00:21:53 +01:00
Nicolas Goaziou 50a0e712cc ox-odt: Fix handling math snippets in captions
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Fix handling
  math snippets in captions.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95446>
2015-02-25 23:45:15 +01:00
Nicolas Goaziou 1493151b3f ob-core: Improper lists are returned in fixed-width areas
* lisp/ob-core.el (org-babel-insert-result): Improper lists are
  removeable.

When a list cannot be turned into a table, return it in a fixed-width
area so that it can be removed.

Suggested-by: Charles C. Berry <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/95430>
2015-02-25 14:41:13 +01:00
Nicolas Goaziou c76f254e8b ox: Fix custom link handling in anonymous back-end
* lisp/ox.el (org-export-custom-protocol-maybe): Change signature.
* 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-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link): Apply signature change.

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

Provide explicitly back-end used instead of guessing it from INFO
channel as an anonymous back-end could be used, masquerading the real
one.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95402>
2015-02-24 15:54:01 +01:00
Nicolas Goaziou ad7b7efcdc ob-core: Fix inserting improper lists
* lisp/ob-core.el (org-babel-insert-result): Fix output when result is
  an improper list, which cannot be turned into a table.

* testing/lisp/test-ob.el (test-ob/org-babel-insert-result--improper-lists):
  New test.

Reported-by: Daniele Pizzolli <dan@toel.it>
<http://permalink.gmane.org/gmane.emacs.orgmode/95348>
2015-02-23 18:44:52 +01:00
Nicolas Goaziou e4da74c452 org-habit: Fix 6652baa39d
* lisp/org-habit.el (org-habit-parse-todo): Fix regexp introduced in
  6652baa39d.
2015-02-22 17:26:21 +01:00
Nicolas Goaziou 6652baa39d org-habit: Small refactoring
* lisp/org-habit.el (org-habit-parse-todo): Small refactoring.
2015-02-22 17:12:56 +01:00
Nicolas Goaziou 4eb4f47141 Simplify `org-show-context' configuration
* lisp/org.el (org-show-context-detail): New variable.
(org-context-choice, org-show-following-heading, org-show-siblings,
org-show-entry-below, org-show-hierarchy-above): Remove variables.
(org-show-set-visibility): New function.
(org-convert-to-oddeven-levels, org-get-location, org-show-context,
org-reveal): Use new function.
(org-link-search): Update docstring.

* lisp/org-agenda.el (org-agenda-cycle-show): Use new function.
(org-agenda-show): Replace missing variable.

* testing/lisp/test-org.el (test-org/show-set-visibility): New test.

* doc/org.texi (Sparse trees):
* doc/orgguide.texi (Sparse trees): Document changes.

* etc/ORG-NEWS: Signal changes.

Configuration of `org-show-context' is done with a single variable
offering six different views, instead of four variables for a total
of 16 configurations.
2015-02-22 14:57:09 +01:00
Nicolas Goaziou 1ba7d23c52 Small fix
* lisp/org.el (org-mode-flyspell-verify): Small fix.
2015-02-22 11:41:01 +01:00
Nicolas Goaziou fa145361ec ox: Allow to narrow scope in footnotes API
* lisp/ox.el (org-export--footnote-reference-map,
  org-export-collect-footnote-definitions,
  org-export-footnote-first-reference-p,
  org-export-get-footnote-number): Allow to specify scope, through
  a new optional argument.

* lisp/ox-odt.el (org-odt-footnote-reference): Apply API change.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p,
  test-org-export/get-footnote-number,
  test-org-export/collect-footnote-definitions): Update tests.
2015-02-21 11:29:40 +01:00
Nicolas Goaziou 719dda85ea ox: Small refactoring
* lisp/ox.el (org-export-document-properties): New variable.
(org-export-prune-tree, org-export-remove-uninterpreted-data): Use new variable.
2015-02-20 18:50:27 +01:00
Nicolas Goaziou 014de0a532 ox: Change `org-export-collect-footnote-definitions' signature
* lisp/ox.el (org-export-collect-footnote-definitions): Refactor
  code.  Change signature.

* testing/lisp/test-ox.el (test-org-export/collect-footnote-definitions):
  New test.
(test-org-export/footnotes): Update test.

* lisp/ox-ascii.el (org-ascii-inner-template):
* lisp/ox-html.el (org-html-footnote-section): Apply signature change.

* etc/ORG-NEWS: Document signature change.

This change makes `org-export-collect-footnote-definitions' compatible
with `org-export-get-footnote-number' and
`org-export-footnote-first-reference-p'.
2015-02-20 18:06:23 +01:00
Nicolas Goaziou 21c6a1e1e9 org-habit: Update copyright year 2015-02-20 16:25:08 +01:00
Nicolas Goaziou de51e1aef6 org-habit: Extend tracking to done notes
* lisp/org-habit.el (org-habit-parse-todo): Also find timestamps when
  `org-log-done' is `note'.

Reported-by: Andrew Francis Swann <swann@math.au.dk>
2015-02-20 10:45:59 +01:00
Rasmus 1616e08448 org.el: Backwards compatibility
* org.el (org-cdlatex-environment-indent): Remove cl-prefixes for
  compatibility.
2015-02-20 01:35:34 +01:00
Rasmus 507d2aae0f Fix bug introduced in 438d75c
* ox-latex.el (org-latex--format-spec): Fix bug.
2015-02-20 00:05:56 +01:00
Rasmus 438d75c59d ox-latex: Format-spec for hyperref and title
* ox-latex.el (org-latex--format-spec): New function with format-specs.
  (org-latex-template): Use org-latex--format-spec.
  (org-latex-hyperref-template): New defaults and use
  org-latex--format-spec.
  (org-latex-title-command): Use org-latex--format-spec.
* ORG-NEWS: Mention change.
2015-02-19 22:41:02 +01:00
Rasmus 14a9510ce1 org.el: Change indention for cdlatex environments
* org.el (org-cdlatex-environment-indent): Use different indent
  algorithm based on content above the new latex-environment.
2015-02-19 22:40:51 +01:00
Nicolas Goaziou 38ab8b2af3 Fix `org-time-stamp'
* lisp/org.el (org-time-stamp): Properly insert time when specified.

This fixes e50baa4cf7.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/95210>
2015-02-19 10:33:26 +01:00
Nicolas Goaziou 7745ef04c9 ob-core: Allow spaces in NAME
* lisp/ob-core.el (org-babel-src-name-w-name-regexp): Allow spaces as
  NAME value.

Suggested-by: Joost Helberg <joost@snow.nl>
<http://permalink.gmane.org/gmane.emacs.orgmode/95175>
2015-02-18 15:02:22 +01:00
Nicolas Goaziou 5894a74500 org-src: Update copyright year 2015-02-18 14:58:36 +01:00
Nicolas Goaziou a5f1a3e4be org-src: Small refactoring
* lisp/org-src.el (org-src--remove-overlay): New function.
(org-src--edit-element, org-src-mode-configure-edit-buffer): Use new
function.
2015-02-18 02:05:57 +01:00
Nicolas Goaziou 2dd548a4e0 Merge branch 'maint' 2015-02-18 02:04:39 +01:00
Nicolas Goaziou c41bbc577e Fix "Wrong type argument: overlayp"
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Fix "Wrong
  type argument: overlayp".

Changing major mode in a source edit buffer resets local variables
used to link it to source buffer.  As a consequence, overlay in source
buffer can no longer be found nor deleted.
2015-02-18 01:59:51 +01:00
Nicolas Goaziou 0d24086657 Update some copyright years 2015-02-16 01:40:07 +01:00
Nicolas Goaziou 7ebe87e2d5 org-element: Forbid footnote references in parsed keywords
* lisp/org-element.el (org-element-object-restrictions): Forbid
  footnote references in parsed keywords.

Inserting footnote references in parsed keywords (e.g., TITLE or
CAPTION) can lead to subtle bugs.  Indeed, it is impossible to know in
time if that particular footnote is going to be used in the output,
and, therefore, if it should count, e.g., in
`org-export-get-footnote-number'.
2015-02-15 21:56:57 +01:00
Nicolas Goaziou 176681bc65 org-footnote: Be more strict about location for new footnotes
* lisp/org-footnote.el (org-footnote--allow-reference-p): New
  function.
(org-footnote-new): Use new function.

* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test.

In particular, Org now refuses to add a footnote reference in
a keyword, e.g., TITLE.
2015-02-15 21:56:57 +01:00
Nicolas Goaziou 13938b87c2 org-element: Faster inline footnotes parsing
* lisp/org-element.el (org-element--pair-square-table): New variable.
(org-element-footnote-reference-parser): Use new variable.
2015-02-15 13:33:25 +01:00
Nicolas Goaziou 836d9db8a9 org-list: Fix continuated items repair
* lisp/org-list.el (org-list-struct-apply-struct): Preserve disparate
  indentation in contuated contents, i.e., contents after a plain list
  still within an item.

* testing/lisp/test-org-list.el (test-org-list/repair): Add test.

This fixes the following case:

  - item
     - child
     item contents
       with different indentation

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94977>
2015-02-14 12:37:41 +01:00
Nicolas Goaziou 55ce4b74b3 Fix `org-return' on list items
* lisp/org.el (org-return): Properly preserve list structure when
  calling `org-return-indent' on an item.

* testing/lisp/test-org.el (test-org/return): Add test.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/94977>
2015-02-14 02:07:18 +01:00
Nicolas Goaziou e50baa4cf7 Fix `org-time-stamp'
* lisp/org.el (org-time-stamp): Correctly match repeater, if any.
  Refactor code.

* testing/lisp/test-org.el (test-org/time-stamp): New test.

Reported-by: Nicolas Richard <theonewiththeevillook@yahoo.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94974>
2015-02-13 21:54:21 +01:00
Nicolas Goaziou 68f094a706 ox-odt: Fix nested footnotes export
* lisp/ox-odt.el (org-odt-footnote-reference): Fix nested footnotes
  export.

Reported-by: Vaidheeswaran <vaidheeswaran.chinnaraju@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94900>
2015-02-13 14:14:39 +01:00
Nicolas Goaziou ccb663c742 ox: Add optional order argument to some footnotes related functions
* lisp/ox.el (org-export--footnote-reference-map): New function.
(org-export-footnote-first-reference-p,
org-export-get-footnote-number): Allow to change order when footnotes
references are contained within footnote definitions.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p):
(test-org-export/get-footnote-number):  New tests.
(test-org-export/footnotes): Update test.
2015-02-13 14:10:51 +01:00
Rainer M. Krug b95f7aa823 ob-core.el: Fix numeric error and add header-args
* lisp/ob-core.el (org-babel-view-src-block-info): when a property
  value was numeric, an error was raised. Fixed by converting property
  value to string before evauation.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  "header args" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  for language specific "header args:LANG" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.
2015-02-13 00:39:35 +01:00
Nicolas Goaziou 0ed5d4336b ox-publish: Clean-up `org-publish-find-date'
* lisp/ox-publish.el (org-publish-find-date): Remove useless cond
branch.

:date property is never a single timestamp, so the first branch is
always false.

Reported-by: Rasmus <rasmus@gmx.us>
2015-02-13 00:33:17 +01:00
Rasmus 1cc23c6f3d Fix bugs introduced in b39dd5a
* ox-man.el (org-man-template),
  ox-texinfo.el (org-texinfo-template): Fix bug.
2015-02-12 11:00:56 +01:00
Rasmus e6fcc853c5 ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
  ox-ascii.el (org-ascii-template--document-title),
  ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
  ox-latex.el (org-latex-template), ox-man.el (org-man-template),
  ox-odt.el (org-odt-template), ox-org.el (org-org-template),
  ox-publish.el (org-publish-project-alist),
  ox-texinfo.el (org-texinfo-template),
  ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.

This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-12 01:45:39 +01:00
Nicolas Goaziou fd51dad999 Turn momentarily planning keywords into defvar
* lisp/org.el (org-closed-string, org-deadline-string,
  org-scheduled-string): Use a defvar.

DEADLINE, SCHEDULED and CLOSED are now meant to be constants. However,
we preserve backward-compatibility during obsolencence phase.
2015-02-12 00:46:29 +01:00
Nicolas Goaziou 23d4d869f5 org-agenda: Ignore sticky feature when picking date from calendar
* lisp/org-agenda.el (org-calendar-goto-agenda): Ignore sticky
  feature.

Reported-by: Tory S. Anderson <torys.anderson@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94865>
2015-02-11 23:44:26 +01:00
Nicolas Goaziou d92ef95170 org-agenda: Fix small bug
* lisp/org-agenda.el (org-todo-list): `org-last-args' property
  contains a list, not an atom.
2015-02-10 23:13:56 +01:00
Nicolas Goaziou f620efe1b8 Merge branch 'maint' 2015-02-10 22:27:12 +01:00
Nicolas Goaziou 880a2b4f90 ox-odt: Fix exporting target link without a description
* lisp/ox-odt.el (org-odt-link--infer-description): Fix comment.
(org-odt-link): When link to target has no description, use a number.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94815>
2015-02-10 22:23:40 +01:00
Nicolas Goaziou a4083de5c2 Fix typo
* lisp/org.el (org-read-date-analyze): Fix typo.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/94820>
2015-02-10 17:43:13 +01:00
Nicolas Goaziou 650278f775 org-element: Interpret pseudo objects without declaration
* lisp/org-element.el (org-element-object-containers): New variable
(org-element-interpret-data): Remove optional argument.
(org-element--interpret-data-1): Remove optional argument.  Guess when
a given element or object has a pseudo type.

* lisp/ox-latex.el (org-latex-pseudo-objects): Remove variable.
(org-latex-table, org-latex--math-table): Apply signature change above.

* testing/lisp/test-org-element.el (test-org-element/interpret-data):
  Update test.
2015-02-09 12:04:38 +01:00
Nicolas Goaziou 7f66983184 org-element: Fix docstring
* lisp/org-element.el (org-element-copy): Fix docstring.
2015-02-09 10:57:39 +01:00
Nicolas Goaziou 16841306ed Use `org-element-copy'
* lisp/org.el (org-timestamp-split-range): Use `org-element-copy'.  Do
  not preserve :parent property anymore.

* lisp/ox.el (org-export-as): Use `org-element-copy'.

* testing/lisp/test-org.el (test-org/timestamp-split-range): Update test.
2015-02-09 10:15:59 +01:00
Nicolas Goaziou 70933a3dd6 org-element: Implement `org-element-copy'
* lisp/org-element.el (org-element-copy): New function.
* testing/lisp/test-org-element.el (test-org-element/copy): New test.
2015-02-09 10:07:34 +01:00
Rasmus 8f38f037b4 ox.el: {{{date}}} formatting argument
* ox.el (org-export-as): Allow {{{date}}} to take formatting-argument.
* org.texi (Macro replacement): Document {{{date}}} formatting.
* test-ox.el (test-org-export/expand-macro): Test {{{data(format)}}}
* org-NEWS: Mention optional {{{data}}} argument.

Optional argument to {{{date}}} like {{{date(FMT)}}} are treated
similar to {{{time(FMT)}}} if \#+DATE is a timestamp.
2015-02-09 01:47:21 +01:00
Yuri D. Lensky ba544e4caa Fix timestamp-based sorting of tags-based entries in agenda
* lisp/org.el (org-scan-tags): Fix agenda org tags scans to properly
  add timestamp property, completely analogously to
  org-agenda-get-todos.
* lisp/org-agenda.el (org-agenda-entry-get-agenda-timestamp,
  org-agenda-get-todos): Factored timestamp retrieval code out to
  separate function org-agenda-entry-get-agenda-timestamp from
  org-agenda-get-todos.

Before this fix, timestamps were ignored when sorting agenda views of
the 'tags' and 'tags-todo' types.

TINYCHANGE
2015-02-09 01:08:42 +01:00
Nicolas Goaziou 0be8495d01 Call `org-insert-heading' instead of (insert "* ")
* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level):
* lisp/org.el (org-link-search):  Call `org-insert-heading' instead
  of (insert "* ").

This allows, in particular, to run `org-insert-heading-hook' and
possibly fix up blank lines around.
2015-02-08 01:45:38 +01:00
Nicolas Goaziou ca0199c7ee `org-insert-heading' can be forced to insert top-level headline
* lisp/org.el (org-insert-heading): Change signature.  Tiny refactoring.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
2015-02-08 01:43:30 +01:00
Alan Schmitt 6d691e2aa8 Function `org-link-search' does exact headline search
* lisp/org.el (org-link-search): Change headline search such that it
always does an exact search, ignoring spaces.

* testing/lisp/test-org.el (test-org/fuzzy-links): Test exact headline
match with spaces and cookies.

* doc/org.texi (External links): Cleanup footnote about the
`org-link-search-must-match-exact-headline' option for text searches
and add a footnote about the effect of the same option for heading
searches.

* doc/ORG-NEWS: Document changes.
2015-02-07 22:42:40 +01:00
Nicolas Goaziou 7e4228a137 org-agenda: Fix logging with bulk agenda commands
* lisp/org-agenda.el (org-agenda-new-marker): Make sure data inserted
  inserted in the heading above marker updates it.
(org-agenda-bulk-action): Enforce calling `org-add-log-note' after
each action.

Reported-by: Maxim Baz <z0rch.coding@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94654>
2015-02-06 09:52:25 +01:00
Nicolas Goaziou ab9e9d2857 Tiny refactoring
* lisp/org.el (org-ctrl-c-ctrl-c): Tiny refactoring.
2015-02-05 18:12:23 +01:00
Nicolas Goaziou 528b909fe1 ox-html: Properly escape ampersands in links
* lisp/ox-html.el (org-html-link): Properly escape ampersands in
  links.
(org-html-encode-plain-text): Small refactoring.

Reported-by: Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/94640>
2015-02-05 12:56:23 +01:00
Nicolas Goaziou 226639b239 org-agenda: Fix adding diary entries
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Fix
  adding adding diary entries the same day.

This is a follow-up to a1116aa54e.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/94638>
2015-02-05 10:00:46 +01:00
Nicolas Goaziou 55c0708bc4 org-element: Externalize docview links
* lisp/org-element.el (org-element-link-type-is-file): Remove.
(org-element-link-parser): Do not treat specially anymore "docview"
link type.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
  Update test.

* lisp/org-docview.el (org-docview-export): Fix path.

"docview" is a custom link type handled in its own library.  There is
no reason to include it in core parser.
2015-02-03 23:00:21 +01:00
Nicolas Goaziou 4c00842e88 Fix `org-toggle-heading'
* lisp/org.el (org-toggle-heading): Avoid adding spurious stars when
  changing a plain list into a subtree.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/94223>
2015-02-03 21:39:53 +01:00
Nicolas Goaziou 1d4c79d415 org-agenda: Fix agenda diary corruption
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Do not
  save excursion or final position is lost.

Reported-by: Gregor Zattler <grfz@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/94543>
2015-02-02 18:19:30 +01:00
Konubinix 2ebb14d746 Make use of `org-insert-heading' instead of inserting the * character
* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make
  use of `org-insert-heading' instead of inserting the * character

Therefore, the hooks associated to the insertion of a heading will be
triggered.  Since those hooks may cause the creation of some
metadata.  `org-end-of-meta-data' is used afterward.
2015-02-02 13:24:37 +01:00
Nicolas Goaziou b5d9f4be4d org-table: Allow accentuated characters in remote table names
* lisp/org-table.el (org-table-eval-formula): Allow a larger set of
  characters in remote name.

Reported-by: flav <flav.justflav@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/75690>
2015-02-01 01:03:45 +01:00
Sami Airaksinen c90925be29 org.el: org-babel-load-file loads first tangle file
(org-babel-load-file): When org-mode FILE has multiple target files
for tangle blocks, `exported-file' will be set to last found
target file, which might not be the `file'.

Therefore fix for this bug is to select the last element of that
tangled file list, which is the tangle target file of the first found
tangle block, most typically the `file'.

TINYCHANGE
2015-02-01 00:02:21 +01:00
Nicolas Goaziou a752684bf0 org-clock: Fix `org-clock-in-last' with universal argument
* lisp/org-clock.el (org-clock-in-last): `org-clock-in' expects an
  universal argument, not the return value of `org-clock-select-task'.

Reported-by: Peter Münster <pmlists@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94331>
2015-01-31 12:46:50 +01:00
Charles Berry 37fc8667e0 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'.
2015-01-30 19:27:54 -08:00
Nicolas Goaziou fe63e59faf Small refactoring
* lisp/org.el (org-log-beginning):
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Small
  refactoring.
2015-01-30 19:41:02 +01:00
Nicolas Goaziou 98a1bc868a 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.
2015-01-30 19:31:27 +01:00
Kyle Meyer 7834a1ce66 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.
2015-01-30 10:39:53 +01:00
Nicolas Goaziou a1116aa54e 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>
2015-01-30 10:23:47 +01:00
Nicolas Goaziou 31e7634779 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>
2015-01-30 09:55:31 +01:00
Nicolas Goaziou 5ae0749e63 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>
2015-01-30 00:31:33 +01:00
Nicolas Goaziou e33637551d ob-core: Silence byte-compiler 2015-01-30 00:24:22 +01:00
Nicolas Goaziou 8ff32ab112 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>
2015-01-30 00:20:01 +01:00
Charles Berry 85ff663ce4 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.
2015-01-29 12:05:31 -08:00
Charles Berry f301ac8e9f 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'.
2015-01-29 12:05:31 -08:00
Charles Berry 638cde3ac9 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.
2015-01-29 12:05:31 -08:00
Nicolas Goaziou f7a1e23d20 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>
2015-01-29 19:31:03 +01:00
Nicolas Goaziou a1f54021c9 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".
2015-01-28 11:41:39 +01:00
Nicolas Goaziou e1862b5c44 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>
2015-01-28 11:29:43 +01:00
Nicolas Goaziou 98ee739e6d 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>
2015-01-27 22:25:15 +01:00
Nicolas Goaziou 6617e6dfa9 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'.
2015-01-27 17:49:22 +01:00
Nicolas Goaziou 6dc26059cb Merge branch 'master' of orgmode.org:org-mode 2015-01-27 15:35:56 +01:00
Rasmus a297692b1c ox-html: Remove extra HTML_HEAD, HTML_HEAD_EXTRA
* ox-html.el (html): Fix typo.
2015-01-27 03:30:43 +01:00
Nicolas Goaziou 96b02fa9a6 org-element: Tiny refactoring
* lisp/org-element.el (org-element-map): Reduce consing and improve
  readability at the price of a tiny code duplication.
2015-01-26 19:45:45 +01:00
Aaron Ecay 076e0ea518 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.
2015-01-26 02:53:15 -05:00
Nicolas Goaziou cd6fa4c15e 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.
2015-01-25 12:32:03 +01:00
Nicolas Goaziou 61eedb852f 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.
2015-01-24 23:20:46 +01:00
Nicolas Goaziou b6fce5c90b 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>
2015-01-23 23:59:23 +01:00
Aaron Ecay 3996de60da 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.
2015-01-23 14:39:30 -05:00
Aaron Ecay fa5fd63516 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.
2015-01-23 14:36:40 -05:00
Aaron Ecay d067982b59 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.
2015-01-23 14:36:40 -05:00
Aaron Ecay c4f34a69b5 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.
2015-01-23 14:36:40 -05:00
Nicolas Goaziou 53592f4e25 org-table: Fix typo
* lisp/org-table.el (org-table-show-reference): Fix typo.
2015-01-23 00:16:58 +01:00
Aaron Ecay a0095ce1a7 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.
2015-01-22 01:55:23 -05:00
Aaron Ecay 9f75cea40d 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.
2015-01-22 01:52:49 -05:00
Aaron Ecay caad78ca8a 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’.
2015-01-22 00:47:48 -05:00
Aaron Ecay d45b5a7884 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.
2015-01-22 00:44:42 -05:00
Nicolas Goaziou f15b17688c 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'.
2015-01-22 00:23:06 +01:00
Nicolas Goaziou 6b450ce81c 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'.
2015-01-22 00:11:35 +01:00
Nicolas Goaziou cf77de2c3a Fix docstrings
* lisp/org.el (org-next-visible-heading,
  org-previous-visible-heading): Shorten summary.  Fix typo.
2015-01-21 23:44:21 +01:00
Aaron Ecay 9348b5f1b0 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.
2015-01-20 18:55:07 -05:00
Aaron Ecay 37e0fd2318 ob-asymptote, ob-emacs-lisp: remove spurious declare-function calls.
* lisp/ob-asymptote.el:
* lisp/ob-emacs-lisp.el: Remove spurious `declare-function's.
2015-01-20 18:42:56 -05:00
Nicolas Goaziou ec0706ea40 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.
2015-01-21 00:27:24 +01:00
Nicolas Goaziou 9fc8e3c0fa `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>
2015-01-20 21:42:12 +01:00
Aaron Ecay d34b804a6f 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.
2015-01-19 00:34:56 -05:00
Aaron Ecay 05ac7b37a4 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.
2015-01-19 00:16:51 -05:00
Aaron Ecay b3712b9840 ob-ocaml: Add a cautionary comment about dodgy regex use.
* lisp/ob-ocaml.el (org-babel-ocaml-read-list): Add comment
2015-01-18 23:47:36 -05:00
Aaron Ecay f1dcbfe79c org-footnote: Use a simpler method to generate random labels.
* lisp/org-footnote.el (org-footnote-new): Improve generation of
random labels.
2015-01-18 23:46:02 -05:00
Aaron Ecay 56bbacfd89 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.
2015-01-18 23:42:32 -05:00
Nicolas Goaziou d1c5dc2e41 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.
2015-01-18 17:00:49 +01:00
Nicolas Goaziou 71610b19ff Remove `org-in-drawer-p'
* lisp/org.el (org-in-drawer-p): Remove function.

The function is unused, and slightly wrong.
2015-01-17 23:42:00 +01:00
Nicolas Goaziou b5072890c3 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>
2015-01-13 17:18:12 +01:00
Nicolas Goaziou fdb0092830 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.
2015-01-13 17:16:45 +01:00
Marco Wahl e0879b03d0 Merge branch 'maint' 2015-01-12 13:02:20 +01:00
Marco Wahl ca21b7b86d 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'.
2015-01-12 12:35:10 +01:00
Rasmus 86588d6501 ox-html.el: Fix bug introduced in 077a24b
* ox-html.el (org-html-format-list-item): Check that contents in
  non-nil.
2015-01-12 12:00:49 +01:00
Nicolas Goaziou b07e2f6ff1 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.
2015-01-11 22:47:02 +01:00
Oleh Krehel 6c811ac861 Fix docstring
* lisp/org.el (org-insert-time-stamp): Add a reference to
  `format-time-string'.
2015-01-10 22:28:18 +01:00
Zane D. Purvis 7e6436e2c8 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
2015-01-10 10:27:32 +01:00
Zane D. Purvis f9ba99bbc9 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
2015-01-09 09:22:03 +01:00
Nicolas Goaziou 3d2e1eec78 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>
2015-01-07 18:08:51 +01:00
Nicolas Goaziou ef523b0bca org-table: Fix `orgtbl-to-unicode'
* lisp/org-table.el (orgtbl-to-unicode): Remove dummy property.
2015-01-07 00:30:34 +01:00
Nicolas Goaziou b7b913f656 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>
2015-01-06 23:30:54 +01:00
Nicolas Goaziou 85c55d453b 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>
2015-01-06 23:19:42 +01:00
Nicolas Goaziou 18f50c4a20 Fix docstring
* lisp/org.el (org-add-link-type): Remove reference to non-existent
  `org-export-normalize-links' function.
2015-01-05 17:47:53 +01:00
Kyle Meyer 7e945107ce 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.
2015-01-05 12:49:44 +01:00
Kyle Meyer 460f31efa0 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.
2015-01-05 12:49:41 +01:00
Nicolas Goaziou 70f965535b 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>
2015-01-05 12:39:26 +01:00
Nicolas Goaziou 3900155788 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.
2015-01-04 22:16:36 +01:00
Nicolas Goaziou 8ce845ba6c ox: Tiny refactoring
* lisp/ox.el (org-export-inline-image-p): Tiny refactoring.
2015-01-04 21:13:27 +01:00
Kyle Meyer b4b6584eea 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.
2015-01-03 12:15:58 +01:00
Kyle Meyer 722a574d88 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.
2015-01-03 12:15:54 +01:00
Kyle Meyer 424eb55263 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.
2015-01-03 12:15:50 +01:00
Nicolas Goaziou 10954832e5 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.
2015-01-01 21:37:35 +01:00
Nicolas Goaziou 8b0823b3e0 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.
2015-01-01 21:28:02 +01:00
Nicolas Goaziou 44744bba2c 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
  e793158bc8.

Reported-by: Artis Rozentāls <artis.rozentals@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93654>
2014-12-30 22:37:44 +01:00
Rasmus 9528bef2a8 Merge branch 'include' 2014-12-24 18:43:34 +01:00
Nicolas Goaziou 52638c17e5 Fix typo
* lisp/org.el (org-outline-level): Fix typo.
2014-12-24 17:28:48 +01:00
Rasmus 130dcdb0cb 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.
2014-12-24 12:44:51 +01:00
rasmus 7509d6d721 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.
2014-12-24 11:58:50 +01:00
Nicolas Goaziou 4947d25c7c ob-core: Add safety test for results keyword value
* lisp/ob-core.el (org-babel-results-keyword): Add safety test.  Fix
  docstring.
2014-12-24 10:35:20 +01:00
Nicolas Goaziou be05318515 ob-core: Fix docstring
* lisp/ob-core.el (org-babel-results-keyword): NAME cannot be used for
  results, as it is a reserved affiliated keyword.
2014-12-24 10:29:44 +01:00
Nicolas Goaziou c6d9a4ec22 Fix false positive SCHEDULED lines in sparse tree
* lisp/org.el (org-check-before-date, org-check-after-date,
  org-check-dates-range): Make sure we're really at a timestamp before
  validating the entry.

Reported-by: James Harkins <jamshark70@qq.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93126>
2014-12-23 12:22:16 +01:00
Nicolas Goaziou f0a13a09d8 Implement `org-at-planning-p'
* lisp/org.el (org-at-planning-p): New function.
* testing/lisp/test-org.el (test-org/at-planning-p): New test.
2014-12-23 12:14:40 +01:00
Nicolas Goaziou 1c5014740e Compare `org-current-level' and `org-outline-level'
* lisp/org.el (org-outline-level, org-current-level): Update
  docstrings to insist on the difference between the two functions.
2014-12-23 11:12:00 +01:00
Nicolas Goaziou 6dcaafff3e Tiny refactoring
* lisp/org.el (org-current-level): Tiny refactoring.
2014-12-22 00:09:08 +01:00
Nicolas Goaziou c5ba48072c Fix typo
* lisp/org.el (org-re-timestamp): Fix typo introduced in
  eae19b1284.
2014-12-21 23:39:38 +01:00
Nicolas Goaziou eae19b1284 Fix default value in `org-sparse-tree-default-date-type'
* lisp/org.el (org-sparse-tree-default-date-type): Use new default
  value instead of the undocumented previous one.  Fix docstring, too.
(org-sparse-tree): Apply change to previous variable.
(org-re-timestamp): Apply change to previous variable.  Refactor code.
2014-12-21 23:20:14 +01:00
Nicolas Goaziou 6f5bd30f0b org-entities: Remove `replace-amp'
* lisp/org-entities.el (replace-amp): Remove function.

The function is unused throughout the code base and is in the wrong
namespace.
2014-12-21 22:34:03 +01:00
Nicolas Goaziou 7dc8a1b362 Move `org-do-sort' into "org-table.el"
* lisp/org.el (org-do-sort): Remove function.

* lisp/org-table.el (org-table--do-sort): New function.
(org-table-sort-lines): Use new function.

`org-do-sort' is really a helper function for `org-table-sort-lines',
which applies exclusively on tables.
2014-12-21 22:23:11 +01:00
Nicolas Goaziou 4a214a0647 `org-outline-level' ignores narrowing
* lisp/org.el (org-outline-level): Ignore narrowing.  Refactor to be
  slightly faster.
2014-12-21 22:14:26 +01:00
Rasmus 077a24b8d0 ox-html.el: Trim list items
* ox-html.el (org-html-format-list-item): Trim contents to avoid
  spurious space.
2014-12-20 23:32:44 +01:00
Nicolas Goaziou 442216871a Fix `org-log-beginning' on empty entries
* lisp/org.el (org-log-beginning): Check for the need to insert
  a drawer in all cases.

Suggested-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/93538>
2014-12-20 21:59:51 +01:00
Nicolas Goaziou 13711d4583 Fix table sorting with ?F key
* lisp/org.el (org-do-sort): Properly reverse results when ?F and
  a compare function is provided.  Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): New
  test.
2014-12-20 21:29:51 +01:00
Jon Snader 71b098702c org.el: Implement user-defined table sorting
* lisp/org.el (org-do-sort): Implement the ?f and ?F sorting options
  to allow user-defined table sorting.  Update the DOC string.

* lisp/org-table (org-table-sort-lines): Add the GETKEY-FUNC and
  COMPARE-FUNC optional parameters and pass them to the call to
  `org-do-sort'.  Update the DOC string.

* doc/org.texi (org-table-sort-lines): Update documentation to reflect
  the addition of the ?f and ?F options.

This patch implements user-defined extraction and comparison functions
for table sorting.  Thanks to Nicolas Goaziou for helpful suggestions.

This patch was discussed on the Org Mode mailing list:
http://article.gmane.org/gmane.emacs.orgmode/93334
2014-12-20 20:36:57 +01:00
Toby S. Cubitt 54dfb86719 org-archive.el: Add command to archive entries with timestamps before today
* lisp/org-archive.el (org-archive-all-old): archive all entries with
  timestamps prior to today.
  (org-archive-subtree): double prefix argument invokes
  org-archive-all-old.
  (org-archive-all-matches, org-archive-all-done): factor out common
  code into org-archive-all-matches.
2014-12-17 00:08:39 +01:00
Nicolas Goaziou a949b23aa6 Merge branch 'master' of orgmode.org:org-mode 2014-12-16 23:55:56 +01:00
Nicolas Goaziou c1558d34d7 Fix low-high estimates
* doc/org.texi (Column attributes): Emphasize estimates format.
  Document degenerate case of plain numbers.
* lisp/org-colview.el (org-columns-compute): Properly sum estimates.
(org-columns-string-to-number): Recognize estimates containing an
unit.
(org-estimate-mean-and-var, org-estimate-print): Allow numbers as
a degenerate case of estimates.

Reported-by: yary <not.com@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93505>
2014-12-16 23:53:15 +01:00
Alan Schmitt 57b76e2771 org.el: Allow calendars to be in their own frame
* lisp/org.el (org-read-date): Create and delete frames if
`calendar-setup' is set to 'calendar-only.
2014-12-16 19:09:22 +01:00
Nicolas Goaziou 389274c1c4 Fix `org-hide-archived-subtrees'
* lisp/org.el (org-hide-archived-subtrees): Prevent an error when END
  argument doesn't match the end of a subtree.  Prevent false
  positives.  Also, archive tag is case-sensitive.
2014-12-16 10:28:34 +01:00
Nicolas Goaziou eac147621e Fix 434103
* lisp/org.el (org-log-into-drawer): Fix
  04f6830a46e54db23afbe3c94de38a22c3.
2014-12-15 13:07:10 +01:00
Nathaniel Flath 90c047d2ff org-table.el: org-table-recalculate is quieter
* lisp/org-table.el (org-table-recalculate): Removed message for start of
processing.  When ALL is t, messages are printed at most once per second.

TINYCHANGE
2014-12-14 22:06:25 +01:00
Nathaniel Flath 2945c1e8c5 org-table.el: org-table-recalculate early returns
* lisp/org-table.el (org-table-recalculate): Add early return.

TINYCHANGE
2014-12-14 22:06:20 +01:00
Nicolas Goaziou e990bedc51 Change default value for `org-clock-into-drawer'
* lisp/org-clock.el (org-clock-into-drawer): Update docstring.  Change
  default value.
(org-clock-jump-to-current-clock): Properly find current clock drawer,
if any.
(org-clock-find-position): Tiny fix.
(org-clock-out): Properly check if clock and log drawers are the same.
(org-clock-find-position, org-clock-out,
(org-clock-remove-empty-clock-drawer): Use new function.
2014-12-14 18:22:31 +01:00
Nicolas Goaziou 43410304f6 Function `org-log-into-drawer' returns a string or nil
* lisp/org.el (org-log-into-drawer): Update docstring.  Function
  returns a string or nil, not t anymore.
(org-mode-flyspell-verify): Small refactoring.
2014-12-14 18:21:42 +01:00
Nicolas Goaziou aa0bfcdcdb Merge branch 'maint'
Conflicts:
	lisp/ob-core.el
2014-12-14 09:41:38 +01:00
Nicolas Goaziou 89a0acc75e ob-core: Source blocks are case-insensitive
* lisp/ob-core.el (org-babel-map-src-blocks,
  org-babel-map-inline-src-blocks): Make sure to ignore case when
  looking for source blocks.

Reported-by: Christopher Genovese <genovese@cmu.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/93454>
2014-12-14 09:39:08 +01:00
Nicolas Goaziou d0c14a12fd ob-core: Tiny fix
* lisp/ob-core.el (org-babel-active-location-p): Use appropriate
  accessor.
2014-12-14 09:36:50 +01:00
Eric Abrahamsen 94c1099dab Use `org-log-into-drawer' in `org-log-beginning'
* lisp/org.el (org-log-beginning): Use existing function for
  discovering the log specification.
2014-12-14 09:13:29 +01:00
Nicolas Goaziou 4f7b6ccf39 Merge branch 'maint' 2014-12-13 22:57:35 +01:00
Nicolas Goaziou dbc988e272 ox-md: Correctly export footnote references
* lisp/ox-md.el (md): Do not ignore footnote references.

Footnotes do not exist in Markdown syntax, but we can fallback on
HTML.

Reported-by: Vasilij Schneidermann <v.schneidermann@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93447>
2014-12-13 22:55:45 +01:00
Aaron Ecay b8d790a076 org-table: introduce an upper bound on `org-table-convert-region-max-lines'.
* lisp/org-table.el (org-table-convert-region-max-lines): New
defcustom.
(org-table-convert-region): Use it.

This is useful primarily for babel results.  If a large table-like
object is returned by a code block, this function will become bogged
down in trying to read it, and hang emacs (necessitating a C-g).  This
situation most commonly arises when a :results none header has been
omitted.  With the patch, the user will not experience a hang, but
rather an error message.
2014-12-11 23:51:57 -05:00
Aaron Ecay 7c86747881 org-src: add a note about bogosity of read-only overlays
* lisp/org-src.el (org-src--make-source-overlay): Add a TODO comment.
2014-12-11 23:48:27 -05:00
Aaron Ecay 398286a00c org-src: fix two bugs
* lisp/org-src.el (org-src--edit-buffer): Construe equality for
markers properly.
(org-edit-src-save): Place point properly when writing back changes.

Thanks to Vikas Rawal for reporting:
<http://mid.gmane.org/C8148BF2-87AF-44A4-B103-6BD338DA8D96@agrarianresearch.org>
2014-12-11 23:34:35 -05:00
Aaron Ecay 9db1f7af78 ox-beamer: Don’t auto-label allowframebreaks frames; beamer forbids it.
* lisp/ox-beamer.el (org-beamer--format-frame): Don’t give a label if
allowframebreaks” is set.
2014-12-10 17:03:38 -05:00
Aaron Ecay f12e3d4589 org-table: various small fixes
* lisp/org-table.el (org-table-rewrite-old-row-references): Rename function.
(org-table-eval-formula): Update caller.
(org-table--to-generic-cell): Fix typo in string constant.
(orgtbl-to-orgtbl): Properly respect params argument.
2014-12-10 17:03:38 -05:00
Aaron Ecay 53771153a2 org-entities.el: Add safe predicates to defcustoms.
* lisp/org-entities.el (org-entities--user-safe-p): New function.
(org-entities-ascii-explanatory, org-entities-user): Add :safe predicates.
2014-12-10 17:03:38 -05:00
Aaron Ecay 2cb1324bfb ob-latex: Use htlatex by default if available.
* lisp/ob-latex.el (org-babel-latex-htlatex): Set to “htlatex” by
default.
(org-babel-execute:latex): Update to match new default.
2014-12-10 17:03:38 -05:00
Oleh Krehel 433b66f2c7 org-src: allow `org-babel-edit-prep:.*' to mark region
* lisp/org-src.el (org-edit-src-code): Let `deactivate-mark' nil.

<http://permalink.gmane.org/gmane.emacs.orgmode/93053>
2014-12-09 17:26:02 +01:00
Kyle Meyer 5d25e6e68e org-todo-yesterday: Ignore `org-use-effective-time'
* lisp/org.el (org-todo-yesterday):
* lisp/org-agenda.el (org-agenda-todo-yesterday): Ignore global
`org-use-effective-time' value.

Otherwise, if `org-use-effective-time' being nil,
`org-extend-today-until' will not be considered, resulting in the
current time being used instead of 23:59 yesterday.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93224>
2014-12-09 10:25:24 +01:00
Kyle Meyer 173b0cb6d6 org-timer.el: Merge API for the two timers
* lisp/org-timer.el (org-timer-stop): Support countdown timers in addition
to relative timers.

* lisp/org-timer.el (org-timer-cancel-timer): Remove function.

* lisp/org-timer.el (org-timer-pause-or-continue): Support countdown
timers in addition to relative timers.

* testing/lisp/test-org-timer.el: New file.

* doc/org.texi: Merge relative and countdown timer nodes.

Several previous issues are fixed with these changes.

- org-timer-set-timer and org-timer-cancel-timer did not reset
  org-timer-start-time after countdown completed.

- Because org-timer-start did not return org-timer-pause-time to nil,
  the modeline remained stuck at the paused time.

- When org-timer-start was called with a countdown timer, the modeline
  was updated for the new relative timer, but the countdown timer
  remained scheduled.

- When org-timer-pause-or-continue was called with a countdown timer
  running, the modeline was put in a paused state, but the countdown
  timer remained scheduled.

- When org-timer-stop was called with a countdown timer running, the
  timer was removed from the modeline, but the countdown timer remained
  scheduled.

- When org-timer-set-timer was called with a paused relative timer, the
  relative timer was not reset properly (org-timer-pause-time was still
  non-nil) and the modeline remained in the paused state of the relative
  timer, even though the countdown timer was scheduled with
  run-with-timer.

- Running org-timer-set-timer at the beginning of an empty buffer
  resulted in an args-out-of-range error (due to the org-get-at-eol
  call).
2014-12-09 10:13:29 +01:00
Kyle Meyer dc460fcad1 org-timer.el (org-timer): Recognize double prefix
* lisp/org-timer.el (org-timer): Follow the behavior described in the
docstring for a double prefix argument.
2014-12-09 10:09:38 +01:00
Nicolas Goaziou 8985b3de64 Fix multiple property drawers insertion with repeated tasks
* lisp/org.el (org-add-log-setup): A property drawer may be inserted
  where the note is going to be added.  Make sure the note ends after
  the drawer.

Reported-by: Bradley M. Kuhn <bkuhn@ebb.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/93199>
2014-12-08 00:31:50 +01:00
Nicolas Goaziou f212f7cf0d Make Org future-proof
* lisp/org.el (org-small-year-to-year): Do not hardcode 2037 as the
  last future year for Org.  Always foresee the next 30 years.
2014-12-07 00:01:29 +01:00
Nicolas Goaziou fb906e15d7 ox-html: Fix docstring
* lisp/ox-html.el (org-html-protect-char-alist): Fix docstring.

Reported-by: Marcin Borkowski <mbork@wmi.amu.edu.pl>
2014-12-06 22:28:19 +01:00
Nicolas Goaziou db078f4764 Fix Sparse trees properties matches
* lisp/org.el (org-cached-entry-get): Matches against properties names
  are case-insensitive.

* testing/lisp/test-org.el (test-org/match-sparse-tree): New test.

Reported-by: Puneeth Chaganti <punchagan@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93171>
2014-12-06 21:20:55 +01:00
Nicolas Goaziou c10ae1a1bb Fix 6289d8e
* lisp/org.el (org-set-regexps-and-options): Do not ignore "^:nil"
  options.
(org--setup-collect-keywords): Fix docstring.
2014-12-05 23:26:40 +01:00
Nicolas Goaziou 6d2a661fcc Do not blank a table cell after expanding a snippet
* lisp/org.el (org-self-insert-command): Do not blank a table cell if
  last command is `yas-expand'.

Thanks to Sébastien Vauban for reporting it.
<http://permalink.gmane.org/gmane.emacs.orgmode/92918>
2014-12-03 21:36:15 +01:00
Nicolas Goaziou 6289d8ecf4 Resurrect ^:{} option
* lisp/org.el (org-set-regexps-and-options,
  org--setup-collect-keywords): Check OPTIONS keywords for information
  about sub/superscript.

Reported-by: Thomas Holst <thomas.holst@de.bosch.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93117>
2014-12-03 18:48:48 +01:00
Nicolas Goaziou e1adb17ba5 Fix custom timestamps during export
* lisp/org.el (org-translate-time): Remove function.
(org-timestamp-translate): Rewrite function so it doesn't use the one
above.

* lisp/ox-ascii.el (org-ascii-clock, org-ascii-planning):
* lisp/ox-html.el (org-html-clock, org-html-planning, org-html-timestamp):
* lisp/ox-latex.el (org-latex-clock, org-latex-planning):
* lisp/ox-texinfo.el (org-texinfo-clock, org-texinfo-planning): Use
  `org-timestamp-translate' instead of `org-translate-time'.

* etc/ORG-NEWS: Document function removal.

Reported-by: Ian Barton <lists@wilkesley.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/93127>
2014-12-03 17:18:16 +01:00
Nicolas Goaziou e4727803be org-element: Interpret diary timestamps
* lisp/org-element.el (org-element-timestamp-interpreter): Interpret
  diary timestamps.
2014-12-03 17:17:00 +01:00
Nicolas Goaziou 83249b668e org-clock: Fix clocking when `org-clock-into-drawer' is a number
* lisp/org-clock.el (org-clock-find-position): Check if
  `org-clock-into-drawer' is a number when inserting the first clock.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/93128>
2014-12-03 15:24:40 +01:00
Nicolas Goaziou dcf64c7ee3 org-timer: Fix `org-timer-stop'
* lisp/org-timer.el (org-timer-stop): Do not modify
  `org-timer-current-timer', which is related to countdown timer,
  a different feature.
2014-12-02 11:47:18 +01:00
Nicolas Goaziou bbacea55f5 org-timer: Fix "No running timer" error
* lisp/org-timer.el (org-timer-stop): Do not look after
  `org-timer-current-timer', which is a variable related to countdown
  timer, whereas the function is related to relative timer.

Reported-by: Randy Smith <perlstalker@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93081>
2014-12-02 11:28:15 +01:00
Bastien Guerry 92e823c43d org.el (org-add-planning-info): Remove spurious blank line
* org.el (org-add-planning-info): Remove spurious blank line
left after "unclosing" an entry.
2014-12-01 15:36:40 +01:00
Nicolas Goaziou 5945beef05 `org-add-planning-info' need not be interactive
* lisp/org.el (org-add-planning-info): Remove interactive status.  Fix
  docstring.
2014-11-27 00:23:35 +01:00
Nicolas Goaziou 80d13fffe0 Preserve indentation when modifying planning info
* lisp/org.el (org-add-planning-info): Preserve indentation when
  modifying planning info.  Refactor code.

Thanks to Sébastien Vauban for suggesting the idea.
2014-11-27 00:23:34 +01:00
Nicolas Goaziou ae9ac316a5 Erase `org-insert-labeled-timestamps-at-point'
* lisp/org.el (org-insert-labeled-timestamps-at-point): Remove
  variable.
(org-add-planning-info): Remove reference to removed variable.

* lisp/org-agenda.el (org-agenda-schedule, org-agenda-deadline):
  Remove reference to removed variable.

* etc/ORG-NEWS (Skipping): Document removal.

Org syntax assumes planning info line is always right below the
headline.  Setting this variable to anything but nil defeats that and,
as a consequence, produces invalid planning lines.
2014-11-26 23:32:52 +01:00
Nicolas Goaziou bd3bd83092 Merge branch 'maint' 2014-11-25 09:24:02 +01:00
Karl Fogel a712cec60f org.el: Improve accuracy of message
* lisp/org.el (org-remove-file): Reword success message.

Before this change, when `org-remove-file' succeeded in removing a
file from `org-agenda-files', it would display this unduly alarming
message to the user: "Removed file: foo.org".  This made it seem as
though the file itself were removed from the filesystem, rather than
simply being delisted from `org-agenda-files'.

After this change, the message "Removed from Org Agenda list: foo.org"
is displayed instead, so the user will experience only the normal
level of panic involved in using Org Mode, not the increased panic
that results from thinking a file has been removed when it hasn't.

TINYCHANGE
2014-11-25 09:23:36 +01:00
Nicolas Goaziou 9eff31aada `org-edit-special' edits export blocks
* lisp/org.el (org-edit-special): Allow to edit export blocks.
* etc/ORG-NEWS: Document feature.
2014-11-24 00:14:13 +01:00
Nicolas Goaziou bde27ccacc org-src: Fix docstring
* lisp/org-src.el (org-src-ask-before-returning-to-edit-buffer): Fix
  docstring.  Move variable in appropriate section.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 367827f005 Fix failing test
* lisp/org.el (org-indent-region): Fix failing test.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 203bf5870f org-src: Unify source editing tools
* lisp/org-src.el (org-src-strip-leading-and-trailing-blanklines,
  org-edit-src-force-single-line, org-edit-src-picture,
  org-edit-src-from-org-mode, org-edit-src-allow-write-back-p,
  org-edit-src-beg-marker, org-edit-src-end-marker,
  org-edit-src-overlay, org-edit-src-block-indentation,
  org-edit-src-saved-temp-window-config, org-edit-src-code-timer):
  Remove variables.
(org-src--allow-write-back-p, org-src--beg-marker,
org-src--block-indentation, org-src--code-timer, org-src--end-marker,
org-src--end-marker, org-src--from-org-mode, org-src--overlay,
org-src--saved-temp-window-config, org-src--type,
org-src--babel-info): New variables.

(org-src--construct-edit-buffer-name, org-src--edit-buffer,
org-src--source-buffer, org-src--get-lang-mode, org-src--coordinates,
org-src--goto-coordinates, org-src--element-contents-area,
org-src--make-source-overlay, org-src--on-element-p,
org-src--contents-for-write-back, org-src--edit-element,
org-edit-table.el, org-edit-export-block): New functions.
(org-edit-src-find-buffer, org-src-construct-edit-buffer-name,
org-src-tangle, org-src-in-org-buffer): Remove functions.

(org-edit-src-code, org-edit-fixed-width-region, org-edit-src-abort,
org-edit-src-save): Use new functions and variables.
(org-edit-src-exit): Use new functions and variables.  Change
signature.

* lisp/org.el (org-edit-special, org-indent-line, org-indent-region):
  Use new functions and variables.

* lisp/ob-core.el (org-babel-do-in-edit-buffer): Remove useless check.
(org-babel-expand-src-block): Apply signature change.

This patches resolves discrepancies between source editing tools and
globally simplifies process (auto-save feature, region
preservation...).  It introduces export block editing.  It also moves
internal variables and functions into an appropriate namespace and
delete some unused functions.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 9c06f8cce9 org-src: Remove unused functions and variables
* lisp/org-src.el (org-edit-src-region-extra): Remove variable.
(org-edit-src-find-region-and-lang, org-edit-src-get-lang,
org-edit-src-get-label-format, org-edit-src-get-indentation,
org-src-fontify-block, org-src-fontify-buffer): Remove functions.

(org-src-font-lock-fontify-block): Remove reference to removed
function in docstring.

Remove all functions and variables related to parsing, which is now
delegated to org-element.el.  Also reorder a defcustom and
a declaration in the library.
2014-11-22 20:59:08 +01:00
Nicolas Goaziou 3953cb19b4 Merge branch 'maint' 2014-11-22 00:04:51 +01:00
Peter Moresi aa65ac35aa ob-js: Fix passing multiline variables
* lisp/ob-js.el (org-babel-js-var-to-js): Replace newline characters
  with "\n" in strings.

Let's say I have a multi-line string stored in an example block.

I want to store my CSV in an example block.

  ColA,ColB,ColC
  1,2,3
  4,5,6

I have a JavaScript function that accepts a string named 'csv' and passing in 'my-csv-data'.

  console.log(csv);

When I expand the source block I end up with:

var csv="ColA,ColB,ColC
  1,2,3
  4,5,6";
console.log(csv);

This will not execute correctly because JavaScript does not support newlines in strings.

What I want instead is:

  var csv="ColA,ColB,ColC\n  1,2,3\n  4,5,6";
  console.log(csv);

TINYCHANGE
2014-11-22 00:02:00 +01:00
Nicolas Goaziou 40f2b885f6 Open outer link on nested links
* lisp/org.el (org-open-at-point): Open outer link on nested links.

* testing/lisp/test-org.el (test-org/open-at-point/inline-image): New
  test.

Suggested-by: Daniel Bausch <bausch@dvs.tu-darmstadt.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/92796>
2014-11-20 23:35:28 +01:00
rasmus 0e52f02f2c org-entities.el: Add parallel symbol
* org-entities.el (org-entities): Add parallel symbol.

From patch proposal by Brady Trainor.

TINYCHANGE
2014-11-19 14:50:21 +01:00
Nicolas Goaziou 78773315ee Merge branch 'maint' 2014-11-18 19:46:44 +01:00
Nicolas Goaziou 4f31b68e8f org-element: Fix 'search failed ":"' error
* lisp/org-element.el (org-element-context): Fix 'search failed ":"'
  error when point is on a blank line after a keyword.

* testing/lisp/test-org-element.el (test-org-element/context): Add
  tests.
2014-11-18 19:44:46 +01:00
Nicolas Goaziou 4df091b431 Tiny refactoring
* lisp/org.el (org-entry-properties): Tiny refactoring.
2014-11-18 10:43:50 +01:00
Nicolas Goaziou 3e13ffdfb6 Fix CATEGORY property retrieval
* lisp/org.el (org-entry-properties): Fix returned CATEGORY property
  when no specific keyword is provided.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.
2014-11-18 10:27:45 +01:00
Nicolas Goaziou 4375a941cc Fix SCHEDULED property retrieval
* lisp/org.el (org-entry-properties): Fix storing SCHEDULED property
  when specific argument is not specified.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.

Reported-by: Richard Lawrence <richard.lawrence@berkeley.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/92728>
2014-11-18 10:27:36 +01:00
Nicolas Goaziou 1dfa77dee4 Fix order of TODO keywords with S-right
* lisp/org.el (org-set-regexps-and-options): Fix order of TODO
  keywords with S-right.

Thanks to Sébastien Vauban for reporting it.
<http://permalink.gmane.org/gmane.emacs.orgmode/92708>
2014-11-17 17:41:31 +01:00
Nicolas Goaziou 919722a6a6 ox-latex: Do not message "PDF file produced" for fragments
* lisp/ox-latex.el (org-latex-compile): Do not message "PDF file
  produced" for fragments.
2014-11-16 17:58:11 +01:00
Nicolas Goaziou 6b3aa71061 Fix `org-indent-line' on blank lines after a paragraph
* lisp/org.el (org--get-expected-indentation): Properly compute
  expected indentation on blank lines after a paragraph.
(org-indent-line): Update docstring.

* testing/lisp/test-org.el (test-org/indent-line): Add test.
2014-11-16 17:39:04 +01:00
Nicolas Goaziou 1452b15235 org-element: Fix docstring
* lisp/org-element.el (org-element-lineage): Fix docstring.
2014-11-16 16:49:18 +01:00
Nicolas Goaziou 409560b7f8 Merge branch 'maint' 2014-11-16 15:51:13 +01:00
Nicolas Goaziou 59111b77ef Fix `org-insert-heading'
* lisp/org.el (org-insert-heading): Fix some corner case when point is
  in an invisible list.

* testing/lisp/test-org.el (test-org/insert-heading): Add tests.

Reported-by: Luke Crook <luke@balooga.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92619>
2014-11-16 15:48:58 +01:00
Nicolas Goaziou a7e62499f2 Fix `org-return'
* lisp/org.el (org-return): Avoid false positives in function.

* testing/lisp/test-org.el (test-org/return): New test.

Thanks to Sébastien Vauban for reporting it.

<http://permalink.gmane.org/gmane.emacs.orgmode/92657>
2014-11-16 14:02:13 +01:00
Nicolas Goaziou 61ba40c371 ox: Deprecate `org-export-get-genealogy' for `org-element-lineage'
* lisp/ox.el (org-export-collect-tree-properties,
  org-export-numbered-headline-p, org-export-get-tags,
  org-export-resolve-fuzzy-link, org-export-get-ordinal,
  org-export-get-parent-headline, org-export-get-parent-element,
  org-export-get-parent-table):

* lisp/ox-ascii.el (org-ascii--current-text-width):

* lisp/ox-beamer.el (org-beamer--frame-level):

* lisp/ox-icalendar.el (org-icalendar-blocked-headline-p):

* lisp/ox-latex.el (org-latex-footnote-reference):

* lisp/ox-odt.el (org-odt--enumerate, org-odt-link--infer-description,
  org-odt-table): Use `org-element-lineage' instead of
  `org-export-get-genealogy'.
2014-11-16 13:30:33 +01:00
Nicolas Goaziou 182d61fc8f org-element: Implement `org-element-lineage'
* lisp/org-element.el (org-element-lineage): New function.

* testing/lisp/test-org-element.el (test-org-element/lineage): New
  test.
2014-11-16 13:30:33 +01:00
Nicolas Goaziou 4c4f91800e org-info: Throw an error when following an info link fails
* lisp/org-info.el (org-info-follow-link): Throw an error instead of
  a message when search fails.
2014-11-16 00:18:24 +01:00
Kim 96e1971f0f org-info: Try info index if info node is not found
* lisp/org-info.el (org-info-follow-link): Attempt index lookup if node
  lookup fails.

* doc/org.texi (External links): Update info links.

Info index is almost always finer grain than info nodes.  For example
with this change, [[info:libc#close]] brings up not only
"(libc)Opening and Closing Files" info node, but also place the cursor
on the line that documents "close" function within the node.  This is
done by looking up "close"in the index upon failing to find a node
named "close".  Hence one can now link function, variable and other
names that are in the index rather than being limited to info node
names.  Typically there are far more index items than there are node
names.  For example libc manual has about 700 nodes, but over 4000
concept, type, function, and variables index items.  More examples of
new ways to create links are shown using org.info as example

- [[info:org#org-clock-idle-time]] uses "Variable Index"
- [[info:org#org-capture]] uses "Command and Function Index".
- [[info:org#timestamp]] uses "Main Index"
- [[info:org#C-c C-c]] uses "Key Index"

TINYCHANGE
2014-11-16 00:14:29 +01:00
Nicolas Goaziou 4670b0420c Merge branch 'maint' 2014-11-16 00:10:08 +01:00
Florian Beck 685d3ba4af Replace obsolete aliases of calendar functions
* lisp/org-agenda.el (org-agenda-diary-entry): Replace obsolete functions.
2014-11-16 00:09:37 +01:00
Teika kazura acdbc34995 Let `org-read-date' respect `org-replace-disputed-keys' again
* lisp/org.el (org-read-date): Respect `org-replace-disputed-keys'.

Beginning from org-8.1, org-read-date ignores
`org-replace-disputed-keys'.  This commit restores the original
behavior.  Users who want the org-8.1 behavior should customize
`org-read-date-minibuffer-local-map' instead.

See http://thread.gmane.org/gmane.emacs.orgmode/90626/focus=91318 for
the discussion on this issue.

This commit in effect reverts a6986494a0
and e8023dde58.

TINYCHANGE
2014-11-13 21:40:19 +01:00
Nicolas Goaziou 83d8a2b16d Fix cba2f0a
* lisp/org.el (org-adapt-indentation): Update docstring.
(org-fixup-indentation): Ignore contents of source blocks and example
blocks when indentation should be preserved.

* testing/lisp/test-org.el (test-org/demote, test-org/promote): Add
  tests.
2014-11-10 20:40:03 +01:00
Nicolas Goaziou ece68a7a6f org-colview: Use regular "ITEM" property
* lisp/org-colview.el (org-columns-display-here): Use regular "ITEM"
  value instead of computing another one.  Simplify process.
  (org-columns-cleanup-item): Remove function.

* contrib/lisp/org-colview-xemacs.el (org-columns-display-here): Use
  regular "ITEM" value instead of computing another one.  Simplify
  process.  (org-columns-cleanup-item): Remove function.

* etc/ORG-NEWS: Document change.
2014-11-10 16:51:33 +01:00
Nicolas Goaziou 9309fd5d20 Add "ITEM" to special properties
* lisp/org.el (org-special-properties): Add "ITEM".  Tiny fix to
  docstring.
(org-entry-properties): Compute "ITEM" property's value.
(org-buffer-property-keys): Remove hack since "ITEM" now officially
belongs to the special properties list.

* doc/org.texi (Special properties): Document "ITEM" change.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.
2014-11-10 16:45:36 +01:00
Nicolas Goaziou 7af7edc505 Tags completion ignores narrowing
* lisp/org.el (org-get-buffer-tags): Ignore narrowing, if any.  Small
  refactoring.
2014-11-10 09:43:01 +01:00
Nicolas Goaziou 34bbb39454 Fix parser wrt to defcustom syntax related changes
* lisp/org-element.el (org-element-paragraph-separate,
  org-element--object-regexp): Turn defconst into defvar.
(org-element--set-regexps): Properly set previous variables.
(org-element-update-syntax): New function.

* lisp/org-list.el (org-plain-list-ordered-item-terminator,
  org-list-allow-alphabetical): Call new function whenever these
  variables are modified and Org is already loaded.

* lisp/org.el (org-add-link-type): Call new function since a new link
  type triggers a rebuild of syntax regexps, possibly invalidating
  cache in all Org buffers.

Reported-by: Christopher Dannheim <ch.dannheim@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92487>
2014-11-10 00:08:44 +01:00
Nicolas Goaziou 3f78abf0b0 Merge branch 'maint' 2014-11-08 21:40:59 +01:00
Mario Frasca 4c37a937a7 org-plot: Correction in callback registration
org-plot.el (org-plot/gnuplot): Correct the callback for the and
register it as soon as possible.

The data-file variable is not in the scope of the callback, one needs
to grab its value while registering the callback.  With this patch the
timer is set as soon as the file is created.  Without this patch the
timer is set at the end of a let-block, if anything goes wrong in the
let-block before the timer is set, the file will not be removed.

TINYCHANGE
2014-11-08 21:38:52 +01:00
Mario Frasca 9f28685b29 org-plot: Reset gnuplot process instead of killing it
org-plot.el (org-plot/gnuplot): Do not kill the gnuplot process. just
jump to end of buffer and rely on command to do the resetting job.

Without this patch, the gnuplot process associated to the gnuplot
buffer is killed before each batch of instructions from orgmode to
gnuplot.  With or without this patch, Org mode sends a reset
instruction to the gnuplot process as first instruction.

TINYCHANGE
2014-11-08 21:37:15 +01:00
Nicolas Goaziou cba2f0a2a3 Improve `org-promote' and `org-demote'
* lisp/org.el (org-promote, org-demote): Fix docstring.  Small
  refactoring.  Ignore narrowing.
(org-fixup-indentation): Smarter indentation: handle inlinetasks and
footnote definitions.

* testing/lisp/test-org.el (test-org/demote, test-org/promote): New
  test.

`org-called-with-limited-levels' check is removed when promoting
a top-level headline.  The motivation behind it in this particular
case wasn't clear (see 10aba6b126) and
I couldn't find a good reason to keep it.

Suggested-by: Sébastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/92450>
2014-11-08 14:40:24 +01:00
Nicolas Goaziou e80894fcc0 Silence byte-compiler 2014-11-08 10:18:42 +01:00
Nicolas Goaziou 77f088066d Silence byte-compiler 2014-11-07 21:46:08 +01:00
Nicolas Goaziou f49833293a ox: Fix "wrong type argument listp" when filtering tags
* lisp/org.el (org--setup-process-tags): Fill `org-tag-groups-alist'
  only when group tags are defined.

Reported-by: Elric Milon <emacs@whirm.eu>
<http://permalink.gmane.org/gmane.emacs.orgmode/92406>
2014-11-07 21:12:10 +01:00
Nicolas Goaziou a2f8a48ab5 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2014-11-07 00:16:42 +01:00
Leslie H. Watter d4a4fc740e ox.el: Add pt_BR translations to export engine
* lisp/ox.el: (org-export-dictionary) Add pt_BR messages to the list.

TINYCHANGE
2014-11-06 23:47:28 +01:00
Nicolas Goaziou c177d3ca9e Merge branch 'maint' 2014-11-06 19:20:13 +01:00
Nicolas Goaziou 320381990e ox-beamer: Fix undefined reference with internal links
* lisp/ox-beamer.el (org-beamer-target): Use label macro instead of
  hypertarget.

Moreover, target syntax cannot take advantage of hypertarget's second
parameter.

<http://permalink.gmane.org/gmane.emacs.orgmode/92455>
2014-11-06 19:18:34 +01:00
Nicolas Goaziou 588ec53124 Merge branch 'maint' 2014-11-04 22:25:18 +01:00
Nicolas Goaziou f8d7da4c33 ox-publish: Fix publishing components asynchronously
* lisp/ox-publish.el (org-publish): Ensure asynchronous process
  doesn't encounter :components parts in the project, as it may not
  know how to expand them.

Reported-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/92319>
2014-11-04 22:21:30 +01:00