Commit Graph

1093 Commits

Author SHA1 Message Date
Nicolas Goaziou 06e144adef Merge branch 'maint' 2016-01-31 20:47:06 +01:00
Nicolas Goaziou 67efff2fd8 ob-tangle: Fix `org-babel-tangle-jump-to-org'
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Find correct
  location in the Org document.

* testing/lisp/test-ob-tangle.el (ob-tangle/jump-to-org): New test.
2016-01-31 20:38:35 +01:00
Nicolas Goaziou 7d6b8f51ec ob: Fix `org-babel-update-block-body'
* lisp/ob-core.el (org-babel-update-block-body): Correctly handle block
  indentation.
(org-babel-where-is-src-block-head): Accept an optional argument in
order to avoid parsing twice the same element.

* testing/lisp/test-ob.el (org-test-ob/update-block-body): New test.
2016-01-31 20:38:35 +01:00
Michael Brand b4105b430c org-table: Fix ranges in `orgtbl-ascii-draw'
* lisp/org-table.el (orgtbl-ascii-draw): Fix float to integer
  conversion.
* testing/lisp/test-org-table.el (test-org-table/orgtbl-ascii-draw):
  Adapt test.
2016-01-30 16:30:52 +01:00
Michael Brand 6b03fd9a86 org-table: Add test for `orgtbl-ascii-draw'
* testing/lisp/test-org-table.el (test-org-table/orgtbl-ascii-draw):
  New test.
2016-01-30 16:29:14 +01:00
Nicolas Goaziou f8c5c4825e Merge branch 'maint' 2016-01-29 00:53:58 +01:00
Nicolas Goaziou 9ab973d0a6 org-macro: Fix expansion in narrowed buffers
* lisp/org-macro.el (org-macro-replace-all): Expand macro even outside
  narrowed part of the buffer.

* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Add test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104562>
2016-01-29 00:52:49 +01:00
Nicolas Goaziou 4c2b52bd8b org-element: Do not remove TAB characters from parsed text
* lisp/org-element.el (org-element--parse-objects): Do not remove TAB
  characters from plain text.
(org-element-normalize-contents): Handle TAB characters in indentation.

* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Update test.
2016-01-26 22:53:55 +01:00
Charles Berry 27b590c395 testing/lisp/test-ob-R.el: Initialize ESS vars for :session tests
* test-ob-R.el: (test-ob-R/simple-session, test-ob-R/results-file)
  tests start sessions.  As a consequence `ess-ask-for-ess-directory'
  and `ess-history-file' are let bound to `nil' to avoid prompting for
  the startup directory and using a history file.

Bug Reported by: Achim Gratz
Subject: [Bug] Testing: ESS (*R*, R (newest)) starting data directory?
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/104424>
2016-01-24 10:08:31 -08:00
Charles Berry 3142d139fa ob-R.el: Trim extraneous newline from results
* lisp/ob-R.el: org-babel-R-evaluate-external-process and
  org-babel-R-evaluate-session trim the extraneous newlines from the
  end of R output.

* testing/lisp/test-ob-R.el: test-ob-R/results-file tests that
  `:results file' yields one line enclosed in square brackets for a
  result like "abc/def.ghi".

Fixes issue noted by Andreas Leha
Subject: [babel] return file from R
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/103658>
2016-01-19 20:10:43 -08:00
Nicolas Goaziou 1c8ed102e9 Merge branch 'maint' 2016-01-16 14:53:48 +01:00
Nicolas Goaziou 6e57a371ff Fix tags looking like plain links
* lisp/org-element.el (org-element-context): Do not look for objects
  within TODO keyword, priority cookie, comment keyword or tags.
* lisp/org.el (org-activate-tags): Fix regexp.

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

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
2016-01-16 14:50:25 +01:00
Nicolas Goaziou d85ff34086 Merge branch 'maint' 2016-01-14 09:41:22 +01:00
Nicolas Goaziou 7d0104f449 org-element: Fix footnote definition parsing
* lisp/org-element.el (org-element--footnote-separator): New variable.
(org-element-footnote-definition-parser): Handle footnotes with
affiliated keywords.

* testing/lisp/test-org-element.el (test-org-element/footnote-definition-parser):
Add test.
2016-01-14 09:40:43 +01:00
Nicolas Goaziou 6baece62fc org-feed: Fix failing test
testing/lisp/test-org-feed.el (test-org-feed/fill-template): Fix test
when called from an environment with another locale.
2016-01-13 17:08:58 +01:00
Nicolas Goaziou 2520fd654a Test `org-map-entries'
* lisp/org.el (org-make-tags-matcher): Small refactoring.
* testing/lisp/test-org.el (test-org/map-entries): New test.
2016-01-13 17:03:46 +01:00
Michael Brand 531985d21c Add ERTs for feed templates
* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Strengthen some expectations, add new tests.

