Commit Graph

17003 Commits

Author SHA1 Message Date
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
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
Marco Wahl 4c77c462ce contrib/README: more precise doc about org-eww.el
Actually using the same wording as for org-w3m.el now.
2015-01-27 00:50:40 +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 30b0c09275 contrib: Fix error messages.
* contrib/lisp/ob-eukleides.el (org-babel-execute:eukleides):
* contrib/lisp/ob-oz.el (org-babel-execute:oz):
* contrib/lisp/ob-tcl.el (org-babel-prep-session:tcl):
(org-babel-tcl-evaluate):
* contrib/lisp/org-contacts.el (org-contacts-view-send-email):
* contrib/lisp/org-drill.el (org-drill-hide-heading-at-point):
* contrib/lisp/org-mew.el (org-mew-search):
(org-mew-capture):
* contrib/lisp/org-toc.el (org-toc-forward):
* contrib/lisp/ox-freemind.el (org-freemind--build-node-contents): Fix
formatting of error messages.
2015-01-26 02:54:17 -05: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
Achim Gratz ee01a70adb rework fix in82599d37e1 to use should-error macro
* testing/lisp/test-org-table.el: Use `should-error' instead of
  `condition-case' as that is what ERT provides for these sort of
  tests.
2015-01-25 11:20:36 +01:00
Achim Gratz 6b24ffdad9 compatibility fixes for fda70440f4
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
  Replace `cl-letf' with `letf' for compatibility with older Emacsen.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
  Also check for 'error since 'user-error is not used by older Emacsen.
2015-01-25 11:20:31 +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