Commit Graph

1960 Commits

Author SHA1 Message Date
Nicolas Goaziou 72708b33e3 org-clock: Fix tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link): Fix
tests.
2019-12-22 14:51:31 +01:00
Nicolas Goaziou ee2a8eb241 org-element: Forbid affiliated keywords for comments
* lisp/org-element.el (org-element--current-element): Forbid
affiliated keywords for comments.
* testing/lisp/test-org-element.el (test-org-element/comment-parser):
Tiny refactoring.

The motivation is to avoid distinguishing between top-level comments,
which cannot have affiliated keywords, and other comments, which
could.  Therefore, we keep a single type of comment.
2019-12-15 14:06:20 +01:00
Nicolas Goaziou af99544286 org-element: Fix top-level property-drawer parsing
* lisp/org-element.el (org-element-comment-parser): Top level comments
do not have affiliated keywords.
(org-element--current-element): Properly parse top-level comments and
top-level properties drawer.
(org-element--next-mode): Change signature.
(org-element--parse-elements): Apply signature change.
(org-element--parse-to): Apply signature change.  Look for top-level
comments or properties drawer.
* testing/lisp/test-org-element.el (test-org-element/property-drawer-parser):
Add comment.

Initially, `org-element--current-element' would defer to
`org-get-property-block' to validate a property-drawer, which is the
wrong way to look at the low-level Org Element library. Also, it would
allow affiliated keywords, which is not possible.
2019-12-15 13:34:30 +01:00
Jason Dunsmore a410413be8 org-capture: Add support for month trees
* doc/org-manual.org: Add `:tree-type month' option for capture
  templates.
* lisp/org-capture.el (org-capture-set-target-location): Add
  `:tree-type month' option to capture templates to group entries by
  month.
* lisp/org-datetree.el (org-datetree-find-month-create): Add
  `org-datetree-find-month-create' function to add datetree entries
  grouped by month.
* testing/lisp/test-org-datetree.el
  (test-org-datetree/find-month-create): Add test for new function.
2019-12-09 20:08:28 +01:00
Marco Wahl 8ded89cc38 Merge branch 'master' into next 2019-11-26 22:45:10 +01:00
Nicolas Goaziou 3d4365ba03 org-clock: Fix locale issues in tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step):
(test-org-clock/clocktable/extend-today-until): Fix tests failing due
to translation mismatch.
2019-11-24 17:27:53 +01:00
Sebastian Miele 787fa238a9 Add tests about omission of commented src blocks when e.g. tangling
* testing/lisp/test-ob.el (test-ob/noweb-expansion): Add clause to
test.
* testing/lisp/test-ob-tangle.el (ob-tangle/commented-src-blocks): Add
test.
2019-11-24 10:27:35 +01:00
Kyle Meyer a4fa04bbd4 Merge branch 'master' into next 2019-11-16 17:19:11 -05:00
Jonas Bernoulli 5117d8a159 Fix typos 2019-11-16 17:17:36 -05:00
Gustav Wikström 00646ad817 Fix newline-issue with document property drawer
A bug was squashed where newlines after insertion of document property
drawers wasn't handled correctly.

* testing/lisp/test-org.el (test-org/insert-property-drawer):
Add test to verify that the document property drawer is
inserted above keyword lines.  Also fix the specification for
document property drawer so it doesn't remove existing blank
rows if inserted at the top of a buffer.

* lisp/org.el (org-insert-property-drawer): Make sure to add
newline after document property drawers.
2019-10-31 23:56:03 +01:00
Gustav Wikström 1bdff9f73d Org document property-drawers
Add functionality to define property-blocks on document level, in
addition to at headline level.

* doc/org-manual.org:
* etc/ORG-NEWS: Document new functionality.

* lisp/org.el (org-keyword-regexp): Define constant instead of
  hardcoding.
(org-file-properties): Renamed, see next line.
(org-keyword-properties): Renamed from above.  Due to the fact that
  properties can be defined for the whole document using property
  drawers this local variable needs a rename to make its name less
  ambigous.
(org-refresh-properties, org-refresh-property, org-entry-properties)
(org-refresh-category-properties, org-get-property-block)
(org-entry-get-with-inheritance, org-entry-put)
(org-insert-property-drawer, org-end-of-subtree): Made to work before
  first headline.
(org-at-property-block-p): New function to validate if point is at the
start of a property block.
(org-property-global-value): Renamed, see next line.
(org-property-global-or-keyword-value): Renamed from above to match
  its functionality better.
(org-back-to-heading-or-point-min): New function to make a document
  work as a level 0 node in the outline.
(org-at-keyword-p): Predicate function to answer to if we're currently
at a keyword line or not.
(org-up-heading-or-point-min): New function to make a document work as
a level 0 node in the outline.

* lisp/org-element.el (org-element--current-element): Can now detect
  property-blocks before first headline according to it's positional
  rules.

* lisp/org-attach.el (org-attach): Make it possible to call the
  attachment dispatcher also before the first headline, since document
  property drawers make attachments possible for the whole document
  now.

* lisp/org-capture.el: Modified only due to rename of function in
  org.el.

* lisp/org-compat.el (org-file-properties)
(org-property-global-value): Renamed functions declared obsolete.

* testing/lisp/test-org.el (org/insert-property-drawer)
(org/set-property, org/delete-property, org/delete-property-globally):
  Additions of tests to check if they work before first headline.
(org/at-property-p, org/at-property-block-p, org/get-property-block)
(org/entry-get, org/refresh-properties): New tests

* testing/examples/property-inheritance.org: Switch from
  property-keywords to a property-drawer in the testfile.
  Functionality should be the same, but now using a document drawer
  instead of property-keywords.

  Reason for switching is that I'd like us to slowly depricate
  property-keywords.

* testing/lisp/test-org-element.el:

* contrib/lisp/ox-taskjuggler.el: A comment is modified only due to
  rename of function in org.el.
2019-10-19 14:07:58 +02:00
Gustav Wikström 930a1bcfc5 Fix problems with org-attach-git, failed tests
Ref. mail "[O] git-annex-related org-attach tests failing on
master"
https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00030.html
* lisp/org-attach-git.el (org-attach-git-commit): Add optional
argument to function contract to make it work with
`org-attach-after-change-hook'.  Even though that argument is
not used in the actual code (due to legacy functionality).