* testing/lisp/test-org-feed.el: New file derived from
  testing/lisp/test-org-capture.el.
2016-01-13 08:19:23 +01:00
Kyle Meyer 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou 93c52908b6 Merge branch 'maint' 2016-01-06 14:46:36 +01:00
Nicolas Goaziou 22cf1bf7ed Throw an error when trying to set invalid properties
* lisp/org.el (org--valid-property-p): New function.
(org-entry-put):
(org-set-property): Use new function.

Suggested-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/104044>
2016-01-06 14:45:52 +01:00
Nicolas Goaziou 5e63baf92e Merge branch 'maint' 2016-01-02 17:06:53 +01:00
Nicolas Goaziou 59f00529d4 Update copyright years 2016-01-02 17:06:30 +01:00
Nicolas Goaziou e2ac979d9e ob-tangle: Fix commented links
* lisp/ob-tangle.el (org-babel-spec-to-string):
(org-babel-tangle-collect-blocks): Fix numbering and relative path of
commented links.

* testing/lisp/test-ob-tangle.el (ob-tangle/comment-links-numbering):
  New test.

Reported-by: Tobias Müller <mllertobias@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103861>
2016-01-02 17:05:00 +01:00
Nicolas Goaziou 3694450320 Fix copyright years 2016-01-02 13:36:44 +01:00
Nicolas Goaziou ad83f31318 org-pcomplete: Fix keyword and block completion
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option): Apply removal
  of `org-element-block-name-alist'.
2016-01-02 13:35:58 +01:00
Nicolas Goaziou 7dc6748452 Fix export blocks
* lisp/org-element.el (org-element-export-block-parser): Type is always
  stored in capitals.

* testing/lisp/test-ox.el (test-org-export/export-block): Add test.

Reported-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103921>
2016-01-02 11:53:24 +01:00
Nicolas Goaziou 7a4803d3ac Fix failing test
* testing/lisp/test-org-datetree.el (test-org-datetree/find-iso-week-create):
  Fix failing test.
2015-12-29 22:45:14 +01:00
Rüdiger Sonderfeld 316bc89c02 org-datetree.el: Add support for ISO week trees
* lisp/org-datetree.el (org-datetree-find-iso-date-create): New function.
(org-datetree--find-create): Support fixed text for insert.
(org-datetree-insert-line): Support fixed text for insert.
* testing/lisp/test-org-datetree.el (test-org-datetree/find-iso-date-create):
New test.

ISO week trees order dates by week and not by month.
2015-12-29 21:57:54 +01:00
Rüdiger Sonderfeld 9c382e6cf6 org-datetree.el: Code cleanup
* lisp/org-datetree.el (org-datetree--find-create): New function.
(org-datetree-find-year-create, org-datetree-find-month-create,
org-datetree-find-day-create): Removed functions
(org-datetree-find-date-create): Use `org-datetree--find-create' instead
of removed functions.  Use calendar extract functions.
(org-datetree-insert-line): Do more formatting in `format-time-string'
since we call it anyway
* testing/lisp/test-org-datetree.el (test-org-datetree/find-date-create):
  Test if new entries are put at the right place.
2015-12-29 21:57:50 +01:00
Alexey Lebedeff aca68e64bc Fix property name completion
* lisp/org-pcomplete.el (pcomplete/org-mode/prop): Add
  `ignore-malformed' argument in call to `org-buffer-property-keys'

