Commit Graph

1691 Commits

Author SHA1 Message Date
Nicolas Goaziou d7b203422f org-clock: Fix failing tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/maxlevel):
  Fix tests.
(test-org-clock/clocktable/tcolumns): Add test.
2017-05-27 18:15:05 +02:00
Nicolas Goaziou 75e9fdac6c org-clock: Fix number of time columns in clock table
* lisp/org-clock.el (org-clocktable-write-default): Limit number of
  time columns to the deepest headline level.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/maxlevel):
  Update tests.
2017-05-27 18:12:38 +02:00
Nicolas Goaziou 957850043a Prevent filling before a "n" macro where it could create list items
* lisp/org.el (org-fill-n-macro-as-item-nobreak-p): New function.
(org-setup-filling): Use new function.

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

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113587>
2017-05-25 12:33:16 +02:00
Nicolas Goaziou ad89390219 org-macro: Implement the "n" macro
* lisp/org-macro.el (org-macro--counter-table): New variable.
(org-macro--counter-initialize):
(org-macro--counter-increment): New functions.
(org-macro-initialize-templates): Use new functions.

* doc/org.texi (Macro replacement): Document new macro.

* testing/lisp/test-org-macro.el (test-org-macro/n):
(test-org-macro/property): New tests.
2017-05-25 12:25:13 +02:00
Nicolas Goaziou a023b31e48 Merge branch 'maint' 2017-05-23 18:15:42 +02:00
Nicolas Goaziou d6f096546e org-capture: Fix number of blank lines with :unnarrowed option
* lisp/org-capture.el (org-capture-finalize): Remove blank lines
  number fix, which only applies to narrowed capture buffers.
(org-capture-insert-template-here):
(org-capture-place-plain-text):
(org-capture-place-item):
(org-capture-place-entry): Do not hard-code number of blank lines
after entry.

Reported-by: Igor Perepelytsya <igorquail@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113093>

Reported-by: Jay Dresser <jay@jaydresser.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/113449>
2017-05-23 18:10:06 +02:00
Nicolas Goaziou 61eb86e06c Merge branch 'maint' 2017-05-22 15:28:48 +02:00
Nicolas Goaziou 7f0391cfe0 org-colview: Remove error upon summarizing non-numbers with a format string
* lisp/org-colview.el (org-columns--displayed-value): Remove check.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Remove a test.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113600>
2017-05-22 15:27:17 +02:00
Nicolas Goaziou c2f4eec5dc `org-fill-paragraph' handles region
* lisp/org.el (org-fill-element): New function.
(org-fill-paragraph): Use new function.  Also handle region, when
called interactively.

* testing/lisp/test-org.el (test-org/fill-element): Renamed from
  test-org/fill-paragraph.  Update tests.

Reported-by: Oskar Kvist <oskar.kvist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113542>
2017-05-22 15:02:34 +02:00
Nicolas Goaziou b3088eea3f Update a test
* testing/lisp/test-org.el (test-org/refile-get-targets): Update test.
2017-05-22 08:26:22 +02:00
Nicolas Goaziou 36a091fe67 Add test for `org-refile-get-targets'
* testing/lisp/test-org.el (test-org/refile-get-targets): Add test.
2017-05-22 08:21:50 +02:00
Nicolas Goaziou f335c3517d Add tests for org-refile-get-targets
* testing/lisp/test-org.el (test-org/refile-get-targets): New test.

Based on a patch from Sebastian Reuße <seb@wirrsal.net>.
2017-05-22 02:23:40 +02:00
Kyle Meyer 23ac37da7c Merge branch 'maint' 2017-05-21 14:54:59 -04:00
Kyle Meyer 0de7ad0430 org-store-link: Don't roll C-u behavior into C-u C-u behavior
* lisp/org.el (org-store-link): When a double C-u prefix argument is
given, do not reverse the meaning of the org-context-in-file-links
option.
* testing/lisp/test-org.el (test-org/store-link): Add tests.

This allows the user to fall back to the core link storing functions
without also reversing their org-context-in-file-links preference,
because wanting to do the former does not mean a user also wants to do
the latter.

Reported-by: York Zhao <gtdplatform@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00254.html>
2017-05-21 14:52:30 -04:00
Nicolas Goaziou 8b79f8c91b Merge branch 'maint' 2017-05-21 11:09:02 +02:00
Nicolas Goaziou 39b3f45a7d org-colview: Fix {X%} and {X/} on recursive summaries
* lisp/org-colview.el (org-columns--summary-checkbox-count):
(org-columns--summary-checkbox-percent): Handle own output for higher
level summaries.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.
2017-05-21 11:08:11 +02:00
Nicolas Goaziou d71e708fe3 Merge branch 'maint' 2017-05-20 22:13:12 +02:00
Nicolas Goaziou ec5df01bd8 org-colview: Properly apply operator format strings on leaf nodes
* lisp/org-colview.el (org-columns--displayed-value): When value is
a number and a format string is specified, apply it.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113547>
2017-05-20 22:11:45 +02:00
Nicolas Goaziou dbe2424b07 Adjust `org-at-timestamp-p' behavior
* lisp/org.el (org-at-timestamp-p): Change optional argument
  behaviour.  Remove interactive call.
(org-follow-timestamp-link):
(org-get-repeat):
(org-auto-repeat-maybe):
(org-time-stamp):
(org-timestamp-up-day):
(org-timestamp-down-day):
(org-toggle-timestamp-type):
(org-timestamp-change):
(org-goto-calendar):
(org-date-from-calendar):
(org-shiftup):
(org-shiftdown):
(org-shiftright):
(org-shiftleft):
(org-org-menu):
(org-fill-paragraph-with-timestamp-nobreak-p):
(org-shiftcontrolup):
(org-shiftcontroldown):
* lisp/org-agenda.el (org-agenda-date-later):
(org-agenda-date-prompt):
* lisp/org-clock.el (org-clock-timestamps-change):
* lisp/org-mouse.el (org-mouse-delete-timestamp):
(org-mouse-context-menu):
* lisp/org-table.el (org-table-copy-down): Update callers.

* testing/lisp/test-org.el (test-org/at-timestamp-p): Add tests.
2017-05-14 10:54:25 +02:00
Nicolas Goaziou cbbe00e30e org-element: Do not parse timestamps within planning line
* lisp/org-element.el (org-element-context): Do not parse timestamps
  within planning line.
* testing/lisp/test-org-element.el (test-org-element/context): Remove test.

Strictly speaking, timestamps within planning lines are parameters
values that use timestamp syntax, not real timestamps belonging to the
document contents.
2017-05-14 10:25:13 +02:00
Nicolas Goaziou b72d29d685 Merge branch 'maint' 2017-05-13 09:21:31 +02:00
Nicolas Goaziou c0369a7984 org-element: Fix $...$ fragments followed by an apostrophe
* lisp/org-element.el (org-element-latex-fragment-parser):
* lisp/org.el (org-latex-regexps): Allow an apostrophe right after
  a fragment.

* testing/lisp/test-org-element.el (test-org-element/latex-fragment-parser):
  Add test.

In Text mode, and, as a consequence, in Org mode, "'" is not treated
as punctuation, but as word constituent.  The apostrophe isn't caught
by "\s." regexp.

Reported-by: Joe Corneli <holtzermann17@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113464>
2017-05-13 09:18:07 +02:00
Nicolas Goaziou 79ac71d175 Tiny fix
* lisp/org.el (org-N-empty-lines-before-current): Insert empty lines
  before point, not after.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
2017-05-12 17:45:46 +02:00
Kyle Meyer 6fee6b6cde Merge branch 'maint' 2017-05-09 14:49:59 -04:00
Kyle Meyer f4bb79a10c Add tests for org-sort-list and org-sort-entries
* testing/lisp/test-org-list.el:
* testing/lisp/test-org.el: New test.
2017-05-09 14:49:22 -04:00
Nicolas Goaziou 93b5e5087f Merge branch 'maint' 2017-05-08 11:26:33 +02:00
Nicolas Goaziou f1da21f7d9 ob-core: Fix regression
* lisp/ob-core.el (org-babel-balanced-split): Fix regression
  introduced in 500abcd7fb.

* testing/lisp/test-ob.el (test-ob/balanced-split): Add tests.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/113401>
2017-05-08 11:25:17 +02:00
Nicolas Goaziou 6a4d3988b9 Merge branch 'maint' 2017-05-05 19:52:55 +02:00
Nicolas Goaziou cecdb2bd67 Merge branch 'maint' 2017-05-02 08:24:24 +02:00
Nicolas Goaziou 500abcd7fb ob-core: Fix `org-babel-balanced-split'
* lisp/ob-core.el (org-babel-balanced-split): Rewrite function.

Reported-by: Moritz Heidkamp <moritz@twoticketsplease.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113204>
2017-05-01 23:35:39 +02:00
Nicolas Goaziou 5bc540eae1 Merge branch 'maint' 2017-04-30 22:26:52 +02:00
Nicolas Goaziou 3502e6fa7c Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Correctly indent line
  when last element in an item is not a greater element.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2017-04-30 22:26:10 +02:00
Nicolas Goaziou 6834142d87 Merge branch 'maint' 2017-04-29 14:34:09 +02:00
Nicolas Goaziou 1332bbd616 ox: Do not trim leading and trailing blank lines from code
* lisp/ox.el (org-export-get-loc):
(org-export-unravel-code):
(org-export-format-code):
(org-export-format-code-default): Do not trim leading and trailing
blank lines from code during export.

* testing/lisp/test-ox.el (test-org-export/unravel-code): Update tests.
(test-org-export/format-code-default): Add tests.

Reported-by: Li DebugFan <debugfanli@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113205>
2017-04-29 14:32:29 +02:00
Nicolas Goaziou 2a3443f142 Merge branch 'maint' 2017-04-29 11:48:45 +02:00
Nicolas Goaziou 91236a3db3 org-src: Fix indentation when tabs are involved
* lisp/org-src.el (org-src--source-type):
(org-src--tab-width): New variables.
(org-src--edit-element): Set variables above.

(org-src--contents-for-write-back): Re-indent properly non-blank lines
before inserting contents back into the source buffer.
(org-edit-src-code): Delegate block indentation to
`org-src--contents-for-write-back'.

* testing/lisp/test-org-src.el (test-org-src/indented-blocks): New
  test.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113207>
2017-04-29 11:45:45 +02:00
Nicolas Goaziou 5e1f7ff04b ox: Ignore INCLUDE keywords in commented headlines
* lisp/ox.el (org-export-expand-include-keyword): Ignore INCLUDE
  keywords in commented headlines.
* testing/lisp/test-ox.el (test-org-export/expand-include): Add test.
2017-04-23 19:48:50 +02:00
Nicolas Goaziou 4e5bc38040 org-clock: Add test
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link): New
  test.
2017-04-17 10:03:23 +02:00
Nicolas Goaziou 0be422187f Merge branch 'maint' 2017-04-15 17:28:04 +02:00
Nicolas Goaziou 8a2ffac88a org-element: Fix radio link parser
* lisp/org-element.el (org-element--object-lex): Fix parsing of radio
  links within emphasis.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.

Reported-by: R C <recifx@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113063>
2017-04-15 17:27:01 +02:00
Nicolas Goaziou 42f24c167c Merge branch 'maint' 2017-04-15 16:52:46 +02:00
Nicolas Goaziou 74379eaaa2 Fix `org-forward-heading-same-level'
* lisp/org.el (org-forward-heading-same-level): Do not fail when
  heading is at the beginning of the buffer.
