Commit Graph

16821 Commits

Author SHA1 Message Date
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
Rasmus 1aad2fd6de org.texi: Consistent formatting of non-nil
* org.texi: All occurances of non-nil changed to non-@code{nil}.
2015-02-08 22:48:57 +01:00
Rasmus 41cd87ab76 org.texi: Document all predefined macros
* org.texi (Macro replacement): Document all predefined macros.
2015-02-08 22:43:25 +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 a9a9af030d org-wikinodes: Fix fontification
* contrib/lisp/org-wikinodes.el (org-wikinodes-add-to-font-lock-keywords):
  Properly install fontification mechanism.  Small refactoring.

Suggested-by: Scott Campbell <scott.campbell@uwaterloo.ca>
<http://permalink.gmane.org/gmane.emacs.orgmode/94683>
2015-02-07 22:01:38 +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 e76a541865 org-texi: Fix typo
* doc/org.texi (Timers): Fix typo.

This fixes e3bd15a8dd.
2015-02-05 17:44:48 +01:00
Nicolas Goaziou e3bd15a8dd org.texi: Fix typo
* doc/org.texi (Timers): Fix typo.

Reported-by: J. David Boyd <dboyd2@mmm.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94674>
2015-02-05 17:42:20 +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
Marco Wahl a5c4568de5 Merge branch 'maint' 2015-02-05 10:19:48 +01:00
Marco Wahl ddaa1d745c contrib/org-drill.el: update to v2.4.4 2015-02-05 10:18:15 +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 21c73e38e4 org.texi: Fix typo
* doc/org.texi (Filtering/limiting agenda items): Fix typo.
2015-02-03 21:46:22 +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
Oleh Krehel 43fe141fe3 org-download.el: Update to commit d01bdfd6 2015-02-03 19:46:05 +01:00
Nicolas Goaziou b719c10e9a org.texi: Fix typo
* doc/org.texi (Summary): Fix typo

Suggested-by: Thierry Pellé <abonnements@thierry-pelle.eu>
2015-02-03 12:19:02 +01:00
Achim Gratz aaee171921 Merge branch 'maint' 2015-02-03 09:23:58 +01:00
Achim Gratz 5542a4fd95 mk/server.mk: correct file globs for contrib/lisp 2015-02-03 09:23:20 +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
Marc-Oliver Ihm b4b16c6165 org-index.el: sorting in idle-timer; add now does updates too. 2015-01-31 21:47:05 +01:00
Charles Berry f9ab1e8ab6 testing/lisp/test-ob.el: Add `test-ob/remove-inline-result'
* testing/lisp/test-ob.el (test-ob/remove-inline-result): Check that
  whitespace in `src_emacs-lisp{1} {{{results(=1=)}}}.' is removed by
  `org-babel-remove-inline-result', and that whitespace following the
  macro (if any) is left intact.
2015-01-31 11:05:18 -08: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
Sebastien Vauban f7e68cec78 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'.
2015-01-30 18:28:05 +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
Kyle Meyer bc2c7b2fd3 Fix ORG-NEWS typo from 173b0cb6d6 2015-01-30 09:46:19 +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 90e18aed9c 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.
2015-01-29 12:05:31 -08: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