Commit Graph

1835 Commits

Author SHA1 Message Date
Nicolas Goaziou 99aa99426d Merge branch 'maint' 2019-05-30 14:59:58 +02:00
Nicolas Goaziou 967801e2b8 ox: Make `org-export-table-cell-width' more robust
* lisp/ox.el (org-export-table-cell-width): Make
  `org-export-table-cell-width' robust against malformed tables.

Reported-by: michael <m.schoenwaelder@posteo.de>
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00215.html>
2019-05-30 14:59:10 +02:00
Nicolas Goaziou 0b0aa43ef2 Merge branch 'maint' 2019-05-16 10:44:28 +02:00
Achim Gratz be1d65b72f Ruby tests
Ruby tests have been failing for quite some time, here's my fix.

From 2f1bbaab939f6b6ceceb72862470e0576a8e2cba Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Sun, 12 May 2019 13:14:04 +0200
Subject: [PATCH 1/1] test-ob-ruby.el: fix tests

* testing/lisp/test-ob-ruby.el: Output no longer contains a trailing
  newline, remove from the template to compare against.  Session must
  be named for the tests to actually work, also add some extra code to
  ascertain that the code after the output statement has actually run
  in the session.
2019-05-16 10:43:14 +02:00
Nicolas Goaziou 12f93c112b Use `org-flag-subtree' instead of `outline-hide-subtree'
* lisp/org-agenda.el (org-agenda-show-1):
* lisp/org-archive.el (org-archive-to-archive-sibling):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org.el (org-set-visibility-according-to-property):
(org-move-subtree-down):
(org-paste-subtree):
(org-yank-generic):
* testing/lisp/test-org-inlinetask.el (test-org-inlinetask/folding-directly-consecutive-tasks/1): Use `org-flag-subtree' instead of `outline-hide-subtree'.

`outline-hide-subtree' leaves overlays on top of white spaces,
particularly at the end of the buffer. `org-flag-subtree' does not.
2019-05-11 09:48:53 +02:00
Nicolas Goaziou 9bbae3ce8f Merge branch 'maint' 2019-04-29 20:49:09 +02:00
Nicolas Goaziou 727c3f442b org-macro: Exit early when looking for keywords
* lisp/org-macro.el (org-macro--find-keyword-value): Change signature.
* testing/lisp/test-org-macro.el (test-org-macro/keyword): Remove
  a test.
2019-04-29 20:48:00 +02:00
Nicolas Goaziou 14132a356a Collect buffer-specific built-in macros in setup files
* lisp/org-macro.el (org-macro--set-template): New function.
(org-macro--collect-macros): Also collect "author", "email", "title"
and "date" macros.
(org-macro-initialize-templates): Do not collect previous macros here,
when it is too late.
(org-macro--find-date): New function.
* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Remove
  test, since we cannot guarantee anymore that user-defined macros can
  take precedence over built-in ones.

Reported-by: emsenn <emsenn@emsenn.net>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00234.html>
2019-04-29 20:35:23 +02:00
Joaquín Aguirrezabalaga 4939b41750 ob-core: Fix :dir when :mkdirp is not defined
* lisp/ob-core.el (org-babel-execute-src-block): Fix behaviour of
  ":dir path" when ":mkdirp" is not defined.
* testing/lisp/test-ob.el (test-ob-core/dir-mkdirp): Add a test case.

TINYCHANGE
2019-04-25 10:36:40 +02:00
Nicolas Goaziou ab311b85ae Merge branch 'maint' 2019-04-13 09:43:32 +02:00
Nicolas Goaziou 222408d70a org-table: Prevent expanding columns upon applying formulas
* lisp/org-table.el (org-table-recalculate): Prevent expanding columns
  upon applying formulas.
* testing/lisp/test-org-table.el (test-org-table/shrunk-columns): Add
  test.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00079.html>