* testing/lisp/test-org.el (test-org/forward-heading-same-level): New
  test.

Reported-by: Rafael Laboissière <rafael@laboissiere.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/113084>
2017-04-15 16:51:33 +02:00
Nicolas Goaziou 926b093c16 Merge branch 'maint' 2017-04-10 21:12:47 +02:00
Skip Collins 90f5c0d1a4 Ensure test files are opened in Emacs in test-org/fuzzy-links 2017-04-10 21:12:15 +02:00
Nicolas Goaziou a126020e56 Merge branch 'maint' 2017-03-29 14:18:14 +02:00
Nicolas Goaziou 1f8cf90d2e Add test for link search
* testing/lisp/test-org.el (test-org/fuzzy-links): Add test.
2017-03-29 14:17:50 +02:00
Nicolas Goaziou 72c3c42259 Merge branch 'maint' 2017-03-27 13:36:49 +02:00
Nicolas Goaziou 4dde26f086 Fix lsearch strings with newline characters
* lisp/org.el (org-link-search): Fix regexp.
* testing/lisp/test-org.el (test-org/fuzzy-links): Add test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112876>
2017-03-27 13:34:04 +02:00
Nicolas Goaziou 0f51e643c4 Merge branch 'maint' 2017-03-23 16:46:52 +01:00
Nicolas Goaziou b791cd59a5 ox: Fix "Fix :filter-options"
* lisp/ox.el (org-export-as): Remove uninterpreted data from back-end
  specific parsed keywords.

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

This fixes 6cd42b08f9.
2017-03-23 16:46:28 +01:00
Marco Wahl 86ff112707 Merge branch 'maint' 2017-03-21 20:53:02 +01:00
Marco Wahl f50f8d0d10 test-org-agenda: Test agenda buffername when reload sticky agenda
* testing/lisp/test-org-agenda.el: One additional test to Check that
  buffer name remains the same after reload.  (BTW some cleanup.)
2017-03-21 20:42:08 +01:00
Nicolas Goaziou a9762b37dd org-clock: Add test
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/formula):
  Add test.
2017-03-19 10:59:52 +01:00
Nicolas Goaziou 36c7cfe9eb Merge branch 'maint' 2017-03-18 10:29:33 +01:00
Nicolas Goaziou b72920344f ob-exp: Fix export of src blocks with pathological name
* lisp/ob-exp.el (org-babel-exp-process-buffer): Discard false
  positives.
* testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword):
  New test.

Reported-by: Skip Collins <skip.collins@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112797>
2017-03-18 10:28:15 +01:00
Marco Wahl 3a9ac1f035 Merge branch 'maint' 2017-03-17 19:54:48 +01:00
Marco Wahl d262ae53c9 org-agenda: Fix agenda standard name when going unsticky
* lisp/org-agenda.el (org-agenda-list): Reset `org-agenda-buffer-name'
  to the original name.
* testing/lisp/test-org-agenda.el: Pertaining unit test.  + 2 basic
  agenda tests.
* testing/examples/agenda-file.org: File to produce content for an
  agenda to test.
2017-03-17 19:52:22 +01:00
Nicolas Goaziou f2e5920f41 Fix display bug when inserting a heading
* lisp/org.el (org-N-empty-lines-before-current): Do not hide newline
  character before current headline.

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

Reported-by: Rick Frankel <rick@rickster.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112751>
2017-03-16 13:01:39 +01:00
Nicolas Goaziou 10dc237eee Merge branch 'maint' 2017-03-14 18:14:32 +01:00
Nicolas Goaziou 6cd42b08f9 ox: Fix :filter-options
* lisp/ox.el (org-export--remove-uninterpreted-data): Do not modify
  communication channel.  Change "blob" to "datum".
(org-export--remove-uninterpreted-data-1): Remove function.
(org-export-as): Remove uninterpreted data from parsed keyword before
applying filters.

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

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/112730>
2017-03-14 18:10:07 +01:00
Nicolas Goaziou c41c2be339 Merge branch 'maint' 2017-03-14 09:07:55 +01:00
Nicolas Goaziou 92ee4d06a2 org-capture: Fix escaping characters in template embedded S-exps
* lisp/org-capture.el (org-capture-fill-template): Escape backslash
  characters in %i contents when those are inserted within a S-exp.
  Also prevent adding any prefix to %i contents spanning over multiple
  lines when they are inserted within a S-exp.

* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Add tests.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112232>
2017-03-14 09:03:59 +01:00
Nicolas Goaziou 33b9c42395 org-lint: Report invalid durations in effort properties
* lisp/org-lint.el (org-lint-invalid-effort-property): New checker.
* testing/lisp/test-org-lint.el (test-org-lint/invalid-effort-property):
New test.
2017-03-12 09:08:28 +01:00
Marco Wahl 38b372e143 Merge branch 'maint' 2017-03-07 17:54:54 +01:00
Marco Wahl 4108f52f36 test-org-list.el: Fix visibility tests
* testing/lisp/test-org-list.el (test-org-list/move-item-down):
  Replace several calls of `org-invisible-p2' with calls on a lower
  level.
2017-03-07 16:37:25 +01:00
Marco Wahl 5dfa6d6c47 testing/README: Added hint to 'test-dirty' 2017-03-07 11:23:57 +01:00
Nicolas Goaziou eb1847e29c org-clock: Fix failing test
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/scope):
  Fix failing test.
2017-03-06 19:31:54 +01:00
Eduardo Bellani 78bddaca1f org-clock.el: Add nullary function evaluation as a clocktable scope parameter
* lisp/org-clock.el (org-dblock-write:clocktable): Funcall the scope
  argument if it is a function.

* doc/org.texi: Document the feature of using a nullary function as the
  scope for the clocktable.

* testing/lisp/test-org-clock.el: Adds a test for the above
  feature.  Also, fix the number of hours of a test that seemed to be
  broken.

TINYCHANGE
2017-03-06 18:00:19 +01:00
Nicolas Goaziou df34657905 Merge branch 'maint' 2017-03-05 18:05:33 +01:00
Nicolas Goaziou 8dfab7be23 Fix failing tests
* testing/lisp/test-ob.el (test-ob/org-babel-insert-result): Fix
  failing tests.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/112475>
2017-03-05 18:05:02 +01:00
Nicolas Goaziou 6251c87f66 Merge branch 'maint' 2017-03-01 22:19:29 +01:00
Nicolas Goaziou a4eb60931a ob-core: Properly escape Org syntax when inserting results
* lisp/ob-core.el (org-babel-examplify-region): Escape Org syntax
  before wrapping it.

* testing/lisp/test-ob.el (test-ob/org-babel-insert-result): Add test.
  Renamed from `test-ob/org-babel-insert-result--improper-lists'.

Reported-by: D M German <dmg@turingmachine.org>
2017-03-01 22:19:04 +01:00
Nicolas Goaziou 9263bf5766 org-duration: `org-duration-to-minutes' accepts plain numbers
* lisp/org-duration.el (org-duration-to-minutes): Accept plain numbers
  for backward compatibility with `org-hh:mm-string-to-minutes'.

* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Add test.

Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112290>
2017-02-23 12:46:37 +01:00
Nicolas Goaziou b1353cb6f8 org-duration: Fix bug with decimal units
* lisp/org-duration.el (org-duration-to-minutes): Fix bug where the
  same unit with a decimal unit would be matched multiple times.
* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Fix test.
2017-02-22 19:34:44 +01:00
Nicolas Goaziou d1577d1e1b Merge branch 'maint' 2017-02-19 15:37:41 +01:00
Nicolas Goaziou 7d7c38c6b1 org-capture: Fix `org-capture-refile'
* lisp/org-capture.el (org-capture-refile): Preserve location of point
  when refiling.

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

Reported-by: Liu Hui <liuhui1610@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112202>
2017-02-19 15:37:12 +01:00
Nicolas Goaziou 35822684c1 org-clock: Refactor tests
* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents):
  Change signature.
(test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/tags):
(test-org-clock/clocktable/scope):
(test-org-clock/clocktable/maxlevel):
(test-org-clock/clocktable/formula):
(test-org-clock/clocktable/lang):
(test-org-clock/clocktable/compact):
(test-org-clock/clocktable/properties): Use updated function.
2017-02-18 20:55:40 +01:00
Nicolas Goaziou a6c318f471 org-clock: Fix missing properties in Clock table
* lisp/org-clock.el (org-clocktable-write-default): Do not ignore
  properties specified by :properties parameter.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/properties):
  New test.

The regression was introduced in b897ab722.

Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112219>
2017-02-18 20:24:51 +01:00
Nicolas Goaziou 552c5c771a org-clock: Small refactoring
* lisp/org-clock.el (org-clocktable-write-default): Small refactoring.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/compact):
  Add tests.
2017-02-18 14:54:43 +01:00
Nicolas Goaziou 542890cd3f Fix: Prevent spurious newlines when inserting a new heading
* lisp/org.el (org-insert-heading): Do not insert spurious newline
  characters when inserting a headline.

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

Reported-by: Kyle Sherman <kylewsherman@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112205>
2017-02-17 21:51:16 +01:00
Nicolas Goaziou 82c3039ce4 org-clock: Fall back to English when no translation is available
* lisp/org-clock.el (org-clock--translate): New function.
(org-clocktable-write-default): Use new function.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/lang): New
  test.
2017-02-17 15:11:55 +01:00
Nicolas Goaziou f6525e8fe4 Merge branch 'maint' 2017-02-17 13:24:06 +01:00
Nicolas Goaziou 013c0af8b0 org-lint: Add checker for empty headlines with tags
* lisp/org-lint.el (org-lint--checkers): Add checker.
(org-lint-empty-headline-with-tags): New function.

* testing/lisp/test-org-lint.el (test-org-lint/empty-headline-with-tags):
  New test.
2017-02-17 13:23:26 +01:00
Nicolas Goaziou 473ca5c86c Merge branch 'maint' 2017-02-17 08:37:55 +01:00
Fabrice Popineau b5a67ebddd Fix file:// uri handling for windows-nt and cygwin
* lisp/org-element.el (org-element-link-parser):
  Handle drive names in uri like file:///c:/dir/file

* lisp/ox.el (org-export-file-uri):
  Handle drive names in uri like file:///c:/dir/file

* testing/lisp/test-ox.el (test-org-export/file-uri):
  Generate the right uri to be tested against link exporter.
2017-02-17 08:36:00 +01:00
Nicolas Goaziou 2e32709843 Merge branch 'maint' 2017-02-13 21:32:28 +01:00
Nicolas Goaziou b897ab7223 org-clock: Fix regression in Clock table
* lisp/org-clock.el (org-clocktable-write-default): Do not raise an
  error when :maxlevel is 0.  Small refactoring.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Split
into ...
(test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/tags):
(test-org-clock/clocktable/scope):
(test-org-clock/clocktable/maxlevel):
(test-org-clock/clocktable/formula): ... these.  Add tests.

This fixes regression introduced in ccf832e83.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112091>
2017-02-13 21:28:59 +01:00
Nicolas Goaziou 5902b9c2a7 Merge branch 'maint' 2017-02-13 17:22:22 +01:00
Nicolas Goaziou 990fd09ca8 Fix some tests
* testing/lisp/test-org-element (test-org-element/link-parser): Remove
  a test.