* testing/lisp/test-org-attach.el
(test-org-attach/dired-attach-to-next-best-subtree/1)
(test-org-attach/dired-attach-to-next-best-subtree/2):
Modify tests to also work if user has git-annex installed

* testing/lisp/test-org-attach-git.el
(test-org-attach-git/use-annex): Correct errors from previous
commit, where git-annex was refactored out from org-attach
into it's separate module.
2019-09-08 14:43:46 +02:00
Michaël Cadilhac 5cb360c7d0 Add test for the hidefiles parameter in clocktables.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/hidefiles):
Add test.
2019-09-05 18:56:32 +02:00
Gustav Wikström 4b7eda1a2f org-attach, test-org-attach: Restore fs check in org-attach-dir
In commit ae9cd4370 the filsystem check for org-attach-dir was
removed.  Adding it back here, together with an optional flag to
override the check.

To satisfy compatabilty issues with org-brain. Ref. thread here:
- https://github.com/Kungsgeten/org-brain/pull/203
2019-09-02 23:15:13 +02:00
Nicolas Goaziou 4848b8b9aa ob: Preserve comma escaping when inserting results
* lisp/ob-core.el (org-babel-insert-result): Fix typo
* testing/lisp/test-ob.el (test-ob/preserve-comma-escape): New test.