2019-04-13 09:40:27 +02:00
Nicolas Goaziou 09a1a24b73 ol: Fix `org-previous-link' skipping links
* lisp/ol.el (org-next-link): Do not skip links when searching
  backwards.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00022.html>
2019-04-10 15:26:46 +02:00
Nicolas Goaziou 21fa859c4d Merge branch 'maint' 2019-04-09 09:24:46 +02:00
Nicolas Goaziou 6efe53cf0b org-capture: Do not break planning when capturing items
* lisp/org-capture.el (org-capture-place-item): When there is no list
  to augment, insert new list after planning info and properties
  drawers.
* testing/lisp/test-org-capture.el (test-org-capture/item): Add tests.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00060.html>
2019-04-09 09:23:00 +02:00
Nicolas Goaziou 3375f039dd ol: Fix `org-next-link' in an item tag
* lisp/ol.el (org-next-link): Fix `org-next-link' in an item tag.
* testing/lisp/test-ol.el (test-ol/next-link): Add test.
2019-04-04 15:52:41 +02:00
Nicolas Goaziou da517aaeb8 Merge branch 'maint' 2019-04-02 22:12:10 +02:00
Nicolas Goaziou b913b7404b org-capture: Fix capture on empty entries
* lisp/org-capture.el (org-capture-fill-template): Prevent raising an
  error when template is an empty entry.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): Add test.

Reported-by: Roland Everaert <reveatwork@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00019.html>
2019-04-02 22:10:50 +02:00
Marco Wahl f0dc3a06d1 test-org-clock: Fix one test
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
  Align the table after the substitution of a filename.  Further let
  org-link-descriptive be nil for better readablity of the tables.
2019-03-15 12:58:03 +01:00
Sebastian Miele e96f055ce2 ob-emacs-lisp: Test :lexical src block header argument
* testing/lisp/test-ob-emacs-lisp.el
  (ob-emacs-lisp/dynamic-lexical-execute,
  ob-emacs-lisp/dynamic-lexical-edit): Add tests that check the
  correct handling of the :lexical header argument when executing
  source blocks and when creating editing buffers for source blocks.
2019-03-14 22:58:45 +01:00
Nicolas Goaziou 83fb091a62 Merge branch 'maint' 2019-03-14 18:12:08 +01:00
Nicolas Goaziou 0007df863d org-lint: Do not warn about URL setup files
* lisp/org-lint.el (org-lint-non-existent-setupfile-parameter): Do not
  warn when setup file is a URL.
* testing/lisp/test-org-lint.el (test-org-lint/non-existent-setupfile-parameter):
Add test.

Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-03/msg00169.html>
2019-03-14 18:11:00 +01:00
Nicolas Goaziou 589cfb7488 Merge branch 'maint' 2019-03-10 18:22:05 +01:00
Pierre Téchoueyres 2216f4d2c7 org-protocol: Fix URL handling -- add tests
* testing/lisp/test-org-protocol.el (test-org-protocol/org-protocol-parse-parameters):
  Add test for the commit e0bfdec22 which un-escape extracted link as
  it is url-encoded externally.
2019-03-10 18:20:58 +01:00
Nicolas Goaziou a8a0d66900 org-clock: Fix failing test 2019-03-10 18:00:36 +01:00
Nicolas Goaziou c04372dbfe org-lint: Add checker for obsolete link escape syntax
* lisp/org-lint.el (org-lint--checkers): Add new linter.
(org-lint-percent-encoding-link-escape): New function.
* testing/lisp/test-org-lint.el (test-org-lint/percenc-encoding-link-escape):
  New test.
2019-03-10 18:00:36 +01:00
Nicolas Goaziou 2b00d62816 Change bracket link escape syntax
* contrib/lisp/org-link-edit.el (org-link-edit--link-data):
* lisp/ob-tangle.el (org-babel-tangle-comment-links): Update match-group.
(org-babel-detangle): Remove unnecessary `org-link-escape' call.
(org-babel-tangle-jump-to-org): Update match group.
(org-link-url-hexify):
(org-link-escape-chars): Remove variables.
* lisp/ol.el (org-link--decode-compound): Renamed from
  `org-link--unescape-compound'.
(org-link--decode-single-byte-sequence): Renamed from
`org-link--unescape-single-byte-sequence'.
(org-link-make-regexps): Update `org-link-bracket-re' syntax.
(org-link-encode): New function, renamed from `org-link-escape'.
(org-link-decode): New function, renamed from `org-link-unescape'.
(org-link-escape):
(org-link-unescape): Use new escape syntax.
(org-link-make-string): Apply new escaping rules.
(org-link-display-format):
(org-insert-link): Update match group.
* lisp/org-agenda.el (org-diary):
(org-agenda-format-item):
(org-agenda-to-appt): Update match group.
* lisp/org-clock.el (org-clocktable-write-default): Update match group.
* lisp/org-element.el (org-element-link-parser): Update match group.
* lisp/org-mobile.el (org-mobile-escape-olp):
(org-mobile-locate-entry): Apply function renaming.
* lisp/org-protocol.el (org-protocol-split-data):
(org-protocol-parse-parameters): Apply function renaming.
* lisp/org.el (org-refile): Update match group.
* testing/README (Interactive testing from within Emacs): Fix
  examples.
* testing/lisp/test-ol.el (test-ol/encode): Merge old escape tests.
(test-ol/decode): Merge old unescape tests.
(test-ol/escape):
(test-ol/unescape):
(test-ol/make-string): New tests.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
* testing/lisp/test-org.el (test-org/custom-id):
(test-org/fuzzy-links):
* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Update
  tests.
2019-03-10 18:00:36 +01:00
Nicolas Goaziou 4ff8947ea8 Fix `org-(next|previous)-link'
* lisp/ol.el (org-next-link): Rewrite function.
* testing/lisp/test-ol.el (test-ol/next-link):
(test-ol/previous-link): New tests.
2019-03-10 18:00:36 +01:00
Nicolas Goaziou 8ffe341989 Move link tests to a dedicated file
* testing/lisp/test-org.el: Move test to the...
* testing/lisp/test-ol.el: ... new file.
2019-03-10 18:00:36 +01:00
Nicolas Goaziou 499c0a50cc Prefix link-related libraries filenames with "ol"
* lisp/org.el (org-modules): Update provided symbols.
2019-03-10 18:00:36 +01:00
Nicolas Goaziou 51444aadf5 org-clock: Fix failing test
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/insert):
  Fix test now default scope is not file.