* testing/lisp/test-org-pcomplete (test-org-pcomplete/keyword):
* testing/lisp/test-ox.el (test-org-export/file-uri): Fix tests.
2017-02-13 17:21:24 +01:00
Nicolas Goaziou b0251b747a Merge branch 'maint' 2017-02-13 16:35:32 +01:00
Nicolas Goaziou d347d85a15 org-element: Fix `org-element-insert-before'
* lisp/org-element.el (org-element-insert-before): Do not call
  `reverse' as contents might use `eq' objects.

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

Reported-by: Justin Kirby <justinkirby@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112065>
2017-02-13 16:29:54 +01:00
Nicolas Goaziou 7e8cf5f4c2 Use Org duration library
* contrib/lisp/org-depend.el (org-depend-trigger-todo): Use new
  functions.

* contrib/lisp/org-invoice.el (org-invoice-heading-info):
(org-invoice-info-to-table):
(org-invoice-list-to-table): Use new functions.

* contrib/lisp/ox-taskjuggler.el (org-taskjuggler--build-task): Use
  new functions.

* lisp/org-agenda.el (org-agenda-show-clocking-issues):
(org-agenda-format-item):
(org-agenda-filter-effort-form): Use new functions.

* lisp/org-clock.el (org-clock-get-clock-string):
(org-clock-modify-effort-estimate):
(org-clock-notify-once-if-expired):
(org-clock-out):
(org-clock-display):
(org-clock-put-overlay):
(org-clocktable-write-default): Use new functions.

* lisp/org-table.el (org-table-sort-lines): Use new functions.

* lisp/org.el (org-properties-postprocess-alist):
(org-refresh-effort-properties):
(org-set-effort):
(org-entry-properties):
(org-property-next-allowed-value): Use new functions.

(org-time-clocksum-format):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-fractional-format):
(org-time-clocksum-use-effort-durations): Declare as obsolete.  Move
to "org-compat.el".

(org-minutes-to-clocksum-string):
(org-hh:mm-string-to-minutes):
(org-duration-string-to-minutes): Declare as obsolete.  Move to
"org-compat.el".
(org-hours-to-clocksum-string): Remove function.

* lisp/org-colview.el (org-columns--collect-values): Use new
  functions.
(org-columns--duration-re): Remove variable.
(org-columns--time-to-seconds): Rename to...
(org-columns--age-to-minutes): ... this.
(org-columns--format-age): New function.
(org-columns--summary-apply-times):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Use new functions.

* testing/lisp/test-org-clock.el (test-org-clock-clocktable-contents-at-point):
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Update tests.
2017-02-13 14:41:15 +01:00
Nicolas Goaziou 1d39286183 Add tests for "org-duration.el"
* testing/lisp/test-org-duration.el: New file.
2017-02-13 14:39:40 +01:00
Nicolas Goaziou cc14aa6cfe Merge branch 'maint' 2017-02-07 17:01:10 +01:00
Nicolas Goaziou ccf832e831 org-clock: Fix clock percent
* lisp/org-clock.el (org-clocktable-write-default): Fix percent computation.
(org-clock-time%): Remove function.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Update
  test.

As a consequence of this patch, a ":formula %" doesn't generate
a TBLFM line anymore.
2017-02-07 16:52:30 +01:00
Nicolas Goaziou 693bda9e5c Remove duplicate test 2017-02-04 21:54:34 +01:00
Nicolas Goaziou 2dfafb9272 Merge branch 'master' of orgmode.org:org-mode 2017-02-04 21:52:36 +01:00
Nicolas Goaziou 6632ce537e Change `org-get-repeater' signature
* lisp/org.el (org-get-repeater): Change optional argument meaning.
* lisp/org-habit.el (org-habit-parse-todo): Apply signature change.
* testing/test-org.el (test-org/get-repeater): Add tests.
2017-02-04 21:45:35 +01:00
Nicolas Goaziou 737ada43c6 Fix "Fix `org-get-repeat'"
* lisp/org.el (org-get-repeat): Make sure matching group refers to the
  proper regexp.
* testing/lisp/test-org.el (test-org/get-repeat): New test.

The bug was introduced in aef7eef0f.
2017-02-04 21:26:17 +01:00
Marco Wahl de58e0ae33 Fix org-get-repeat
* lisp/org.el (org-get-repeat): Wrap call to save match data against
  side effects.

* testing/lisp/test-org.el (test-org/get-repeat): New test for
  `org-get-repeat'.
2017-02-04 00:19:49 +01:00
Nicolas Goaziou 9da78f3e8d Merge branch 'maint' 2017-02-03 22:04:12 +01:00
Nicolas Goaziou 6da9d0a416 Fix indentation of some elements
* lisp/org.el (org--get-expected-indentation): Tiny refactoring.
(org-indent-line): Ignore LaTex environments.
(org-indent-region): Better handling for export blocks, LaTeX
environments and example blocks.

* testing/lisp/test-org.el (test-org/indent-line):
(test-org/indent-region): Add tests.
2017-02-03 22:03:25 +01:00
Nicolas Goaziou a10ddbe2ac Add tests
* testing/lisp/test.org.el (test-org/auto-repeat-maybe):
(test-org/at-timestamp-p): New tests.
2017-02-03 00:36:05 +01:00
Nicolas Goaziou 86efe92484 Merge branch 'maint' 2017-02-01 21:02:48 +01:00
Nicolas Goaziou 73330079c0 org-table: Fix error with `org-table-get-field' at bob
* lisp/org-table.el (org-table-get-field): Do not return
  `beginning-of-buffer' error when called at beginning of buffer.

* testing/lisp/test-org-table.el (test-org-table/get-field): New test.
2017-02-01 20:56:38 +01:00
Marco Wahl 195151a153 Merge branch 'maint' 2017-01-29 16:14:29 +01:00
Marco Wahl 39682d4854 Fix: keep repeaters at rescheduling
* lisp/org.el (org--deadline-or-schedule): Removed a blank in a regexp.
* testing/lisp/test-org.el (test-org/schedule): New test.
2017-01-29 16:11:35 +01:00
Nicolas Goaziou 0ba5e35082 Merge branch 'maint' 2017-01-27 00:29:14 +01:00
Nicolas Goaziou 126a1cd7c1 Fix "APPT_WARNTIME" inheritance
* lisp/org.el (org-refresh-properties): Handle inheritance from global
  values (e.g., from "#+PROPERTY:" keyword).
(org-refresh-property): Handle property inheritance with a new
optional argument.

* testing/lisp/test-org.el (test-org/refresh-properties): New test.
2017-01-27 00:21:42 +01:00
Nicolas Goaziou 3d7c221a45 Merge branch 'maint' 2017-01-25 23:29:40 +01:00
Nicolas Goaziou 7d52a8c3cc Fix `org-schedule' with repeater
* lisp/org.el (org--deadline-or-schedule): New function.
(org-schedule):
(org-deadline): Use new function.

* testing/lisp/test-org.el (test-org/deadline):
(test-org/schedule): New tests.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111569>
2017-01-25 23:27:33 +01:00
Nicolas Goaziou 2348d18343 Merge branch 'maint' 2017-01-24 22:02:47 +01:00
Nicolas Goaziou c77b658b39 Fix `org-entry-get' with "TIMESTAMP" or "TIMESTAMP_IA"
* lisp/org.el (org-entry-properties): Fix special property value in
  current entry, do not leak into next entry.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111648>
2017-01-24 22:01:19 +01:00
Nicolas Goaziou eda4684d35 Merge branch 'maint' 2017-01-22 14:29:05 +01:00
Nicolas Goaziou 12a23d6c61 `org-entry-delete' can remove erroneous special properties
* lisp/org.el (org-entry-delete): Also remove erroneously inserted
  special properties in properties drawer.  Small refactoring.

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

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111564>
2017-01-22 14:28:02 +01:00
Nicolas Goaziou 7289293e4e ox-texinfo: Delegate "info" links handling to "org-info.el"
* lisp/org-info.el (org-info-export): Handle links when exporting to
  "texinfo" back-end.
* lisp/ox-texinfo.el (org-texinfo-link): Delegate "info" links
  handling to the function above.
2017-01-21 14:19:29 +01:00
Nicolas Goaziou dbd7d995e8 Merge branch 'maint' 2017-01-21 13:58:03 +01:00
Nicolas Goaziou 2950be040d org-info: Add tests
* testing/lisp/test-org-info.el: New file.
2017-01-21 13:56:58 +01:00
Nicolas Goaziou 37bffbb347 Merge branch 'maint' 2017-01-21 11:59:12 +01:00
Nicolas Goaziou ade36c4b50 org-element: Fix failing test
* testing/lisp/test-org-element.el (test-org-element/cache): Fix
  failing test.
2017-01-21 11:58:42 +01:00
Nicolas Goaziou 6dc6eb3b02 Fix failing test
* lisp/org.el (org-link-search): Remove priority cookie from headlines
  during a fuzzy search.  Tiny optimization.
* testing/lisp/test-org.el (test-org/get-heading): Add tests.
2017-01-19 00:22:49 +01:00
Kyle Meyer c3d67b3556 Merge branch 'maint' 2017-01-17 21:22:11 -05:00
Kyle Meyer 1fbc7a424f org-clone-subtree-with-time-shift: Fix SHIFT check
* lisp/org.el (org-clone-subtree-with-time-shift): Don't choke on a
  blank SHIFT argument.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
  test.

This fixes a regression introduced by c31462f33.
2017-01-17 21:16:24 -05:00
Kyle Meyer 4255837c92 Correct an org-clone-subtree-with-time-shift test
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Remove
  the SHIFT argument from a test case to match the intention of the
  test.
2017-01-17 21:14:33 -05:00
Marco Wahl 69b22b6590 org: Improved consistency + tests
* lisp/org.el (org-get-valid-level): The function now returns 1 for
  parameters level=0, change=1 and `org-odd-levels-only'=t.  Before
  it returned 3.
2017-01-17 23:06:56 +01:00
Nicolas Goaziou 1619aee376 Fix last commit
* lisp/org-table.el (org-table-eval-formula): Result is not always a string.
* testing/lisp/test-org-table.el (test-org-table/copy-field): Update
  test.
2017-01-17 10:19:05 +01:00
Nicolas Goaziou 985ffb13d2 Merge branch 'maint' 2017-01-17 09:53:36 +01:00
Nicolas Goaziou c31462f33e Fix `org-clone-subtree-with-time-shift'
* lisp/org.el (org-clone-subtree-with-time-shift): Fix commit
  8fc9ab83b. Small refactoring.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add
  tests.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111477>
2017-01-17 09:49:48 +01:00
Nicolas Goaziou fe9e60d61b Merge branch 'maint' 2017-01-16 22:27:24 +01:00
Nicolas Goaziou 8c08ee0f8d test-org: Add test
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add test.
2017-01-16 22:26:47 +01:00
Nicolas Goaziou 4d9857f97b Merge branch 'maint' 2017-01-14 23:25:13 +01:00
Nicolas Goaziou f0c08e3cbb Fix `org-drag-element-backward' with point just below a headline
* lisp/org.el (org-drag-element-backward): When point is on empty
  lines below a headline, call `org-move-subtree-up'.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