* lisp/org.el (org-buffer-property-keys): Add support for new argument
  `ignore-malformed'.

* testing/lisp/test-org-pcomplete.el: Add new file for testing
  `pcomplete' integration.

* testing/lisp/test-org.el (test-org/buffer-property-keys): Test
  behaviour of `org-buffer-property-keys' with new `ignore-malformed'
  argument.

When property name completion is being performed, it means that we are
inside malformed property drawer that will become valid only after
successful completion. In this case in makes no sense to perform
interactive drawer repair.
2015-12-29 21:53:56 +01:00
Nicolas Goaziou 8eb318f2d0 org-footnote: Update library wrt new footnote syntax
* lisp/org-footnote.el (org-footnote-re):
(org-footnote-definition-re): Do not match [1]-like constructs.

(org-footnote): Fix typo.

(org-footnote-auto-label): Do not offer to create [1]-like constructs
anymore.

(org-footnote-new): Remove reference to obsolete value in
`org-footnote-auto-label'.

(org-footnote-at-reference-p):
(org-footnote-get-next-reference):
(org-footnote-next-reference-or-definition):
(org-footnote-goto-definition):
(org-footnote-goto-previous-reference): Use new regexp.

(org-footnote-normalize-label): Remove "fn:" prefix instead of adding
it.

(org-footnote-get-definition):
(org-footnote-all-labels):
(org-footnote-unique-label): Small refactoring.

(org-footnote-create-definition):
(org-footnote-delete-definitions):

(org-footnote--clear-footnote-section):
(org-footnote--collect-references):
(org-footnote--collect-definitions):
(org-footnote--set-label):
(org-footnote-sort): New functions.

(org-footnote-auto-adjust-maybe):
(org-footnote-action): Use new functions.  Small refactoring.

(org-footnote-renumber-fn:N): Refactor code.  Handle nested footnotes.

(org-footnote-normalize): Turn footnotes into [fn:N] construct instead
of [N].
* testing/lisp/test-org-footnote.el (test-org-footnote/delete):

(test-org-footnote/goto-definition):
(test-org-footnote/normalize): Update test

(test-org-footnote/sort):
(test-org-footnote/renumber-fn:N): New tests.

(test-org-footnote/normalize-outside-org): Remove test.
2015-12-22 16:55:17 +01:00
Nicolas Goaziou deafe56554 org-element: Ignore plain footnotes
* lisp/org-element.el (org-element--set-regexps):
(org-element-footnote-definition-interpreter):
(org-element-footnote-reference-parser):
(org-element-footnote-reference-interpreter): Do not consider [1]-like
constructs as footnotes anymore.

* lisp/ox.el (org-export-expand-include-keyword):
(org-export--prepare-file-contents): Apply changes to footnotes.

* doc/org.texi (Footnotes): Remove references to plain footnotes.

* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
(test-org-element/footnote-reference-interpreter):
* testing/lisp/test-ox.el (test-org-export/expand-include):
(test-org-export/expand-macro):
(test-org-export/get-footnote-number):
(test-org-export/collect-footnote-definitions):
(test-org-export/footnotes):
(test-org-export/fuzzy-link): Update tests.

Since it is possible to refer unambiguously to a label without the "fn:"
prefix, the latter becomes part of the syntax and no longer part of the
label.  In particular [fn:1] and [fn:label] are labelled, respectively,
"1" and "label".
2015-12-22 16:55:17 +01:00
Sacha Chua 25eb14bc2c org-protocol: Allow key=val&key2=val2-style URLs
* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Update documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like.  New-style links are of the form:
  org-protocol://store-link?title=TITLE&url=URL

* testing/lisp/test-org-protocol.el: New file.
2015-12-22 13:41:45 +01:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Nicolas Goaziou babcfaa4eb Merge branch 'maint' 2015-12-18 22:32:26 +01:00
Nicolas Goaziou 713fe873b7 org-table: Fix "$<" constructs in formulas
* lisp/org-table.el (org-table-recalculate): Expand "$<" without
  returning an error.  Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/first-rc): New test.

Reported-by: Stefan Nobis <stefan-ml@snobis.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103693>
2015-12-18 22:30:41 +01:00
Nicolas Goaziou ce4143e79d Merge branch 'maint' 2015-12-12 00:41:43 +01:00
Nicolas Goaziou 7d1a6777d0 ox: Fix uninterpreted subscript
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Fix
  un-interpreted subscript containing another object.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.

Reported-by: Yasushi SHOJI <yashi@atmark-techno.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103553>
2015-12-12 00:38:39 +01:00
Nicolas Goaziou 64aee4692a org-list: Fix sending empty lists
* lisp/org-list.el (org-list--to-generic-item): Fix sending empty lists.

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

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103462>
2015-12-08 18:45:21 +01:00
Nicolas Goaziou 9534b159e8 Merge branch 'maint' 2015-12-04 21:37:18 +01:00
Nicolas Goaziou 06c6ba4ac3 org-table: Fix named fields with TAB-indentation
* lisp/org-table.el (org-table-eval-formula): Properly parse named
  fields when indentation of current line ends with a TAB character.

* testing/lisp/test-org-table.el (test-org-table/tab-indent): New test.

Reported-by: Piotr Gajewski <pg7@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103290>
2015-12-04 21:34:40 +01:00
Marco Wahl 54f93be1d0 test-org-inlinetask: Testing inlinetasks
* testing/lisp/test-org-inlinetask.el: New file.  Testing
  `org-inlinetask-goto-end'.