Reported-by: "Berry, Charles" <ccberry@ucsd.edu>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00250.html>
2019-08-22 10:03:56 +02:00
Nicolas Goaziou e48fac5231 Fix failing tests
* testing/lisp/test-org.el (test-org/timestamp-from-string):
(test-org/timestamp-from-time): Fix failing tests due to wrong locale.
2019-08-20 14:21:21 +02:00
Nicolas Goaziou 1ff9cab0a3 Merge branch 'maint' 2019-07-09 12:43:29 +02:00
Nicolas Goaziou 63e851ddbd ox: Add test
* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.
2019-07-09 12:42:49 +02:00
Nicolas Goaziou 24daf224c0 Fix test
* testing/lisp/test-org-table.el (test-org-table/copy-down): Fix test.
2019-07-09 12:03:32 +02:00
Gustav Wikström ae9cd4370b org-attach*, org, org-manual, org-news, ox-html, testing/*
* lisp/org-attach.el

Changed the way attachments deal with property-inheritance.  It now
adheres to the =org-use-property-inheritance= setting by default but
it can be customized if needed (I recommend to enable it!).
The property ATTACH_DIR is deprecated in favour of the shorter and simpler
property DIR.

Added an explicit option to =org-attach= for unsetting
attachment-directories (i.e. remove DIR property and deal with the
attachments by interaction).

Added attachment link type with the prefix "attachment:".

Added customizations:
- org-attach-dir-relative
- org-attach-preferred-new-method
- org-attach-use-inheritance
- org-attach-id-to-path-function

Hooks added:
- org-attach-after-change-hook
- org-attach-open-hook

A new linktype "attachment" is added in order to reduce
link-duplication when wanting to link to files in attached folders of
nodes.  This works for both ID and DIR properties.  The goal is to
make the functionality for attachment links mirror the functionality
for file links.

* lisp/org-attach-git.el

New file, existing functionality.  Code here has been factored out
from org-attach.el and if GIT-functionality is to be used this module
needs to be required sepatately.  It extends org-attach by use of its
hooks.

Activating git functionality in org-attach is done by loading
org-attach-git from now on, instead of customizing a variable.

Naming of both functions and tests has been modified to match the move
of functionality into its own module.

* lisp/org.el

Inline images are shown also using attachment-links, exactly the same
as it works for file-links today.

Make org-open-at-point respect ARG when opening attachment-dir.

* lisp/org-compat.el

org-attach-directory has been deprecated in favour for
org-attach-id-dir.  The new name matches its purpose better.

* lisp/ox-html.el

Export attachment links to images as inline images, in the same way as
file links work today.

* etc/ORG-NEWS

Mention the changes in this patch.

* doc/org-manual.org

The chapter "Refile, Copy, Archive" has been split into two separate
chapters.
- "Refile, Copy and Archiving" for information related to moving
  existing data around.

- "Capture, Attachments, RSS Feeds and Protocols" for information
  related to working with external data.

The attachment-part has been rewritten and extended to match the
changes in this patch.

The new attachment link type is mentioned both inside the attachments
chapter and in the chapter dealing with links.

Documentation related to external links has been improved.

* testing/lisp/test-org-attach-annex.el

Require org-attach-git instead of org-attach, since this file tests
the GIT-functionality.

* testing/lisp/test-org-attach.el

Add tests for org-attach.

* testing/org-test.el

Define a symbol for a file to test attachments with.

* testing/examples/*

A bunch of new example files and folders are created and are used in
testing of org-attach to verify its functionality.
2019-07-07 19:55:49 +02:00
Gustav Wikström 3cbe356b0a org-test, test-org-element, test-org, test-ox, test-property-inheritance
* org-test.el:

Fix org-test-with-temp-text-in-file.  Make it work with <point>, as
some tests already expect it to do!  Also make it fail more gracefully
by still removing temporary buffers and files.

Improve org-test-in-example-file.  Make it behave similar to
org-test-with-temp-text and org-test-with-temp-text-in-file, in that
it will return the last evaluated expression.

* testing/lisp/test-org-element.el

Fix a temp-text strings so that it doesn't have an initial newline.

* testing/lisp/test-org.el

Minor cleanup to align code-structure with other tests.  Nothing
changes in the test execpt style.

* testing/lisp/test-ox.el

Fix a couple of temp-text strings so that they don't have initial
newlines.

** test-org-export/expand-include

Test specification was wrong, due to org-test-with-temp-text-in-file
not previously working with <point>.  Since that is fixed in this
patch the test needed to be updated to match the expected outcome.

* testing/lisp/test-property-inheritance.el

Fix wrong file-header and file-ending.
2019-07-07 19:42:50 +02:00
Nicolas Goaziou 0201d1c0cc Fix inserting capture templates at point
* lisp/org-capture.el (org-capture):
(org-capture-set-target-location):
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line): Fix inserting capture templates at
point.  Insert a new internal property for capture
template: :insert-here.
(org-capture-insert-template-here): Remove function.

* testing/lisp/test-org-capture.el (test-org-caputre/entry):
(test-org-capture/item):
(test-org-capture/table-line): Add tests.

Reported-by: Dominic Surano <sk8ingdom@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-07/msg00002.html>
2019-07-06 16:02:37 +02:00
Nicolas Goaziou 9ddfe45314 org-table: Improve `org-table-copy-down'
* lisp/org-table.el (org-table--increment-field): New function.
(org-table-copy-down): Use new function.
* testing/lisp/test-org-table.el (test-org-table/copy-down): New test.
* doc/org-manual.org (Calculations): Update documentation.
2019-06-28 00:07:25 +02:00
Nicolas Goaziou bba9116cb8 org-element: Parse affiliated keywords according to granularity
* lisp/org-element.el (org-element--current-element): Parse affiliated
  keywords according to granularity.
* lisp/ox.el (org-export-get-caption): Refactor code.
* testing/lisp/test-org-element.el (test-org-element/affiliated-keywords-parser):
  Add tests.

Reported-by: ihor <ihor@antonovs.family>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00023.html>
2019-06-09 00:51:53 +02:00
Sacha Chua a41e9950ae Add :target option for the TOC keyword
* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox.el (org-export-resolve-link): New function.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.
  (test-org-export/resolve-link): New test.
2019-05-30 15:25:46 +02:00
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
Marco Wahl 7d638dcd49 test-org: Concretize test
* testing/lisp/test-org.el (test-org/set-tags-command): Test
  specifically for the C-u prefix for tag alignment.
2019-01-05 13:45:04 +01:00
Kaushal Modi b334a59902 Merge branch 'maint' 2019-01-04 08:59:10 -05:00
Kaushal Modi 539091799b Fix C-u M-x org-align-tags not aligning all tags in buffer
* lisp/org.el (org-align-tags): Move point to the beginning of the
  visible buffer first before attempting to look for Org headline
  tags.

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

Fixes a regression in
1615261cdc.

Bug reported in
<https://lists.gnu.org/r/emacs-orgmode/2019-01/msg00051.html>.
2019-01-04 08:57:10 -05:00
stardiviner 34b71a0ca9 Add a dispatcher command for inserting dynamic blocks
* lisp/org.el (org-dynamic-block-insert-dblock,
  org-dynamic-block-alist, org-dynamic-block-functions,
  org-dynamic-block-types, org-dynamic-block-define,
  org-dynamic-block-function): New variables, New functions.

* lisp/org-keys.el (org-dynamic-block-insert-dblock): Add binding for
  the function.
(org-clock-report, org-columns-insert-dblock): Remove function
keybindings. Mark them as obsolete.

* doc/org-manual.org (Dynamic Blocks): : Add manual for dispatch
command `org-dynamic-block-insert-dblock'.

* testing/lisp/test-org-clock.el: New test.
2019-01-02 15:55:51 +01:00
Nicolas Goaziou 69c300bbf6 Add Org Num minor mode
* doc/org-manual.org (Headlines): Refer to new section.
(Dynamic Headline Numbering): New section.
* lisp/org-num.el:
* testing/lisp/test-org-num.el: New files.
2019-01-01 22:08:24 +01:00
Nicolas Goaziou 114de1571a org-colview: Fix failing test
* testing/lisp/test-org-colview.el (test-org-colview/columns-width):
  Fix failing test.
2019-01-01 17:23:35 +01:00
Bastien 7a22b8f93b Merge branch 'maint' 2019-01-01 11:54:01 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Nicolas Goaziou 372099440f Merge branch 'master' into next 2018-12-17 17:45:24 +01:00
Nicolas Goaziou c024844e56 org-capture: Fix failing tests
* testing/lisp/test-org-capture.el (test-org-capture/abort):
(test-org-capture/item):
(test-org-capture/table-line):
(test-org-capture/plain): Fix failing tests.
2018-12-17 17:43:23 +01:00
Nicolas Goaziou 1eea78d1a5 Merge branch 'master' into next 2018-12-08 11:50:30 +01:00
Nicolas Goaziou e9108043e1 org-capture: Fix %i with prefix containing "\\"
* lisp/org-capture.el (org-capture-fill-template): Fix %i with prefix
  containing "\\".
* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Add test.
2018-12-08 11:49:10 +01:00
Nicolas Goaziou 253686a402 Merge branch 'master' into next 2018-12-06 15:07:21 +01:00
Nicolas Goaziou 1d60d5ee03 org-capture: Correctly store position of captured entry
* lisp/org-capture.el (org-capture-place-entry): Store position at the
  beginning of the capture entry, not at its end.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): Add test.
2018-12-06 15:07:03 +01:00
Nicolas Goaziou 19a75de480 Merge branch 'master' into next 2018-11-26 23:56:55 +01:00
Nicolas Goaziou cd60a35fe1 Fix opening custom ID links with percent escaped syntax
* lisp/org.el (org-open-at-point): Un-escape percent escaped path.
* testing/lisp/test-org.el (test-org/custom-id): Add test.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00303.html>
2018-11-26 23:56:17 +01:00
Nicolas Goaziou 86a6087f92 Merge branch 'master' into next 2018-11-25 02:03:14 +01:00
Nicolas Goaziou 8b7ba29b60 org-pcomplete: Fix tag completion
* lisp/org-pcomplete.el (org-thing-at-point): Only complete where tags
  could be located.
(pcomplete/org-mode/tag): Add paring argument to avoid looking at
other arguments on the same line.
* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/tag): New test.

Reported-by: Alain.Cochard@unistra.fr
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00154.html>
2018-11-25 02:01:41 +01:00
Nicolas Goaziou cd12a9eefe Merge branch 'master' into next 2018-11-10 20:00:31 +01:00
Nicolas Goaziou af81211fdc Also obey to repeaters in inactive time stamps
* lisp/org.el (org-repeat-re): Accept inactive time stamps.
(org-auto-repeat-maybe): Small refactoring.  Find additional repeaters
also in inactive time stamps.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add test.

Reported-by: Leo Gaspard <orgmode@leo.gaspard.io>
<http://lists.gnu.org/r/emacs-orgmode/2018-11/msg00078.html>
2018-11-10 19:59:48 +01:00
Nicolas Goaziou 4a2ef00804 Merge branch 'master' into next 2018-11-08 18:23:03 +01:00
Nicolas Goaziou 9df82be074 Fix tag groups expansion as a regexp
* lisp/org.el (org--tags-expand-group): New function.
(org-tags-expand): Refactor code.  Fix expansion of identical tag
groups in the same match string.  Fix docstring.  Remove unused
argument.
* testing/lisp/test-org.el (test-org/tags-expand): New test.

Reported-by: Omari Norman <omari@smileystation.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00360.html>
2018-11-08 18:20:57 +01:00
Nicolas Goaziou 813ab7d56f Merge branch 'master' into next 2018-11-01 19:05:22 +01:00
Kevin Brubeck Unhammer 17deb1c7eb org-clock: Handle DST in clocktable
* lisp/org-clock.el (org-clocktable-steps): new fn
  org-clocktable-increment-day to add/subtract days that are not
  exactly 24 hours
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  test for DST.
2018-11-01 19:00:28 +01:00
Nicolas Goaziou dabcddfb85 Merge branch 'master' into next 2018-10-26 17:36:19 +02:00
Nicolas Goaziou 4b905774ac org-macs: Fix last commit
* lisp/org-macs.el (org--string-from-props): Do not raise an error on
  unsupported display properties.  Change signature to avoid creating
  new strings unnecessarily.  Update docstring accordingly.
(org-string-width): Apply signature change.
* testing/lisp/test-org-macs.el (test-org/string-width): Add test.

Reported-by: Colin Baxter <m43cap@yandex.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00346.html>
2018-10-26 14:37:57 +02:00
stardiviner 4456dc8809 ob-clojure: Support `org-babel-initiate-session'
* ob-clojure.el (org-babel-clojure-initiate-session): Initialize session
for source block.
(org-babel-prep-session:clojure): Prepare Clojure session.
(org-babel-clojure-var-to-clojure): Convert header argument :var into
clojure variables definitions.
(org-babel-variable-assignments:clojure): Support assigning variables
when initializing a session.
2018-10-25 10:28:41 +02:00
Nicolas Goaziou 8da5168dd1 Merge branch 'master' into next 2018-10-23 23:28:38 +02:00
Nicolas Goaziou 17e28d6467 org-capture: Various fixes to item capture
* lisp/org-capture.el (org-capture-place-item): Rewrite function.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
(test-org-capture/item): New test.
2018-10-23 23:27:28 +02:00
Nicolas Goaziou ea47ed0d76 Merge branch 'master' into next 2018-10-23 01:53:54 +02:00
Nicolas Goaziou 7a4a10dea0 org-capture: Fix plain capture at the end of the buffer.
* lisp/org-capture.el (org-capture-place-plain-text): Fix plain
  capture at the end of the buffer.
* testing/lisp/test-org-capture.el (test-org-capture/plain): New test.
2018-10-23 01:26:17 +02:00
Nicolas Goaziou ad0fce50eb org-capture: Small fix to table line capture
* lisp/org-capture.el (org-capture-place-table-line): Handle abort
  table line insertion more gracefully.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add tests
2018-10-23 00:43:59 +02:00
Nicolas Goaziou e7b5cc4d29 Merge branch 'master' into next 2018-10-22 23:42:07 +02:00
Nicolas Goaziou aaa3372b8b org-capture: Fix capture aborting
* lisp/org-capture.el (org-capture-place-entry): Fix delimiters for
  region to delete when aborting capture.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
2018-10-22 23:40:49 +02:00
Nicolas Goaziou 796a7c4c0e Merge branch 'master' into next 2018-10-22 22:26:41 +02:00
Nicolas Goaziou 0fa8bb4c51 org-capture: Inserting an entry doesn't break structure
* lisp/org-capture.el (org-capture-place-entry): Carefully narrow
  buffer to not alter following headline.  Also include leading empty
  lines in region to remove when cancelling capture.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): New test.
(test-org-capture/abort): Rename test.

Reported-by: Martin Yrjölä <martin.yrjola@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00256.html>
2018-10-22 22:22:21 +02:00
Nicolas Goaziou 1f913ecc36 Merge branch 'master' into next 2018-10-18 18:15:59 +02:00
Nicolas Goaziou 102ab1a245 org-pcomplete: Add tests
* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/clocktable):
(test-org-pcomplete/drawer):
(test-org-pcomplete/entity):
(test-org-pcomplete/link):
(test-org-pcomplete/search-heading):
(test-org-pcomplete/todo): New tests.
2018-10-18 18:01:33 +02:00
Nicolas Goaziou 4d8c78a0ef Merge branch 'master' into next 2018-10-14 09:09:23 +02:00
Nicolas Goaziou 085f150372 ob-tangle: Add a test
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): Add test.
2018-10-14 09:08:44 +02:00
Gong Qijian 2b96fc9171 ob-core: Fix `org-babel--string-to-number'
* lisp/ob-core.el (org-babel--string-to-number): Fix the regular expression.
* testing/lisp/test-ob.el (test-ob/string-to-number): Test cases.

If people write the data in the form "0001"", it means that he wants to
treat it as a string.

TINYCHANGE

> #+name: TBL
> |   id | name   | age |
> |------|--------|-----|
> | 0001 | Apollo |  16 |
> | 0002 | Bmw    |  16 |
>
> #+BEGIN_SRC emacs-lisp :results value pp :var tbl=TBL
> (mapc 'print tbl)
> #+END_SRC
>
> #+RESULTS:
> : (("0001" "Apollo" 16)
> :  ("0002" "Bmw" 16))

TINYCHANGE
2018-10-13 23:22:05 +02:00
Nicolas Goaziou 848037d54c Merge branch 'master' into next 2018-10-13 16:59:49 +02:00
Dima Gerasimov 7a09c33867 org-agenda: New test for setting priority
* testing/examples/agenda-file.org: Add a subnote, make sure it has no
  impact on agenda.
* testing/lisp/test-org-agenda.el (test-org-agenda/set-priority): New
  test.

TINYCHANGE
2018-10-13 16:58:33 +02:00
Nicolas Goaziou 100edaccd1 Implement `month' and `year' steps in clock tables
* doc/org-manual.org (The clock table): Update manual.
* lisp/org-clock.el (org-clocktable-steps): Rewrite function.  Add
  `month' and `year' steps.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  tests.
2018-10-13 16:22:43 +02:00
Nicolas Goaziou 5341312b79 Merge branch 'master' into next 2018-10-11 00:02:46 +02:00
Nicolas Goaziou 2fda33bfef ob-tangle: Fix tangling order
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Preserver order
  of code blocks from the source document.
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): New test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00062.html>
2018-10-11 00:01:50 +02:00
Nicolas Goaziou 26ed66b233 ob: :file and :file-ext no longer imply :results file
* lisp/ob-core.el (org-babel-execute-src-block): ":results file" must
  be specified in order to return a file.
(org-babel-merge-params): :file and :file-ext no longer imply :results
file.
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
(test-ob/result-file-link-type-header-argument):
(test-ob/result-graphics-link-type-header-argument): Update tests.

Deducing the results from some other arguments is not obvious.
Moreover, it prevents users from setting, e.g., :file-ext, in a node
property, as every block would then create a file.

Reported-by: Alex Fenton <alex@pressure.to>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00469.html>
2018-10-06 08:56:05 +02:00
Marco Wahl ed9bdfd220 Merge branch 'master' into next 2018-10-05 00:54:19 +02:00
Marco Wahl 0ae2e656d7 test-org: More tests for cut and paste subtree 2018-10-04 23:49:00 +02:00
Benjamin Motz 3cb4ffe957 org-colview: Add property :exclude-tags to column view table
* lisp/org-colview.el (org-columns--capture-view): Add parameter.
(org-dblock-write:columnview): Add new property.
* doc/org-manual.org (Capturing column view): Document feature.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
  test.

This addition allows to specify a list of tags to exclude from column
view tables.

TINYCHANGE
2018-10-03 18:44:34 +02:00
Nicolas Goaziou 6995f206ad org-colview: Fix failing test
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Fix failing test.

Since 3367ac945796d7b65feb3c2d0ceb9734a6bbd19c, plain numbers in
properties are minutes instead of hours.
2018-10-03 18:44:34 +02:00
Chris Kauffman d0a5308435 org-table: Adding single cell movement functions
* lisp/org-table.el (org-table--swap-cells):
(org-table--move-cell):
(org-table-move-cell-up):
(org-table-move-cell-down):
(org-table-move-cell-left):
(org-table-move-cell-right): New functions.

* testing/lisp/test-org-table.el (test-org-table/move-cell-down):
(test-org-table/move-cell-up):
(test-org-table/move-cell-right):
(test-org-table/move-cell-left): New tests.

* doc/org-manual.org (Column and row editing): Document functions and
  keybindings for single cell movement.
2018-10-03 18:44:34 +02:00
stardiviner 1b81d6e07b ob-eshell.el: Add Eshell support for Babel
* lisp/ob-eshell.el (org-babel-execute:eshell): Execute Eshell code in Babel.
(org-babel-prep-session:eshell):
(ob-eshell-session-live-p):
(org-babel-eshell-initiate-session):
(org-babel-variable-assignments:eshell):
(org-babel-load-session:eshell):

* testing/test-ob-eshell.el: Write test for ob-eshell.

* doc/org-manual.org (Languages): Add Babel language eshell identity.
2018-10-03 18:44:34 +02:00
Marco Wahl f82a3051a9 test-org-bbdb.el: new tests
* testing/lisp/test-org-bbdb.el (test-org-bbdb-anniv-extract-date):
  Test function `org-bbdb-anniv-extract-date'.
2018-09-23 17:03:00 +02:00
Nicolas Goaziou 17edaf8c14 "src block" -> "source block" in documentation and comments
* etc/ORG-NEWS (Maxima: new headers ~:prologue~ and ~:epilogue~):
(Texinfo exports inline source blocks as ~@code{}~):
(Default lexical evaluation of emacs-lisp source blocks):
* lisp/ob-clojure.el (org-babel-clojure-default-ns):
* lisp/ob-core.el (org-babel-named-src-block-regexp-for-name):
(org-babel-current-src-block-location):
(org-babel-mark-block):
(org-babel-insert-result):
* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-lob.el (org-babel-lob-ingest):
* lisp/ob-ref.el:
* lisp/org-element.el (org-element-object-restrictions):
(org-element-src-block-parser):
(org-element-inline-src-block-parser):
* lisp/org-lint.el:
(org-lint--checkers):
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src):
* lisp/org-src.el (org-edit-inline-src-code):
* lisp/org.el (org-ctrl-c-ctrl-c):
(org-in-src-block-p):
(org-fill-element):
* lisp/ox-html.el (org-html--textarea-block):
(org-html-format-code):
* lisp/ox-latex.el (org-latex-minted-options):
(org-latex-custom-lang-environments):
* lisp/ox-md.el:
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-collect-listings):
* testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword):
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation):
  Correct "src block" occurrences when they do not specifically refer
  to the element type `src-block'.
2018-09-20 11:23:49 +02:00
Robert Klein 1e6ab19b2a Fix tests for sqlite
- sqlite executable used by ob-sqlite is 'sqlite3'
- require ob-sqlite for test
2018-09-13 23:04:57 +02:00
Nicolas Goaziou 9029161bcd org-footnote: Fix failing test
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Fix
  failing test.
2018-09-05 19:04:34 +02:00
Nicolas Goaziou cbb7be9c25 Revert "org-footnote: Fix location after moving to definition"
This reverts commit 8500501984.
2018-08-30 23:59:01 +02:00
Nicolas Goaziou 1334572582 org-macs: Optimize `org-string-width'
* lisp/org-macs.el (org--string-from-props): New function.
(org-string-display): Remove function.
(org-string-width): Use new function.
2018-08-30 21:09:57 +02:00
Matt Lundin 5e27b2fd32 Ensure that org-get-tags returns all local tags
* lisp/org.el: (org-get-tags) Create a clearer separation between
  local and inherited tags in the function, so that
  org-remove-uninherited tags is only run on inherited tags. This is
  important to avoid destroying existing tags when adding new tags.
* testing/lisp/test-org.el: (test-org/get-tags) Add regression test
2018-08-19 10:28:27 +02:00
Nicolas Goaziou d975b44fd4 Fix `org-kill-line' on tag lines
* lisp/org.el (org-kill-line): Preserve tags when `org-special-ctrl-k'
  is non-nil.
* testing/lisp/test-org.el (test-org/kill-line): New test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00122.html>
2018-07-17 22:24:01 +02:00
Nicolas Goaziou 65ebb128bc org-macro: Fix "results" macro
* lisp/org-macro.el (org-macro-initialize-templates): Do not
  initialize the special "results" macro.
(org-macro-replace-all): Do not raise an error if "results" macro has
no associated template yet.
* lisp/ox.el (org-export-as): Update code comments.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Add test.
2018-07-07 12:53:13 +02:00
Nicolas Goaziou 7d9e4da447 Prevent spurious newline character in fixed-width area value
* lisp/org-element.el (org-element-fixed-width-parser): Prevent
  spurious newline character at the end of the value.
* lisp/ox-latex.el (org-latex-fixed-width):
* lisp/ox-man.el (org-man-fixed-width):
* lisp/ox-texinfo.el (org-texinfo-fixed-width):
* contrib/lisp/ox-groff.el (org-groff-fixed-width): Adapt to change.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-parser):
  Update tests.

Reported-by: 孙振祥 <sunznx@icloud.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2018-07/msg00003.html>
2018-07-02 00:24:38 +02:00
Nicolas Goaziou 937e7ce76b org-macs: Fix last commit
* lisp/org-macs.el (org-parse-time-string): Fix typo in last commit.
* testing/lisp/test-org-element.el (test-org-element/timestamp):
  Rename to `test-org-element/timestamp-parser'.
2018-07-02 00:18:44 +02:00
Robert Irelan e1f197aec7 org-clock: Test clocktable behavior under `org-extend-today-until'
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/extend-today-until):
  New test.
2018-06-27 08:31:47 +02:00
Nicolas Goaziou 627cb7f578 org-footnote: Fix `org-footnote-goto-previous-reference'
* lisp/org-footnote.el (org-footnote-goto-previous-reference): Only
  add to mark ring on a successful match.  Improve error message when
  reference is outside visible part of buffer.
(org-footnote-get-next-reference): Avoid using
`org-footnote-at-reference-p', which is inaccurate, due to
`org-footnote-in-valid-context-p'.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-previous-reference):
  New test.
2018-06-24 11:25:15 +02:00
Marco Wahl a6b4cec691 org-agenda: Refactored. Add test.
* lisp/org-agenda.el (org-agenda-mode): Factored out a function for a
  loop occuring two times.
* testing/lisp/test-org-agenda.el: test the text scale after
  agenda-undo.
2018-06-24 09:52:29 +02:00
Nicolas Goaziou 62dd2cc829 Fix regression in tags alignment
* lisp/org.el (org--align-tags-here): Correctly preserve column.
* testing/lisp/test-org.el (test-org/tag-align): Add test.

The regression was introduced in
593058e4a6.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00245.html>
2018-06-22 18:49:11 +02:00
Henry Blevins f2500e06f3 ob-scheme: Add tests for scheme result types
* test-ob-scheme.el (test-ob-scheme/verbatim, test-ob-scheme/list):
  New tests.
2018-06-21 22:00:50 +02:00
Nicolas Goaziou 031c53103a org-capture: Fix formulas when capturing rows
* lisp/org-capture.el (org-capture-finalize): Possibly update formula
  when inserting the captured rows in the table.

* testing/lisp/test-org-capture.el (test-org-capture/table-line): Add
  tests.

Reported-by: "Holst Thomas (PS-EC/ESE4)" <Thomas.Holst@de.bosch.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00276.html>
2018-06-21 18:09:40 +02:00
Nicolas Goaziou 547b431e70 org-capture: Fix row insertion in a table with a formula
* lisp/org-capture.el (org-capture-place-table-line): Insert new row
  above the formula, not below.
* testing/lisp/test-org-capture.el (test-org-capture/table-line): Add
  test.
2018-06-21 12:17:07 +02:00
Nicolas Goaziou 593058e4a6 `org-set-tags' modifies buffer only when necessary
* lisp/org.el (org--align-tags-here):
(org-set-tags): Modify buffer only when necessary.

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

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00242.html>
2018-06-19 09:40:00 +02:00
Nicolas Goaziou 3745c0af9f Fix indentation when wrapping a block around a region
* lisp/org.el (org-insert-structure-template): Indent like the first
  line, not the line the point happens to be on.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00107.html>
2018-06-12 09:03:33 +02:00
Marco Wahl 13a09b3ba5 Merge branch 'maint' 2018-06-06 16:05:26 +02:00
Marco Wahl 2b76aebfc6 org-element: Fix interpretation as todo kwd when prefix of headline
* lisp/org-element.el (org-element-headline-parser): Check for space
  after todo-kwd.
* testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
  Respective tests.
2018-06-06 15:58:20 +02:00