2017-01-14 23:23:26 +01:00
Nicolas Goaziou 343417bcdb Merge branch 'maint' 2017-01-12 14:48:53 +01:00
Nicolas Goaziou 5ada73aef6 org-element: Fix `org-element-normalize-contents'
* lisp/org-element.el (org-element-normalize-contents): Fix return
  value when any line after the first has no indentation.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
  Add test.
2017-01-12 14:33:17 +01:00
Nicolas Goaziou 7404e3d22a Merge branch 'maint' 2017-01-11 00:27:07 +01:00
Nicolas Goaziou a0409e56c3 ox: Fix comments removal during export
* lisp/ox.el (org-export--skip-p): Handle comments and comment blocks
  removal.
(org-export--delete-comments): Rename to...
(org-export--delete-comment-trees): ... this.  Now only take care of
commented trees and inlinetasks.

* testing/lisp/test-ox.el (test-org-export/comments): Add test.
(org-test-with-parsed-data): Apply renaming.
2017-01-11 00:23:53 +01:00
Nicolas Goaziou d809a604f2 ox: Fix image links
* lisp/ox.el (org-export-insert-image-links): Properly set :parent
  property.
* testing/lisp/test-ox.el (test-org-export/insert-image-links): Add
  test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111238>
2017-01-07 15:48:49 +01:00
Kyle Meyer 0d3683f2cd Merge branch 'maint' 2017-01-05 20:23:58 -05:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Nicolas Goaziou 1fac906174 Fix `org-N-empty-lines-before-current'
* lisp/org.el (org-N-empty-lines-before-current): Preserve point when
  calling the function from the beginning of a line.

* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
2017-01-02 23:21:53 +01:00
Nicolas Goaziou 2f5cd67357 ox: Speed-up some tools on tables
* lisp/ox.el (org-export-table-has-special-column-p): Tiny
  refactoring.
(org-export-table-has-header-p): Fix cache use, i.e., no longer
re-compute return value when the table is already known to have no
header.
(org-export-table-row-group):
(org-export-table-row-number): Populate cache with all the rows
whenever a row is queried.  This fixes previous quadratic behaviour.

Reported-by: Thierry Banel <tbanelwebmin@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/111131>
2017-01-01 23:58:29 +01:00
Nicolas Goaziou 8e0295a318 ox-publish: Add test
* testing/lisp/test-ox-publish.el (test-org-publish/get-project-from-filename):
  New test.
2016-12-31 12:29:32 +01:00
Nicolas Goaziou ccf2b988af ox-publish: Fix :base-extension (part 2)
* lisp/ox-publish.el (org-publish-get-base-files): Make sure to remove
  directories.
* testing/examples/pub/file.txt:
* testing/examples/pub/noextension: New files.
* testing/lisp/test-ox-publish.el (test-org-publish/base-extension):
  New test.
2016-12-29 21:48:02 +01:00
Nicolas Goaziou 35e8e5c93a `orgtbl-to-generic' speed-up
* lisp/org-element.el (org-element-class): Make it a defsubst.
* lisp/org-table.el (orgtbl-to-generic): Do not use cache when
  building Org table.  Factor out calls to Org Export functions when
  they are not necessary.
(org-table--to-generic-row): Factor out calls to Org Export functions
when they are not necessary.
* lisp/ox.el (org-export-resolve-fuzzy-link):
(org-export-table-has-header-p):
(org-export-table-row-group):
(org-export-table-cell-width):
(org-export-table-cell-alignment): Small refactoring.
(org-export-table-row-number): Add caching.

* testing/lisp/test-org-element.el (test-org-element/class): Remove
  test.
2016-12-29 19:46:31 +01:00
Nicolas Goaziou 6f6c2ea8d9 Merge branch 'maint' 2016-12-29 16:39:07 +01:00
Alexey Lebedeff 3e68d01bdd Reveal tags after setting them
* lisp/org.el (org-set-tags): Reveal newly inserted tags.
* testing/lisp/test-org.el (test-org/set-tags): New test.

Sometimes freshly added tags can be sucked into invisible outline
region (denoted by ellipsis) - and to see them you need to do the full
global visibilty cycle.
2016-12-29 16:38:38 +01:00
Nicolas Goaziou a3073a06f4 Merge branch 'maint' 2016-12-29 01:20:27 +01:00
Nicolas Goaziou 57ca9ba80a org-clock: Fix ":formula %" with disparate duration formats
* lisp/org-clock.el (org-clock-time%): Handle various duration
  formats.  Refactor code.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable): Add
  tests.

Reported-by: Andreas Mueller <lists@0x7.ch>
<http://permalink.gmane.org/gmane.emacs.orgmode/111067>
2016-12-29 01:19:00 +01:00
Nicolas Goaziou 517fed8d4d Merge branch 'maint' 2016-12-26 10:32:42 +01:00
Nicolas Goaziou 4cf56e6e89 Fix following links starting with square brackets
* lisp/org.el (org-link-search): Improve regexp.
* testing/lisp/test-org.el (test-org/fuzzy-links): Add tests.
2016-12-26 10:32:26 +01:00
Nicolas Goaziou 91dc1b34e3 ox: Add EXPORT_FILE_NAME keyword
* lisp/ox.el (org-export-output-file-name): Support EXPORT_FILE_NAME
  keyword.
* doc/org.texi (Export settings): Document new keyword.
* testing/lisp/test-ox.el (test-org-export/output-file-name): Add
  tests.
2016-12-20 17:10:46 +01:00
Nicolas Goaziou bd828e2d1c ox: Add `org-export-global-macros'
* lisp/ox.el (org-export-global-macros): New variable.
(org-export-as): Use new variable.
* doc/org.texi (Macro replacement): Document new variable.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Add tests.
2016-12-19 23:00:38 +01:00
Nicolas Goaziou aae5149d10 Add tests for `org-export-insert-image-links'
* testing/lisp/test-ox.el (test-org-export/insert-image-links): New
  test.
2016-12-19 18:02:38 +01:00
Nicolas Goaziou 83827952db ox-publish: Provide relative file in sitemap generation
* doc/org.texi (Sitemap):
* lisp/ox-publish.el (org-publish-project-alist): Document change.

(org-publish-property):
(org-publish--expand-file-name): New functions

(org-publish-get-base-files):
(org-publish-file):
(org-publish-projects):
(org-publish--sitemap-files-to-lisp):
(org-publish-sitemap):
(org-publish-find-property):
(org-publish-find-title):
(org-publish-find-date):
(org-publish-sitemap-default-entry):
(org-publish-sitemap-default): Use new functions.

* testing/lisp/test-ox-publish.el (test-org-publish/sitemap): Update
  test.
2016-12-19 17:36:19 +01:00
Nicolas Goaziou baf2e0e5ee ox-publish: Add tests
* testing/examples/pub/a.org:
* testing/examples/pub/b.org:
* testing/examples/pub/sub/c.org:
* testing/lisp/test-ox-publish.el: New files.
2016-12-19 12:19:59 +01:00
Nicolas Goaziou 45d57bb4db org-list: Implement `org-list-to-org'
* lisp/org-list.el (org-list-to-org): New function.
* testing/lisp/test-org-list.el (test-org-list/to-org): New test.
2016-12-19 12:19:58 +01:00
Nicolas Goaziou 835b8e05e5 org-list: Tweak `org-list-to-generic'
* lisp/org-list.el (org-list-to-generic): :istart, :icount, :iend
  and :isep are now called with an additional argument, the type of the
  list.  Also add a new property :ifmt.
(org-list--to-generic-item): Use new property.
(org-list-to-subtree): Adapt to new requirements for :istart and :iend.

* testing/lisp/test-org-list.el (test-org-list/to-generic): Update
  tests.
2016-12-19 12:14:48 +01:00
Nicolas Goaziou 753b90e321 org-element: Do not support nested links anymore
* lisp/org-element.el (org-element-object-restrictions):
(org-element--object-lex): Do not support nested links.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
* testing/lisp/test-org-lint.el (test-org-lint/link-to-local-file):
  Remove tests.
2016-12-17 11:35:50 +01:00
Nicolas Goaziou f5b7de222d Fix level of newly inserted headlines
* lisp/org.el (org-insert-heading): Fix level of new headline when
  creating it from a regular text line.

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

Reported-by: swflint@flintfam.org (Samuel W. Flint)
<http://permalink.gmane.org/gmane.emacs.orgmode/110842>
2016-12-15 00:15:12 +01:00
Nicolas Goaziou 4691033abb Merge branch 'maint' 2016-12-13 22:14:02 +01:00
Nicolas Goaziou 1c95729788 ox: Fix internal references when using `org-export-(data-)with-backend'
* lisp/ox.el (org-export-data-with-backend):
(org-export-with-backend): Preserve internal references once the local
back-end has been applied.

* testing/lisp/test-ox.el (test-org-export/get-reference): Add tests.
2016-12-13 22:11:41 +01:00
Nicolas Goaziou 9fb2e047d2 Split `org-emph-re' and `org-verbatim-re'
* lisp/org.el (org-set-emph-re): Refactor code.  Rip "~" and "="
  markers off `org-emph-re'.
(org-do-emphasis-faces):
(org-sort-remove-invisible): Handle both `org-emph-re' and
`org-verbatim-re'.
(org-in-verbatim-emphasis): Use `org-verbatim-re' instead of
`org-emph-re'.

* lisp/org-element.el (org-element-code-parser):
(org-element-verbatim-parser): Use `org-verbatim-re' instead of
`org-emph-re'.
* testing/lisp/test-org-element.el (test-org-element/bold-parser):

(test-org-element/code-parser):
(test-org-element/italic-parser):
(test-org-element/strike-through-parser):
(test-org-element/underline-parser):
(test-org-element/verbatim-parser): Update tests, which no longer need
to bind `org-emph-re'.
2016-12-12 22:21:17 +01:00
thibault cb33cd066d ob-plantuml: Add support for prologue and header variables
* lisp/ob-plantuml.el (org-babel-execute:plantuml) Include prologue and
  header variables to temporary file body.
(org-babel-plantuml-make-body): New function.
(org-babel-variable-assignments:plantuml): New function.

* testing/lisp/test-ob-plantuml.el: New file.
2016-12-10 12:06:04 +01:00
Nicolas Goaziou 24219e93fb Merge branch 'maint' 2016-12-10 01:02:06 +01:00
Nicolas Goaziou 00ea6a286c ob-tangle: Fix last commit
* lisp/ob-tangle.el (org-babel-tangle-single-block):
  `org-babel-expand-noweb-references' specifically needs to be run in
  the Org document so as to resolve references.
* testing/lisp/test-ob-tangle.el (ob-tangle/continued-code-blocks-w-noweb-ref):
  Make sure a failing test doesn't leave a file behind it.
2016-12-10 00:59:08 +01:00
Nicolas Goaziou c8da8529f5 `org-insert-heading' doesn't create items anymore
* lisp/org.el (org-insert-heading): Specialize function for headlines,
  not items.
(org-meta-return): Update according to new specifications above.
* lisp/org-list.el (org-insert-item): Add interactive spec.
* doc/org.texi (Structure editing): Update documentation.

* testing/lisp/test-org.el (test-org/insert-heading): Remove tests.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.
2016-12-10 00:32:15 +01:00
Nicolas Goaziou 68d8f860cd Improve blank line handling in `org-insert-heading'
* lisp/org.el (org--blank-before-heading-p): New function.
(org-insert-heading): Use previous function.  Major refactoring.

* testing/lisp/test-org.el (test-org/insert-heading):
(test-org/insert-todo-heading-respect-content): Update tests.
2016-12-10 00:32:14 +01:00
Kyle Meyer 3d80b3545e Merge branch 'maint' 2016-11-28 18:56:17 -05:00
Kyle Meyer 6983f8e8bf Issue user-error when trying to drag before first element
* lisp/org.el (org-drag-element-backward):
(org-drag-element-forward): Check that org-element-at-point returns a
non-nil value to avoid a type-error when called before first element.

* testing/lisp/test-org.el (test-org/drag-element-backward):
(test-org/drag-element-forward): Add test for when point is before
first element.  Adjust existing should-error calls to specify
user-error.
2016-11-28 18:40:43 -05:00
Nicolas Goaziou b06259357a Merge branch 'maint' 2016-11-20 09:38:13 +01:00
Nicolas Goaziou 0bdf18befd test-ob: Fix failing test on MacOS
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
  Use `expand-file-name' to prevent introducing "//" patterns in file
  name.