2015-12-04 19:59:52 +01:00
Nicolas Goaziou 11291ffcd0 org-list: Radio lists use Org Export library
* lisp/org-list.el (org-list-to-lisp): New function.
(org-list-parse-list): Mark function obsolete.

(org-list-send-list):
(org-list-to-generic):
(org-list-make-subtree): Use new function.

(org-list-item-trim-br): Remove function.

(org-list-to-generic): Use Org Export library.
(org-list--depth):
(org-list--trailing-newlines):
(org-list--generic-eval):
(org-list--to-generic-plain-list):
(org-list--to-generic-item): New functions.

(org-list-to-latex):
(org-list-to-html):
(org-list-to-texinfo): Apply changes.  Allow parameters.
(org-list-to-subtree): Apply changes.

* lisp/org.el (org-toggle-heading):
* lisp/ob-core.el (org-babel-insert-result): Apply changes.

* doc/org.texi (Radio lists): Update documentation.

* testing/lisp/test-org-list.el (test-org-list/to-generic): New test.
2015-12-03 09:54:49 +01:00
Nicolas Goaziou bd3a2cbf2f org-capture: Prevent recursive evaluation of %(...) placeholders
* lisp/org-capture.el (org-capture-templates): Improve docstring.
(org-capture-fill-template): Prevent recursive evaluation of %(...)
placeholders.  Fix escaping of % character in templates.
* testing/lisp/test-org-capture.el: New file.

Reported-by: Thomas Preindl <thomas.preindl@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103018>
2015-11-29 16:58:14 +01:00
Nicolas Goaziou bd79085be0 Merge branch 'maint' 2015-11-26 22:57:21 +01:00
Nicolas Goaziou d85ddfba0d org-table: Fix c651e150cc
* lisp/org-table.el (org-table-get-stored-formulas): Correctly detect
  named fields in formulas' LHS.
* testing/lisp/test-org-table.el (test-org-table/named-field):
(test-org-table/named-column): New tests.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103119>
2015-11-26 22:56:06 +01:00
Nicolas Goaziou bd921f0858 Merge branch 'maint' 2015-11-12 11:29:55 +01:00
Nicolas Goaziou 53a4209003 ox: Fix comments removal
* lisp/ox.el (org-export--delete-comments): Preserve document's
  structure when removing comment lines or comment blocks.

* testing/lisp/test-ox.el (test-org-export/comments): New test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102860>
2015-11-12 11:28:13 +01:00
Nicolas Goaziou 64a602e822 Merge branch 'maint' 2015-11-11 00:41:06 +01:00