2019-03-04 23:16:48 +01:00
Nicolas Goaziou 0c1916657a ob: Fix and add tests for mkdirp header argument
* testing/lisp/test-ob.el (test-ob-core/dir-mkdirp): Add tests.
2019-03-04 22:34:31 +01:00
stardiviner 8b5941330b ob-core: Make :mkdirp work for :dir too
* lisp/ob-core.el (org-babel-execute-src-block): Make directory if
  ":dir path" does not exist when ":mkdirp yes" exist.

* doc/org-manual.org (Header arguments): Document it.

* testing/lisp/test-ob.el: Add a specific testing file for ob-core.el,
  and add a testing for ":mkdir yes" work with :dir header argument
  usage.
2019-03-04 22:25:48 +01:00
Nicolas Goaziou 3a106a213c Merge branch 'maint' 2019-02-18 23:38:55 +01:00
Nicolas Goaziou 6b8fb446b6 org-list: Fix `org-list-demote-modify-bullet' with alpha bullets
* lisp/org-list.el (org-list-struct-indent): Match case-sensitively
  against current bullet in order the tell the difference between "a."
  and "A.".
* testing/lisp/test-org-list.el (test-org-list/indent-item): Add test.
2019-02-18 23:38:13 +01:00
Nicolas Goaziou 7e98c5c4cc Merge branch 'maint' 2019-02-15 22:47:53 +01:00
Nicolas Goaziou 6872088c7a Prevent spurious newline characters when inserting a heading
* lisp/org.el (org-insert-heading): Do not insert spurious newline
  characters.
* testing/lisp/test-org.el (test-org/insert-heading): Update tests.

Reported-by: Leo Vivier <zaephon@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00128.html>
2019-02-15 22:47:28 +01:00
Kyle Meyer f362df7eb7 Merge branch 'maint' 2019-02-12 19:55:26 -05:00
Paul Eggert 2cd1f9b028 When testing, fake the current time more robustly
The old approach required Lisp code to use (current-time)
explicitly when calling other primitives, e.g., (float-time
(current-time)).  The new approach fakes all the primitives,
so that Lisp code can now use expressions like plain (float-time).
* testing/org-test.el (org-test-at-time): New macro.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
* testing/lisp/test-org-timer.el (test-org-timer/with-current-time):
* testing/lisp/test-org.el (test-org/org-read-date)
(test-org/deadline-close-p, test-org/deadline)
(test-org/schedule, test-org/time-stamp):
Use it.
2019-02-12 19:34:08 -05:00
Nicolas Goaziou 232160cf7a Merge branch 'maint' 2019-02-12 01:19:19 +01:00
Nicolas Goaziou 931b7b8faf Fix included nested relative file links
* lisp/ox.el (org-export--update-included-link): New function.
(org-export--prepare-file-contents): Use new function.  Also check
possible file links within link's description.
* testing/lisp/test-ox.el (test-org-export/expand-include/links): Fix
  prefix.  Add tests.

Reported-by: "Dietrich Foethke" <foethke@web.de>
<http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00103.html>
2019-02-12 01:15:55 +01:00
Nicolas Goaziou ce48c6b0d1 Merge branch 'maint' 2019-02-03 14:42:18 +01:00
Nicolas Goaziou 70c90c2cb5 Fix nested VISIBILITY property
* lisp/org.el (org-set-visibility-according-to-property): Fix nested
  VISIBILITY property. Small refactoring.
* testing/lisp/test-org.el (test-org/set-visibility-according-to-property):
  Add test.

Reported-by: Michael Maurer <maurer.michael@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00402.html>
2019-02-03 14:23:44 +01:00
Nicolas Goaziou ee29cdc40e Merge branch 'maint' 2019-01-30 22:36:14 +01:00
Nicolas Goaziou 5e47e49832 Revert actionable repeaters in inactive timestamps
* lisp/org.el (org-repeat-re): Repeaters are for active timestamps
  only.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Update test.

Reported-by: cesar mena <cesar.mena@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00095.html>
2019-01-30 22:19:28 +01:00
stardiviner bcdb2b5568 ob-clojure: Don't tangle with auto prepend ns statement
* lisp/ob-clojure.el: (org-babel-expand-body:clojure,
  org-babel-header-args:clojure): whether auto prepend Clojure (ns ..)
  statement depend on whether have :ns header argument specified.

* testing/test-ob-clojure.el: Add a test.
2019-01-21 21:17:47 +01:00
Yasushi SHOJI 4a076ed545 Allow cloning subtrees while shifting them backward in time
* lisp/org.el (org-clone-subtree-with-time-shift): Accept a negative
value to shift the timestamp backward in time.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add test.

Reported-by: Scott Randby <srandby@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00151.html>

Signed-off-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
2019-01-21 18:47:49 +01:00
Marco Wahl c006a60fac test-org-agenda: Test diary inclusion
* testing/lisp/test-org-agenda.el (test-org-agenda/diary-inclusion):
  New test.
2019-01-08 21:32:44 +01:00
Kaushal Modi 8a5d8f79a1 Merge branch 'maint' 2019-01-08 11:35:34 -05:00
Kaushal Modi 34e5dcfb06 Fix the order of org-get-tags collected tags from #+filetags
* lisp/org.el (org-get-tags): Now org-get-tags returns tags list with
  tags from #+filetags in the beginning.

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

Fixes regression caused by commit
<5e27b2fd32>.

Bug reported in
<https://lists.gnu.org/r/emacs-orgmode/2019-01/msg00052.html>.
2019-01-08 11:29:58 -05:00
Nicolas Goaziou 21d646775b org-num: Fix failing tests 2019-01-08 11:32:34 +01:00