Reported-by: David Talmage <david.talmage@shoutpoint.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110285>
2016-11-20 09:36:42 +01:00
Nicolas Goaziou db0377ddc6 Merge branch 'maint' 2016-11-19 23:09:33 +01:00
Nicolas Goaziou 9e2dc98eef Fix error when exporting body only of an empty buffer
* lisp/ox.el (org-export-filter-apply-functions): Return empty string
  instead of nil when a filter returns the empty string.

* testing/lisp/test-ox.el (test-org-export/export-scope): Add test.
(test-org-export/filter-apply-functions): New test.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/110371>
2016-11-19 23:08:12 +01:00
Charles Berry 3b5ce449c4 Replace `org-export-babel-evaluate' with `org-export-use-babel'
* lisp/ob-exp.el (org-babel-exp-process-buffer): Change variable
  name `org-export-babel-evaluate' to `org-export-use-babel'.  Also
  change the name in its `defcustom' and set the `:safe' key.

* lisp/ox-icalendar.el (org-icalendar-export-current-agenda): Change
  variable name.

* lisp/ox.el (org-export-as): Change variable name.

* doc/org.texi (Exporting code blocks): Change variable name.  Amplify
   the explanation of what the variable does.  Add variable index entry.

* testing/lisp/test-ob-exp.el: Change variable name.

* testing/lisp/test-ob-lob.el: Change variable name.

* testing/lisp/test-ox.el: Change variable name.

Users were often confused that setting this variable to `nil' will
cause header arguments to be ignored in addition to preventing code
from being evaluated.  It is hoped that the documentation changes and
the name `org-export-use-babel' will better convey that everything
babel does can be switched off with this variable.
2016-11-13 15:29:33 -08:00
Nicolas Goaziou ebbc675bd9 Fix TODO keywords case sensitivity
* lisp/org.el (org-todo-regexp):
(org-not-done-regexp):
(org-not-done-heading-regexp):
(org-todo-line-regexp):
(org-complex-heading-regexp): Improve docstrings.

(org-insert-todo-heading):
(org-fix-position-after-promote):
(org-link-search):
(org-block-todo-from-children-or-siblings-or-parent):
(org-get-todo-state):
(org-priority):
(org-point-at-end-of-empty-headline):
* lisp/org-agenda.el (org-fix-agenda-info):
(org-agenda-get-todos):
(org-cmp-alpha):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-all-done):
* lisp/org-list.el (org-toggle-item):
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead): Bind
`case-fold-search' to nil when matching aginst one of the regexp
above.

* testing/lisp/test-org.el (test-org/fuzzy-links): Add tests.
2016-11-13 11:26:17 +01:00
Nicolas Goaziou 27b10fb265 ox: Fix duplicate internal references for same title headings
* lisp/ox.el (org-export-get-reference): Ensure different elements or
  objects generating the same search cell do not get the same internal
  reference.
* testing/lisp/test-ox.el (test-org-export/get-reference): Add test.

Reported-by: mstrey@strey.biz
<http://permalink.gmane.org/gmane.emacs.orgmode/110211>
2016-11-11 17:47:09 +01:00
Nicolas Goaziou a3c366eb98 org-colview: Fix time sum when mixing duration and H:MM:SS time
* lisp/org-colview.el (org-columns--time-to-seconds): Recognize
  a duration even when it contains a H:MM:SS part.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add test.

Reported-by: Björn Döring <bjoern@doering.io>
<http://permalink.gmane.org/gmane.emacs.orgmode/110144>
2016-11-11 12:02:34 +01:00
Nicolas Goaziou c93a17dd8a ox: Fix subtree export when starting with meta-data
* lisp/ox.el (org-export-as): Skip planning info and first property
  drawer when exporting a subtree.
* testing/lisp/test-ox.el (test-org-export/export-scope): Add test.
2016-11-11 10:17:15 +01:00
Nicolas Goaziou 9f98979ff0 org-element: Prevent parsing meta-data after blank lines
* lisp/org-element.el (org-element--current-element): Check that
  planning info and property drawers are correctly located before
  parsing them.

* testing/lisp/test-org-element.el (test-org-element/planning-parser):
(test-org-element/property-drawer-parser): Add tests.
2016-11-10 00:25:34 +01:00
Nicolas Goaziou 1dc6c4bc9c org-element: Fix inlinetask parsing
* lisp/org-element.el (org-element-headline-parser): Small refactoring.
(org-element-inlinetask-parser): Add missing :pre-blank property.  Small
refactoring.  Also fix regexp for task end.

* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
  Add test.
2016-11-09 23:30:39 +01:00
Nicolas Goaziou e8b4eeb482 Fix `org-return' on non-keyword
* lisp/org.el (org-return): Recognize non-keywords and split text
  accordingly.
* testing/lisp/test-org.el (test-org/return): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109929>
2016-10-29 00:00:32 +02:00
Nicolas Goaziou 4f9ec1adeb org-element: Fix export of LaTeX math in headlines
* lisp/org-element.el (org-element-class): Find pseudo-objects in
  secondary strings.
* testing/lisp/test-org-element.el (test-org-element/class): Add test.

This bug was introduced in 1a88cf920e.

Reported-by: Stefanos Carlström <stefanos.carlstrom@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109922>
2016-10-28 15:46:22 +02:00
Nicolas Goaziou 33f8f8adaa org-clock: Fix clock table with `file-with-archives' scope
* lisp/org-clock.el (org-dblock-write:clocktable): Small refactoring.
(org-clocktable-write-default): Avoid writing a "File" column when using
`file-with-archives' scope instead of deleting it at the end of the
process.

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

Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/109856>
2016-10-27 11:42:27 +02:00
Nicolas Goaziou a300f362a0 org-element: Fix parsing radio links
* lisp/org-element.el (org-element--object-lex): Do not re-match past
  1-character long radio links.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.

Reported-by: Daniel Clemente <n142857@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109861>
2016-10-27 00:41:19 +02:00
Nicolas Goaziou 1a88cf920e org-element: Improve support for pseudo objects and elements
* lisp/org-element.el (org-element-class): New function.
(org-element-map):
(org-element-interpret-data):
* lisp/org-footnote.el (org-footnote--allow-reference-p):
* lisp/org-src.el (org-src--on-datum-p):
* lisp/ox-odt.el (org-odt-footnote-reference):
(org-odt-table-cell):
* lisp/ox.el (org-export-data):
(org-export-expand): Use new function.

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

Using generic `org-element-class' allows to handle unknown, i.e.,
pseudo, object or element types.  It also reduces code duplication in
`org-element-interpret-data' and `org-export-data', preventing, e.g.,
bugs as the one fixed in c58e1b5.
2016-10-25 13:13:26 +02:00
Nicolas Goaziou dd670073de org-element: Fix interpreting links with % in description
* lisp/org-element.el (org-element-link-interpreter): % in description
  are confused with format string placeholders.  Escape them so as to
  fix the error.

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

Reported-by: Daniel Clemente <n142857@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109878>
2016-10-24 23:56:34 +02:00
Nicolas Goaziou c58e1b565b Fix :post-blank handling for pseudo elements and objects
* lisp/org-element.el (org-element-interpret-data):
* lisp/ox.el (org-export-data): Correctly guess if a pseudo element or
  object should be followed by spaces or blank lines.

* testing/lisp/test-ox.el (test-org-export/pseudo-objects):
(test-org-export/pseudo-elements): New tests.
2016-10-24 23:32:15 +02:00
Michael Brand 359afa6806 Fix table align when recalculating buffer tables
* lisp/org-table.el (org-table-recalculate-buffer-tables): Align all
tables in a buffer.
(org-table-iterate-buffer-tables): Align a table only once, align all
tables in a buffer.
2016-10-21 17:35:13 +02:00
Michael Brand e66298dfd9 Add test for table alignment
* testing/lisp/test-org-table.el (test-org-table/align-buffer-tables):
New test to document current behavior.
2016-10-21 17:33:13 +02:00
Michael Brand ed86b1aa3c Fix table header text in test
* testing/lisp/test-org-table.el
(test-org-table/simple-formula/with-grouping/no-title-row): Fix table
header text.
2016-10-21 17:31:45 +02:00
Nicolas Goaziou a2b1be7461 Add tests for `C-a' and `C-e'
* testing/lisp/test-org.el (test-org/beginning-of-line):
(test-org/end-of-line): Add tests.

Tests are for bug fixed in e4d4c6e1bc.
2016-10-18 09:30:50 +02:00
Nicolas Goaziou 8d2f0a4411 Fix `C-a' with visual lines and arguments
* lisp/org.el (org-beginning-of-line): Move to beginning of visual line
  when appropriate.  Fix docstring.

* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.
2016-10-15 12:00:43 +02:00
Nicolas Goaziou 45048eb783 Fix `C-e' with visible lines and arguments
* lisp/org.el (org-end-of-line): Correctly go to the end of visible
  line, when appropriate.
* testing/lisp/test-org.el (test-org/end-of-line): Add tests.
2016-10-15 11:36:09 +02:00
Nicolas Goaziou 2971c48cf1 Remove unnecessary workaround
* lisp/org.el (org-beginning-of-line): Remove unnecessary workaround for
  bug #14346.

* testing/lisp/test-org.el (test-org/beginning-of-line): Update tests.
2016-10-15 11:26:10 +02:00
Nicolas Goaziou 756bb87d81 Fix regression in `org-beginning-of-line'
* lisp/org.el (org-beginning-of-line): Leave point before any invisible
  character at column 0.  Small refactoring.
* testing/lisp/test-org.el (test-org/beginning-of-line): Add tests.

The regression was introduced in
3baf246f4f.
2016-10-13 09:41:54 +02:00
Nicolas Goaziou 05794b13b3 org-element: Add :format property to link objects
* lisp/org-element.el (org-element-link-parser): Add :format property.
  Tiny refactoring.

* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
  Add one test.  Update some others.

Since the link format is lost during parsing, the interpreter can hardly
handle nested links.  Indeed, in that case, the inner link is
interpreted as a bracket link, thus breaking the outer link.

Another option could be to guess a safe format for the link to be
interpreted. E.g.,

- any inner link could default to angle format unless it contains ">",
  it which case it would become a plain link;

- other links would have the bracket format, unless they contain "][" or
  "]]".

In any case, defining :format is less error prone and is similar to what
entities and sub/super-scripts have for curly brackets.

Reported-by: Thibault Marin <thibault.marin@gmx.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109623>
2016-10-09 09:34:26 +02:00
Nicolas Goaziou 2116162fe6 ob-core: Prevent spurious blanks lines when executing code
* lisp/ob-core.el (org-babel--insert-results-keyword):
(org-babel-where-is-src-block-result): Control better the number of
empty lines around results of a source block evaluation.

* testing/lisp/test-ob.el (test-ob/blocks-with-spaces): Add tests.
(test-ob/specific-colnames): Fix test.
2016-10-07 23:56:37 +02:00
Nicolas Goaziou 966e0bff56 Change `org-align-tags-here' into `org--align-tags-here'
* lisp/org.el (org-align-tags-here): Renamed to...
(org--align-tags-here): ... this.

This change emphasizes the fact that, as an internal function, it
shouldn't be used without special care.  This also prevents confusing
between this function and `org-set-tags' called with a non-nil ALIGN
argument.
2016-10-05 11:54:49 +02:00
Nicolas Goaziou e992a2846b Add more tests for `org-insert-heading'
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
2016-10-04 11:35:57 +02:00
Nicolas Goaziou 9d7d650cd7 ob-core: Fix hash with time stamp
* lisp/ob-core.el (org-babel-result-regexp): Fix regexp.
(org-babel--insert-results-keyword): Simplify format-string.
(org-babel--clear-results-maybe): Fix return value.

* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): Add
  tests.

Reported-by: Thomas Alexander Gerds <tag@biostat.ku.dk>
<http://permalink.gmane.org/gmane.emacs.orgmode/109418>
2016-10-01 10:30:53 +02:00
Nicolas Goaziou b3c556d83a Fix tags alignment when headline contains invisible text
* lisp/org.el (org-align-tags-here): Do not use `org-move-to-column',
  which may move point on the other side of some invisible text.
  Refactor code.

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

Reported-by: Michael Fiano <michael.fiano@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109435>
2016-09-30 00:58:21 +02:00
Nicolas Goaziou 2b22d503e1 org-table: Fix inserting a new row
* lisp/org-table.el (org-table-insert-row): Fix inserting a new row when
  the buffer doesn't end with a newline character.  Tiny refactoring.

* testing/lisp/test-org-table.el (test-org-table/next-field): New test.
2016-09-28 23:33:32 +02:00
Aaron Ecay 407b0d41a2 contrib, test suite: use assq instead of assoc for :keywords 2016-09-23 11:20:55 +01:00
Nicolas Goaziou 582233dc08 Add tests for Org Lint
* testing/lisp/test-org-lint.el: New file.
2016-09-19 00:57:20 +02:00
Nicolas Goaziou 149b8046ac `org-open-line' ignores tables at the very beginning of the document
* lisp/org.el (org-open-line): Ignore tables at the very beginning of
  the document.
* testing/lisp/test-org.el (test-org/open-line): New test.
2016-09-18 17:22:48 +02:00
thibault 2090efaed7 ob-lua.el: Update library for Org 9.0
* lisp/ob-lua.el (org-babel-lua-evaluate-external-process):
(org-babel-lua-evaluate-session): Update for Org 9.0 compatibility.

* testing/test-ob-lua.el: New file.

TINYCHANGE
2016-08-29 08:57:10 +02:00
Nicolas Goaziou a9aad1c8e1 Merge branch 'maint' 2016-08-29 00:45:07 +02:00
Nicolas Goaziou 2dfdafd35a org-table: Fix column formulas
* lisp/org-table.el (org-table-recalculate): Fix column formulas in
  tables consisting of a single row group.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/108886>
2016-08-29 00:43:38 +02:00
Nicolas Goaziou 3b3fc520aa Fix coderef handling in source blocks
* lisp/ob-core.el (org-babel--normalize-body): Do not remove coderef.
(org-babel-get-src-block-info): Add coderef label information, when
available, to the return value.
(org-babel-execute-src-block): Expand noweb and remove coderefs
non-destructively.
* lisp/ob-lob.el (org-babel-lob-get-info): Adapt to new INFO.

* testing/lisp/test-ob-exp.el (ob-export/body-with-coderef):
* testing/lisp/test-ob.el (test-ob/evaluate-body-with-coderefs): Add
  tests.

Reported-by: Thibault Marin <thibault.marin@gmx.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108888>
2016-08-28 11:56:14 +02:00
Nicolas Goaziou de24694f05 Turn org-mode into Org or Org mode
Use Org or Org mode instead of org-mode or Org-mode according to
"Documentation standards".
2016-08-23 22:13:56 +02:00
Marco Wahl 29942e6aa8 test-ob-maxima: Revert last commit
* testing/lisp/test-ob-maxima.el:
(ob-maxima/matrix-output): Remove filtering of informational output.

Credit to Leo Butler.  From his post:

    Since those informational messages are written to stdout, do

    with_stdout("/dev/null", load(numericalio))$
    write_data ....

    to muffle the messages. Note that sbcl warnings are muffled by

    :lisp (setf sb-ext::*muffled-warnings* 'warning)
2016-08-20 23:43:35 +02:00
Marco Wahl 7afd7ebff5 ob-maxima-test: Clarify matrix test
* testing/examples/ob-maxima-test.org: Suppress informational output at
  load of numericalio.  (This output made testing complicated.)
2016-08-20 23:36:41 +02:00
Marco Wahl b7b93a0c2c test-ob-maxima: Fix maxima matrix test
* testing/lisp/test-ob-maxima.el (ob-maxima/matrix-output): Remove lines
  starting with ";;" from the result of `org-babel-execute-src-block'.

This fix works around the occurance of lines like

;; loading #P"/home/b/.../numericalio/encode-decode-float.fasl"

in the output of maxima.

Maxima version: "5.38.1"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.3.6"
2016-08-20 21:48:16 +02:00
Marco Wahl b394cfd9ed ob-maxima-test: Tiny cleanup
* testing/examples/ob-maxima-test.org: Removed superfluous source block
  variable.
2016-08-20 19:33:16 +02:00
Nicolas Goaziou c0924db32c Merge branch 'maint' 2016-08-20 00:27:33 +02:00
Nicolas Goaziou 589e96321b org-clock: Fix infloop when creating a clock table
* lisp/org-clock.el (org-clock-sum): Fix infloop when first headline in
  scope has a level strictly greater than 1.

Reported-by: Yichao Woo <wooyichao@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108606>
2016-08-20 00:22:13 +02:00
Nicolas Goaziou 3771f35f80 org-src: Fix coderef regexp
* lisp/org-src.el (org-src-coderef-regexp): A coderef label cannot be
  consist of white spaces only.

* testing/lisp/test-org-src.el (test-org-src/coderef-regexp): Add test.
2016-08-18 01:04:28 +02:00
Nicolas Goaziou 48af4166fd Consider edit buffers in `org-src-coderef-regexp'
* lisp/org-src.el (org-src-coderef-format): New function
(org-src-coderef-regexp): Change signature.

* lisp/ob-core.el (org-babel--normalize-body):
* lisp/ox.el (org-export-unravel-code): Use new functions.

* testing/lisp/test-org-src.el (test-org-src/coderef-format): New test.
2016-08-17 23:43:38 +02:00
Nicolas Goaziou 8e51a88bf0 Fix indentation in tests
* testing/lisp/test-org-src.el (test-org-src/basic):
(test-org-src/empty-block):
(test-org-src/blank-line-block):
(test-org-src/preserve-tabs): Fix indentation and tab issues.
2016-08-17 23:36:32 +02:00
Nicolas Goaziou 9f47b37231 Ignore coderef labels when evaluating a code block
* lisp/ob-core.el (org-babel--normalize-body): New function.
(org-babel-get-src-block-info): Use new function.

* lisp/org-src.el (org-src-coderef-regexp): New function.
* lisp/ox.el (org-export-unravel-code): Use new function.

* testing/lisp/test-ob.el (test-ob/evaluate-body-with-coderefs): New
  test.
2016-08-08 14:04:11 +02:00
Nicolas Goaziou 406ad6eb52 `org-get-heading' is more consistent on empty headlines
* lisp/org.el (org-get-heading): Ensure that return value is always
  a string.
* testing/lisp/test-org.el (test-org/get-heading): Add tests.

Reported-by: Joe Schafer <joesmoe10@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108559>
2016-07-30 22:30:19 +02:00
Nicolas Goaziou 6277246a74 test-ob: Fix test
* testing/lisp/test-ob.el (test-ob/multi-line-header-arguments): Fix test.
2016-07-25 16:14:17 +02:00
Nicolas Goaziou 14c51bae5f org-test: Require cl-lib in interactive tests
* testing/org-test.el: Require `cl-lib'.  Remove support for Emacs 22.
(org-test-string-exact-match): Fix docstring.
2016-07-25 16:11:51 +02:00
Nicolas Goaziou 72461eaeaf Use `string-match-p' instead of `org-string-match-p'
* contrib/lisp/org-contacts.el (org-contacts-filter):
(org-contacts-complete-group):
(org-contacts-complete-tags-props):
* contrib/lisp/org-wl.el (org-wl-open):
* contrib/lisp/ox-bibtex.el (org-bibtex-merge-contiguous-citations):
* lisp/ob-core.el (org-babel-demarcate-block):
* lisp/ob-processing.el (org-babel-processing-view-sketch):
* lisp/ob-stan.el (org-babel-execute:stan):
* lisp/org-agenda.el (org-agenda-get-category-icon):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-element.el (org-element-link-parser):
* lisp/org-lint.el (org-lint-orphaned-affiliated-keywords):
(org-lint-invalid-babel-call-block):
(org-lint-colon-in-name):
* lisp/org-list.el (org-list-item-body-column):
* lisp/org-macro.el (org-macro-replace-all):
* lisp/org-plot.el (org-plot/gnuplot-script):
* lisp/org-table.el (org-table-export):
(org-table-align):
(org-table-get-range):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-formula-substitute-names):
(org-table-show-reference):
(orgtbl-to-texinfo):
(org-table-remote-reference-indirection):
* lisp/org.el (org-make-link-string):
(org--open-elisp-link):
(org-open-at-point):
(org-store-log-note):
(org-cached-entry-get):
(org--valid-property-p):
(org-entry-properties):
(org-buffer-property-keys):
(org-insert-drawer):
(org-display-inline-images):
(org-in-commented-heading-p):
* lisp/ox-ascii.el (org-ascii-keyword):
* lisp/ox-beamer.el (org-beamer--format-frame):
* lisp/ox-html.el (org-html-keyword):
* lisp/ox-latex.el (org-latex--label):
(org-latex-headline):
(org-latex-item):
(org-latex-keyword):
(org-latex--inline-image):
(org-latex-src-block):
* lisp/ox-odt.el (org-odt-styles-dir):
(org-odt-keyword):
(org-odt--translate-latex-fragments):
* lisp/ox-texinfo.el (org-texinfo-template):
(org-texinfo-keyword):
(org-texinfo-src-block):
* lisp/ox.el (org-export-inline-image-p):
(org-export-file-uri):
* testing/lisp/test-org-table.el (test-org-table/to-generic):
(test-org-table/to-latex):
(test-org-table/to-html):
(test-org-table/named-field):
(test-org-table/named-column):
(test-org-table/tab-indent):
(test-org-table/first-rc):
(test-org-table/last-rc): Use `string-match-p' instead of
`org-string-match-p'.
2016-07-25 15:21:12 +02:00
Nicolas Goaziou 47138a986e org-table: Fix calculations with locale specific time-stamps
* lisp/org-table.el (org-table-eval-formula): Fix calculations with
  locale specific time-stamps.
* testing/lisp/test-org-table.el (test-org-table/time-stamps): New test.

Reported-by: "Ulrich J. Herter" <ujh@posteo.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/108165>
2016-07-21 11:49:15 +02:00
John Kitchin 9bc2940034 Create `org-link-parameters'
* lisp/org-element.el: Replace `org-link-types' variable with
  `org-link-types' function.

* lisp/org.el: Replace the `org-link-types' variable with
  `org-link-types' function. Create `org-link-get-parameter' and
  `org-link-set-parameters' functions. Remove `org-add-link-type'. Add
  `org-store-link-functions' function and remove
  `org-store-link-functions' variable. Add `org--open-file-link' for use
  as a :follow function for file type links.

* lisp/org.el: Set :follow functions for file links in `org-link-parameters.
Define `org-open-file-link' that opens a file link with an app.

* testing/lisp/test-ox.el: Remove usage of the `org-link-types'
  variable.

* lisp/org-compat.el: Move `org-add-link-type' and mark it as obsolete.

* lisp/ox.el: Change org-add-link-type comment in ox.el.
2016-07-18 22:47:42 +02:00
Nicolas Goaziou 610ec90cf4 Move `org-toggle-item' in "org-list.el"
* lisp/org.el (org-toggle-item): Move function ...
* lisp/org-list.el (org-toggle-item): ... here.

* testing/lisp/test-org-list.el (test-org-list/toggle-item): New test.
2016-07-04 23:52:40 +02:00
Nicolas Goaziou f38f83b4f1 Remove deprecated syntax for Babel properties
* doc/org.texi (Header arguments in Org mode properties): Remove
  reference to deprecated syntax.
* lisp/ob-core.el (org-babel-params-from-properties): Ignore deprecated
  syntax.
* testing/examples/babel.org:
* testing/examples/normal.org:
* testing/examples/ob-header-arg-defaults.org:
* testing/examples/property-inheritance.org:
* testing/lisp/test-ob-header-arg-defaults.el
(test-ob-header-arg-defaults/global/noweb):
(test-ob-header-arg-defaults/global/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
(test-ob-header-arg-defaults/tree/overwrite/noweb):
(test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/accumulate/noweb):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/complex/noweb):
* testing/lisp/test-ob.el (test-ob/elisp-in-header-arguments):
* testing/lisp/test-property-inheritance.el
(test-org-property-accumulation-overwrite-use): Update syntax.
(test-org-property-accumulation-append-use): Use new syntax.
(test-org-property-accumulation-top-val)
(test-org-property-accumulation-overwrite-val)
(test-org-property-accumulation-append-val): Remove tests.
2016-07-04 00:41:56 +02:00
Nicolas Goaziou adcaf91648 Mark `org-link-escape-browser' as obsolete
* lisp/org-compat.el (org-link-escape-browser): Make function an alias
  for `url-encode-url'.
* lisp/org.el (org-link-escape-chars-browser): Remove variable.
(org-link-escape-browser): Remove function.
(org-open-at-point):
* lisp/ox-html.el (org-html-link): Use `url-encode-url'.
* testing/lisp/test-org.el(test-org/org-link-escape-chars-browser):
  Remove test.
2016-07-01 12:00:23 +02:00
Nicolas Goaziou f0ff257fa7 Merge branch 'maint' 2016-06-28 00:31:09 +02:00
Nicolas Goaziou 07de65e1ea ox: Small fix
* lisp/ox.el (org-export--missing-definitions): Fix typo and remove
  useless comment
* testing/lisp/test-ox.el (test-org-export/footnotes): Add test.
2016-06-28 00:28:47 +02:00
Nicolas Goaziou 8285ff4cf2 Merge branch 'maint' 2016-06-28 00:24:50 +02:00
Nicolas Goaziou 5e37a5c116 ox: Fix export of footnote definitions in pruned parts of tree
* lisp/ox.el (org-export--missing-definitions):
(org-export--install-footnote-definitions): New functions
(org-export--merge-external-footnote-definitions): Remove function
(org-export-as):
(org-export--prune-tree): Use new functions.
* testing/lisp/test-ox.el (test-org-export/footnotes): Add tests.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107940>
2016-06-27 23:57:42 +02:00
Michael Brand 994e9ebf0b Update testing/README
* testing/README: Minor update, add how to run several tests.
2016-06-25 17:08:23 +02:00
Michael Brand 4b2aa43ce6 ERT: Spreadsheet references more sensitive
* testing/lisp/test-org-table.el:
(test-org-table/org-table-convert-refs-to-an/1):
(test-org-table/org-table-convert-refs-to-rc/1): Row and column number
different.
2016-06-25 17:06:12 +02:00
Nicolas Goaziou 411524a31c Merge branch 'maint' 2016-06-22 22:38:07 +02:00
Nicolas Goaziou 85dd02b0dd ox: Fix export of empty footnote definitions outside scope
* lisp/ox.el (org-export-get-footnote-definition): When a definition is
  empty, but does exist, return the empty string instead of raising an
  error.
* testing/lisp/test-ox.el (test-org-export/get-footnote-definition): New
  test.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107873>
2016-06-22 22:34:53 +02:00
Nicolas Goaziou 4f63cfabb3 Deprecate `org-babel-trim' in favor of `org-trim'
* lisp/org.el (org-trim): Add optional argument.

* contrib/lisp/ob-mathematica.el (org-babel-execute:mathematica):
* contrib/lisp/org-bibtex-extras.el (obe-html-export-citations):
* contrib/lisp/org-mime.el (org-mime-compose):
* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-parse-multiple-vars):
(org-babel-read-element):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
(org-babel-trim): Mark obsolete.
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ref.el (org-babel-ref-split-args):
* lisp/ob-ruby.el (org-babel-ruby-evaluate):
* lisp/ob-shell.el (org-babel-sh-evaluate):
* lisp/ob-table.el (org-sbe):
* lisp/ob-tangle.el (org-babel-spec-to-string):
* lisp/org-bibtex.el (org-bibtex-get):
* testing/lisp/test-ob.el (test-ob/parse-header-args): Use `org-trim'
  instead of `org-babel-trim'.
2016-06-21 15:33:00 +02:00
Nicolas Goaziou cfaf0d54d7 ox: Remove `org-export-execute-babel-code'
* lisp/ox.el (org-export-execute-babel-code): Remove function.
(org-export-as): Replace previous function with
`org-babel-exp-process-buffer'.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Change signature.
  Copy buffer before evaluating code.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-export/export-with-results-before-block):
(ob-export/export-src-block-with-switches):
(ob-export/export-src-block-with-flags):
(ob-export/export-and-indentation):
(ob-export/export-under-commented-headline):
(ob-export/reference-in-post-header):
(ob-export/babel-evaluate):
(org-test-with-expanded-babel-code):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
(test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export): Apply
change.

This patch merges `org-export-execute-babel-code' within
`org-babel-exp-process-buffer', removing one level of indirection.  Now,
all the Babel evaluation is on the Babel side.
2016-06-18 22:11:14 +02:00
Nicolas Goaziou ee7ca3cc43 org-list: Allow multiple receiver locations for radio lists
* lisp/org-list.el (org-list-send-list): Allow multiple receiver
  locations.
* testing/lisp/test-org-list.el (test-org-list/send-list): Add test.
2016-06-17 10:19:07 +02:00
Nicolas Goaziou 3781a3dbbd org-table: Allow multiple receiver locations for radio tables
* lisp/org-table.el (orgtbl-send-replace-tbl): Allow multiple receiver
  locations.
* testing/lisp/test-org-table.el (test-org-table/send-region): Add test.
2016-06-17 10:05:40 +02:00
Nicolas Goaziou c3b42e917f ob: Remove `org-babel-lob-execute'
* lisp/ob-lob.el (org-babel-lob-execute): Remove function
(org-babel-lob-execute-maybe):
* lisp/ob-ref.el (org-babel-ref-resolve):
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/global/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
(test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/named-caching-call-line):
(test-ob-lob/caching-call-line):
(test-ob-lob/call-with-header-arguments): Apply removal.
2016-06-16 23:37:40 +02:00
Nicolas Goaziou dbb375fdfc Simplify Babel calls evaluation
* lisp/ob-lob.el (org-babel-default-lob-header-args): Merge value with
  `org-babel-default-header-args' since this variable is meant to
  replace the latter.
(org-babel-lob-ingest): Make sure `org-babel-default-lob-header-args' is
used instead of `org-babel-default-header-args'.
(org-babel-lob--src-info): New function.
(org-babel-lob-get-info): Use new function.  Make return value
a replacement for `org-babel-get-src-block-info'.
(org-babel-lob-execute): Use `org-babel-execute-src-block' instead of
duplicating functionalities.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply changes to
  `org-babel-lob-get-info' return value.

* testing/examples/ob-header-arg-defaults.org:
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line): Update tests.

The purpose of this commit is to make Babel calls more
predictable (e.g., wrt property inheritance) and to remove code
duplication.  Also, Babel calls results are no longer treated as Emacs
Lisp values.
2016-06-16 23:15:01 +02:00
Marco Wahl 613b27795b Follow compiler recommendation
* testing/org-test.el (org-test-load): Switch to the seasonable
  `cl-flet'.
2016-06-14 21:26:11 +02:00
Charles Berry dd944fb590 org-babel-goto-named-src-block bugfix
* lisp/ob-core.el (org-babel-goto-named-src-block): The user prompt
  (i.e. `initial-input' arg of `completing-read') will be the name of
  the results block, noweb reference, call reference, or symbol if
  point is in such.

* testing/lisp/test-ob.el (test-ob/goto-named-src-block): Simulate
  interactive use of `org-babel-goto-named-src-block'.
2016-06-14 09:40:35 -07:00
Nicolas Goaziou 65e4370d46 Merge branch 'maint' 2016-06-11 13:40:52 +02:00
Nicolas Goaziou c792d694b7 Fix typo in test
* testing/lisp/test-org.el (test-org/deadline-close): Fix typo.
2016-06-11 13:36:45 +02:00
Nicolas Goaziou 819cdb3a09 Preserve list visibility when inserting a new item
* lisp/org.el (org-insert-heading): Do not reveal gratuitously too much
  context before inserting an item.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.

Reported-by: Steinar Bang <sb@dod.no>
<http://permalink.gmane.org/gmane.emacs.orgmode/107665>
2016-06-11 13:33:50 +02:00
Nicolas Goaziou 0603f42cb7 org-element: Fix inline src blocks parameter syntax
* lisp/org-element.el (org-element--parse-paired-brackets): New function.
(org-element-inline-babel-call-parser):
(org-element-inline-src-block-parser): Use new function.

* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add test.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107629>
2016-06-10 23:42:50 +02:00
Marco Wahl 7e57cf5d40 org: Fix tags extraction
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to
  match all tags (and not just the last.)
* testing/lisp/test-org.el (test-org/tags-at): One test to cover the
  issue.
2016-06-09 10:06:14 +02:00
Nicolas Goaziou 480d3523bc org-element: Fix failing test
* testing/lisp/test-org-element.el (test-org-element/link-parser): Fix
  failing test.  The bug was introduced in 827413e.
2016-06-04 21:48:02 +02:00
Nicolas Goaziou daa11e13de Fix a test 2016-06-04 21:27:55 +02:00
Nicolas Goaziou 827413ef2f Silence byte-compiler in "testing/" 2016-06-04 21:12:30 +02:00
Don March bd49486db9 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:45:41 +02:00
Don March 42620c1efa Rename org-deadline-is-close to have -p suffix
* lisp/org-agenda.el
  (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
* lisp/org.el (org-deadline-close): Rename to...
  (org-deadline-close-p): ...this.

* testing/lisp/test-org.el (test-org/deadline-close): Rename to...
  (test-org/deadline-close-p): ...this.
2016-06-04 20:39:15 +02:00
Don March 43b5ca1626 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:39:15 +02:00
Nicolas Goaziou 3fd361eb77 Merge branch 'maint' 2016-06-02 13:33:34 +02:00
Yasushi SHOJI 5111c3a5fa Add tests for tag width calculation
* testing/lisp/test-org.el (test-org/tag-align): New test.
2016-06-02 13:31:54 +02:00
Nicolas Goaziou ecf20715e2 Merge branch 'maint' 2016-06-01 14:54:20 +02:00
Nicolas Goaziou 1f3d72e8b4 Fix TODO case-sensitivity in `org-get-heading'
* lisp/org.el (org-get-heading): Prevent removing false-positive TODO
  keywords due to case-insensitivity.
* testing/lisp/test-org.el (test-org/get-heading): New test.
2016-06-01 14:49:59 +02:00
Nicolas Goaziou 11d6ebc60f Fix `org-in-regexp'
* lisp/org.el (org-in-regexp): Fix VISUALLY optional argument.  Also
  prevent useless searches past the point.  Improve docstring.

* testing/lisp/test-org.el (test-org/in-regexp): New test.
2016-05-31 23:34:14 +02:00
Nicolas Goaziou 21ba5f510e Refuse to follow link right after the link
* lisp/org.el (org-open-at-point):
(org-return): Refuse to follow link right after the link.

* testing/lisp/test-org.el (test-org/return): Add tests.
(test-org/coderef):
(test-org/custom-id):
(test-org/fuzzy-links): Update tests.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102054>
2016-05-31 23:34:00 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Nicolas Goaziou 96cfef229d ox: Small refactoring
* lisp/ox.el (org-export-get-loc): Refactor code.  Speed-up processing
  when the element doesn't require line numbering.
* testing/lisp/test-ox.el (test-org-gen-loc-list): Reformat code.
2016-05-24 21:40:43 +02:00
Brian Carlson af8e3d84ee ox: Provide offset to [+-]n in SRC/EXAMPLE export
* lisp/org-element.el (org-element-example-block-parser): Use cons cell
  for :number-lines specifying offset in addition to type (new/continue).
  ('continue . offset) for :number-lines will add this offset count to
  the last line number. ('new . offset) for :number-lines will reset the
  line number counting starting at offset
(org-element-src-block-parser): same for SRC block as EXAMPLE block

* lisp/ox-html.el (org-html-format-code):
* lisp/ox-latex.el (org-latex-src-block):
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-resolve-coderef):
(org-export-get-loc):
(org-export-format-code-default):
* contrib/lisp/ox-groff.el (org-groff-src-block): Use new cons cell
  for :number-lines.

* testing/lisp/test-ox.el  (ert-deftest test-org-export/get-loc): Tests for
changes
(test-org-gen-loc-list): Helper function for `test-org-export/get-loc'.
2016-05-24 21:40:35 +02:00
Nicolas Goaziou 0a98500363 Fix `org-open-at-point' tests
* testing/lisp/test-org.el (test-org/open-at-point-in-keyword):
(test-org/open-at-point-in-property):
(test-org/open-at-point-in-comment):
(test-org/open-at-point/inline-image): Simplify tests so as to not rely
on info.

(test-org/open-at-point/info): Remove test as it fails on the build bot.
2016-05-20 21:59:50 +02:00
Nicolas Goaziou 2d846210eb Implement conditional case-fold search in org-occur
* lisp/org.el (org-occur-case-fold-search): New variable.
(org-occur): Use new variable.

* testing/lisp/test-org.el (test-org/occur): Add tests.
2016-05-20 14:04:04 +02:00
Nicolas Goaziou a540e894b6 org-element: Properly unescape data in export blocks
* lisp/org-element.el (org-element-export-block-parser): Remove commas
  in export blocks.
* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
  Add test.
2016-05-13 17:55:30 +02:00
Nicolas Goaziou b687cf37a5 Merge branch 'maint' 2016-05-11 18:46:28 +02:00
Nicolas Goaziou ee5d40b001 org-clock: Fix `org-clock-drawer-name'
* lisp/org-clock.el (org-clock-drawer-name): When
  `org-clock-into-drawer' is a number and `org-log-into-drawer' is t,
  default to "LOGBOOK".

* testing/lisp/test-org-clock.el (test-org-clock/into-drawer):
(test-org-clock/drawer-name): New tests.
2016-05-11 18:44:02 +02:00
Nicolas Goaziou 8127b3c30d Merge branch 'maint' 2016-05-05 13:15:34 +02:00
Nicolas Goaziou 83e373f109 Fix `org-occur' when regexp matches a single char
* lisp/org.el (org-occur): Fix infloop when regexp matches a single
  char.  Improve docstring.

(org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Match correct object since point may be at the
beginning of the next one.

* testing/lisp/test-org.el (test-org/occur): New test.
2016-05-05 12:59:46 +02:00
Nicolas Goaziou 590cb1227a Merge branch 'maint' 2016-05-01 01:30:57 +02:00
Nicolas Goaziou af853dd3aa Fix `org-flag-drawer' with optional argument
* lisp/org.el (org-flag-drawer): Do not require point to be at a drawer
  in order to call the function with an optional argument.

* testing/lisp/test-org.el (test-org/flag-drawer): Narrow test.
2016-05-01 01:27:30 +02:00
Nicolas Goaziou bb034dfe04 `org-show-context' always displays point
* lisp/org.el (org-show-set-visibility): Always show point, even when it
  is hidden in a block or a drawer.

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

Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106744>
2016-05-01 01:14:10 +02:00
Nicolas Goaziou ec615b192d Fix `org-export-babel-evaluate' handling
* lisp/ob-exp.el (org-babel-exp-process-buffer): Handle
  `org-export-babel-evaluate' handling.
(org-babel-exp-results): Ignore `org-export-babel-evaluate' since it is
handled as a higher level.

* lisp/ox.el (org-export-as): Allow to short-circuit babel evaluation if
  `org-export-babel-evaluate' is nil.

* testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): New test.

Reported-by: Nicolas Richard <nrichard@ulb.ac.be>
<http://permalink.gmane.org/gmane.emacs.orgmode/106767>
2016-04-28 17:29:14 +02:00
Nicolas Goaziou bbf5b455c6 Fix failing test
* testing/lisp/test-ox.el (test-org-export/get-reference): Fix failing
  test.
2016-04-28 16:55:24 +02:00
Nicolas Goaziou 1daac70fc5 Merge branch 'maint' 2016-04-26 21:03:45 +02:00
Nicolas Goaziou e818699113 Fix storing links to headlines containing multiple links
* lisp/org.el (org-store-link): Fix storing links to headlines
  containing multiple links.

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

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106606>
2016-04-26 20:59:33 +02:00
Nicolas Goaziou 4743d43dd8 Properly handle `org-tag-persistent-alist'
* lisp/org.el (org-current-tag-alist): New variable.
(org-set-tags):
(org-global-tags-completion-table):
(org-agenda-prepare-buffers): Use new variable.
(org-set-regexps-and-options): Use new variable.  Handle STARTUP early
so that "#+STARTUP: noptag" is taken into consideration.

* lisp/org-agenda.el (org-agenda-bulk-action): Use new variable.

* lisp/org-mobile.el (org-mobile-create-index-file): `org-tag-alist' is
  no longer buffer-local.

* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
  tests.
2016-04-18 18:07:40 +02:00
Nicolas Goaziou 74d3bd484f Factorize tags parsing
* lisp/org.el (org-tag-string-to-alist):
(org-tag-alist-to-string):
(org-tag-alist-to-groups): New functions.
(org-set-regexps-and-options): Use new functions.

(org--setup-process-tags): Remove function.

(org--setup-collect-keywords): Return tag groups as a string instead of
a list so as to be compatible with new functions.

* lisp/org-mobile.el (org-mobile-create-index-file): Use new functions.

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags): Use new
  functions.
(pcomplete/org-mode/tag): Small refactoring.

* testing/lisp/test-org.el (test-org/tag-string-to-alist):
(test-org/tag-alist-to-string):
(test-org/tag-alist-to-groups): New tests.
2016-04-18 17:40:15 +02:00
Nicolas Goaziou 716e339c96 Allow angular links within link descriptions
* lisp/org-element.el (org-element-object-restrictions):
(org-element--object-lex): Allow angular links as equivalent to plain
links in description.

* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.
2016-04-06 11:08:53 +02:00
Nicolas Goaziou ff236e5c85 Merge branch 'maint' 2016-03-30 15:36:16 +02:00
Nicolas Goaziou 954103dd9b Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Return correct columns
  when at the end of an empty item.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-30 15:34:24 +02:00
Nicolas Goaziou 6f543959ed Merge branch 'maint' 2016-03-26 00:20:47 +01:00
Nicolas Goaziou a737f20ca4 org-table: Add tests
* testing/lisp/test-org-table.el (test-org-table/eval-formula):
(test-org-table/last-rc): New tests.
(test-org-table/first-rc): Add tests.
2016-03-26 00:20:08 +01:00
Nicolas Goaziou 0fd7fd072e Merge branch 'maint' 2016-03-24 14:00:44 +01:00
Nicolas Goaziou a5623bc502 org-table: Fix LaTeX snippets in radio tables
* lisp/org-table.el (orgtbl-to-generic): Call back-end specific filters.
* testing/lisp/test-org-table.el (test-org-table/to-latex): Add test.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/105876>
2016-03-24 13:59:29 +01:00
Nicolas Goaziou 0ccdceeb87 Merge branch 'maint' 2016-03-17 17:15:53 +01:00
Nicolas Goaziou 6f439a29b1 Remove failing test
* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes):
  Comment out failing test.
2016-03-17 17:15:17 +01:00
Nicolas Goaziou bf40aba6cd Merge branch 'maint' 2016-03-17 16:51:43 +01:00
Nicolas Goaziou 261eadb9d4 Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-17 16:50:54 +01:00
Nicolas Goaziou 1d781b3365 Use Babel cache when exporting src blocks
* lisp/ob-core.el (org-babel-process-params): Normalize return value.
* testing/lisp/test-ob.el (test-ob/process-params-no-duplicates): Fix
  test.
2016-03-17 00:23:02 +01:00
Nicolas Goaziou 5135540ba7 Fix failing test
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
  Fix failing test.
2016-03-16 18:17:50 +01:00
Nicolas Goaziou dcfe011998 org-element: Fix inline src block parsing
* lisp/org-element.el (org-element--pair-curly-table): Fix typo.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add tests.

Reported-by: William Denton <wtd@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105748>
2016-03-16 18:15:39 +01:00
Nicolas Goaziou 32c3f33d00 ox: Use a new scheme for internal references
* lisp/ox.el (org-export-get-reference): Use randomly generated labels.
(org-export-new-reference):
(org-export-format-reference): New functions.

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

The new scheme is better when datum type cannot be known ahead of time
or when references are not created sequentially, e.g., during
a publishing process where a reference to a file can be require before
the file is published.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 6ec06dcff9 ox: Abstract fuzzy link searches with search cells
* lisp/ox.el (org-export-search-cells):
(org-export-string-to-search-cell):
(org-export-match-search-cell-p): New functions.

(org-export-resolve-fuzzy-link): Use new functions.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Tiny
  refactoring.
(test-org-export/resolve-fuzzy-link): Fix failing test.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 0b59a5994e Merge branch 'maint' 2016-03-10 10:11:24 +01:00
Nicolas Goaziou 5a735b0b80 ox: Fix smart quotes within tables
* lisp/ox.el (org-export--smart-quote-status): Handle smart quotes
  within objects.

* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes): Add
  tests.

Reported-by: Philipp Middendorf <pmi@hacon.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105586>
2016-03-10 10:10:29 +01:00
Nicolas Goaziou 194b754597 Merge branch 'maint' 2016-03-01 01:06:02 +01:00