Commit graph

23519 commits

Author SHA1 Message Date
Nicolas Goaziou 65fdf2be16 Fix `org-mark-element' in narrowed buffers
* lisp/org.el (org-mark-element): Do not set mark past narrowed part
of the buffer.
* testing/lisp/test-org.el (test-org/mark-element): New test.

Reported-by: Kevin Liu <kevin@nivekuil.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00812.html>
2020-05-31 13:55:47 +02:00
Nicolas Goaziou 1596113512 Fix `org-next-visible-heading'
* lisp/org.el (org-next-visible-heading): Fix function when
`org-cycle-separator-lines' is different from 0.
* testing/lisp/test-org.el (test-org/next-visible-heading): New test.
2020-05-31 12:55:08 +02:00
Bastien 3b2de48989 Merge branch 'maint' 2020-05-29 18:34:12 +02:00
Bastien f5997d5956 doc/org-manual.org (List of Contributions): Fix typo
* doc/org-manual.org (List of Contributions): Fix typo.
2020-05-29 18:34:01 +02:00
Kévin Le Gouguec e9163591ae Add test case for symbol coercion in C Babel blocks
The ORG-NEWS entry for version 9.1 suggests that this coercion was
always intended, though AFAICT there was no test case for it.

* testing/lisp/test-ob-C.el (ob-C/symbol-include): Check explicitly
that :includes <iostream> (with no double-quotes around <iostream>)
will be parsed correctly.
(ob-D/simple-program, ob-C/integer-var, ob-D/integer-var,
ob-C/two-integer-var, ob-D/two-integer-var, ob-C/string-var,
ob-D/string-var, ob-C/preprocessor): Adjust block indices.

* testing/examples/ob-C-test.org (Simple tests): Add input for the new
test.
2020-05-28 22:32:31 -04:00
Kévin Le Gouguec 6506ea1e05 Coerce symbols found in :includes header arguments to strings
Fix regression from 2020-05-24T16:23:26Z!brandon@guttersohn.org
(commit 44cb98fdb), which broke test ob-C/string-var.

* lisp/ob-C.el (org-babel-C-expand-C): Make sure items in :includes
arguments are strings before performing string operations on them.
2020-05-28 22:32:30 -04:00
Jack Kamm d73fd145c0 ob-python.el: Revert fix for multiline var
* lisp/ob-python.el (org-babel-execute:python,
org-babel-python-evaluate): Move variable assignment back to body from
preamble.
* testing/lisp/test-ob-python.el (test-ob-python/multiline-var): Mark
unit test for multiline-variable as expected to fail.

Reverts 6149b6cb6 which fixed multiline vars in ob-python, but caused
a new bug (https://lists.gnu.org/archive/html/emacs-orgmode/2020-05/msg00719.html).
2020-05-28 07:29:31 -07:00
Nicolas Goaziou 516c038e5f lint: Catch misleading drawers within drawers
* lisp/org-lint.el (org-lint-incomplete-drawer): Catch misleading
drawers within drawers.
* testing/lisp/test-org-lint.el (test-org-lint/incomplete-drawer): Add
test.
2020-05-27 14:55:04 +02:00
Kevin J. Foley 7a2b785d6a test-ob-tangle.el: Fix dirty repo state caused by testing
* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Kill modified buffer after test.

Another test is causing the modifications to be saved which leaves the
repo in a dirty state after testing.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Changed to kill a let-bound buffer rather than a buffer name.
2020-05-26 21:51:47 -04:00
Nicolas Goaziou b51d129f3f src: Fix typo
* lisp/org-src.el (org-edit-latex-fragment): Fix typo.
2020-05-26 23:09:52 +02:00
TEC f5c47d857c Extend org-edit-special to editing LaTeX fragments
* lisp/org-src.el (org-src--contents-area): Handle `latex-fragment'.
(org-edit-latex-fragment): New function.
* lisp/org.el (org-edit-special): Use new function.
2020-05-26 23:03:11 +02:00
Nicolas Goaziou 5454312dbf Merge branch 'maint' 2020-05-25 12:37:44 +02:00
Nicolas Goaziou 784054bc94 src: Replace newline with blanks when editing inline source code
* lisp/org-src.el (org-edit-footnote-reference): Do not remove newline
completely.
2020-05-25 12:36:35 +02:00
Bastien 5f0a9cca3d lisp/ob-core.el: Use lower-case by default for block keywords
* lisp/ob-core.el (org-babel-demarcate-block): Use lower-case
by default.
2020-05-25 11:51:57 +02:00
Roland Coeurjoly 1837cfb0e2 ob-haskell: Introduce :compile header argument
* lisp/ob-haskell (org-babel-haskell-compiler):
(org-babel-header-args:haskell): New variables.
(org-babel-haskell-execute):
(org-babel-haskell-interpret): New functions.
(org-babel-execute:haskell): Use new functions.
2020-05-25 09:17:14 +02:00
Nicolas Goaziou 266ad1e134 list: Fix cycle indentation
* lisp/org-list.el (org-cycle-item-indentation): Do not stop at
initial indentation before outdenting items.  Implement more robust
algorithm.
* testing/lisp/test-org-list.el (test-org-list/cycle-item-identation):
New test.
* testing/lisp/test-org-list.el (test-org-list/move-item-down): Small
reformatting.

Reported-by: lamaglama@posteo.net
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00573.html>
2020-05-24 23:43:24 +02:00
Brandon Guttersohn 44cb98fdb6 lisp/ob-C.el: Small fix to include expansion
* lisp/ob-C.el (org-babel-C-expand-C): When expanding include
directives, wrap filenames in quotes if they do not begin with "<".

TINYCHANGE
2020-05-24 18:23:26 +02:00
Kyle Meyer 14878f3f9a ob-core: Display warning on failure to read results
* lisp/ob-core.el (org-babel-import-elisp-from-file): Show handled
errors with display-warning rather than a message because the latter
is quickly overridden by subsequent messages, making it difficult if
not impossible for the user to spot.

The scope of the save-window-excursion call would need to be reduced
for the display-warning buffer to be shown, but nothing appears to
change the window configuration, so just drop the
save-window-excursion call.

Reported-by: Greg Minshall <minshall@umich.edu>
<2449663.1588516024@apollo2.minshall.org>
2020-05-24 11:56:43 -04:00
Jack Kamm eecee22665 test-ob-python.el: Add test for multiline-string variables
* testing/lisp/test-ob-python.el (test-ob-python/multiline-var): Add
test for multiline-string variable issue that was fixed in 6149b6cb6.
2020-05-24 08:14:03 -07:00
Jack Kamm 6149b6cb6d ob-python.el: Assign variables in preamble instead of body
* lisp/ob-python.el (org-babel-execute:python): Add variable
assignment to preamble instead of body.
(org-babel-python-evaluate): Concatenate preamble (which now includes
variable assignment) to body before session evaluation.

Fixes
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00126.html. For
non-session evaluation, ob-python adds indentation to the body inside
main(), but this was adding spurious indentation for multiline strings
passed through :var. This commit fixes the issue by moving variable
assignment out of the body and into the preamble.
2020-05-24 07:49:22 -07:00
Bastien d9fe6aeafe lisp/ob-R.el: Don't throw an error when result cannot be parsed
* lisp/ob-R.el (org-babel-R-process-value-result): When the result
cannot be parsed, return an error as the output.

Thanks to Greg Minshall for reporting this.
2020-05-24 16:08:52 +02:00
Kevin J. Foley 010d1e3b6e Fix `org-babel-detangle' handling of false positives
* lisp/ob-tangle.el (org-babel-detangle): Handle false positive
matches of `org-link-bracket-re'.

* testing/examples/babel.el: New file for Babel detangle false
positive test.

* testing/examples/babel.org (detangle): Add detangle/false positive
example.

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Add test for detangle false positive.
2020-05-24 15:40:21 +02:00
Bastien 6f113a5392 Merge branch 'maint' 2020-05-24 14:26:30 +02:00
Bastien b614ed0bba lisp/org-agenda.el: Remove redundant code
* lisp/org-agenda.el (org-agenda-get-some-entry-text)
(org-agenda-finalize): Remove redundant code: the 'org-link face
is already set by `org-activate-links'.

Thanks to Kevin Liu for reporting this.
2020-05-24 14:25:56 +02:00
Bastien 701c7bed94 lisp/org.el: Minor docstrings enhancements
* lisp/org.el (org-deadline, org-schedule): Update docstrings by
mentioning the use of the Emacs calendar.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15598
2020-05-24 10:13:52 +02:00
Bastien 6d62c76d2c ol.el: Allow to remove the link part of a link
* lisp/ol.el (org-link-make-string): When trying to make a link
with an empty link part, do not throw an error, just insert the
description text.
2020-05-23 17:07:35 +02:00
Bastien 412f0406da doc/org-manual.org: Mention `stuck' as an available agenda view
* doc/org-manual.org (Block agenda): Mention `stuck' as an
available agenda view for a block agenda.
2020-05-23 15:39:30 +02:00
Bastien da8eadd1e5 doc/org-manual.org: Document the `!' agenda command separately
* doc/org-manual.org (The Agenda Dispatcher): Document the `#' and
`!' agenda commands separately.
2020-05-23 15:37:05 +02:00
Stefan Kangas e9b1b8fde5 New function org-agenda-filter-set
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-filter-set): Refactor out from 'org-agenda-filter', to
create a better interface to filter the agenda from Lisp.
2020-05-23 11:06:54 +02:00
Bastien d8dae655f4 lisp/ol-bbdb.el: Tiny formatting enhancements 2020-05-23 10:32:43 +02:00
Bastien 5adfb533ce org.el: Tiny fixes in comments 2020-05-22 18:50:13 +02:00
fpi 928e67df7e org-protocol: Allow slashes after sub-protocol
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Handle URIs with additional slashes before the start of the query
string, e.g. "org-protocol:/capture/?template=..." instead of
"org-protocol:/capture?template=...", as neede for some browsers.

TINYCHANGE
2020-05-22 17:54:41 +02:00
Richard Kim cd336c2af3 contrib/lisp/ox-confluence.el: Add an export menu entry
* contrib/lisp/ox-confluence.el (confluence): Add an export menu
entry.

TINYCHANGE
2020-05-22 17:26:10 +02:00
Nicolas Goaziou 80de8400c6 manual: Fix typo
* doc/org-manual.org (Headlines): Fix typo.
2020-05-22 17:24:20 +02:00
Bastien 2e96dc6392 Merge branch 'maint' 2020-05-22 16:37:25 +02:00
Bastien ceb0ef95fb contrib/lisp/ox-confluence.el: Fix radio link export
* contrib/lisp/ox-confluence.el (org-confluence-link): Only use
the description when exporting radio links.

Thanks to Karl Voit for reporting this.
2020-05-22 16:36:50 +02:00
Bastien 27ec1c2cff doc: Mention that a space is needed after the star(s) in a headline
* doc/org-guide.org (Headlines): Mention that the stars at the
beginning of a headline must be followed by a space.

* doc/org-manual.org (Headlines): Ditto.
2020-05-22 16:26:09 +02:00
Bastien a75f440942 Merge branch 'maint' 2020-05-22 16:08:33 +02:00
Ivan Sokolov 47b653450f ob-js.el: Fix obsolete requirement
* lisp/ob-js.el (org-babel-js-function-wrapper): Fix obsolete
requirement.

TINYCHANGE
2020-05-22 16:07:55 +02:00
Bastien d868067055 etc/ORG-NEWS: Tiny formatting enhancements 2020-05-22 16:04:43 +02:00
Bastien 7c913d1792 lisp/org-compat.el: Small fix in a "obsolete" declaration
* lisp/org-compat.el (org-cycle-hide-drawers): Mention to use
`org-hide-drawer-all' instead of `org-hide-drawer' as the latter
function does not exist anymore.
2020-05-22 16:03:44 +02:00
Paul Eggert 1e3184964c Backport commit 00be23c2a from Emacs
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Don’t try to modify string constants.

Don’t attempt to modify constant strings
00be23c2af4aa1bb09afc6404c5ef68997dc18f5
Paul Eggert
Sun May 17 16:51:46 2020 -0700
2020-05-21 20:51:38 -04:00
Kyle Meyer bfc4569ae3 Merge branch 'maint' 2020-05-20 23:00:40 -04:00
Kyle Meyer 5e2490bdf2 agenda: Respect FILETAGS when skipping archive entries
* lisp/org-agenda.el (org-agenda-skip): Consider skipping all entries
in a file if org-archive-tag is set via FILETAGS.

Reported-by: George Sokolsky <sokolgeo@posteo.net>
<87pnb4i217.fsf@posteo.net>
2020-05-20 22:47:42 -04:00
Kyle Meyer 962b8e765c org.el: Fix regression in collecting empty-value keywords
* lisp/org.el (org--collect-keywords-1): Don't replace space-only
values with nil because that leads to the option's default being used.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options):
Add test.

This restores the behavior to what it was before b4e91b7e9 (New
function: org-collect-keywords, 2020-04-26).

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<CAFyQvY2ZGJPv=Ajx2_1xR0otv=VQYHcrUwzS46PmnyJ2Co1KVg@mail.gmail.com>
2020-05-19 20:33:15 -04:00
Nicolas Goaziou 9bc0cc7fb3 crypt: Allow nil value for `org-crypt-key'
* lisp/org-crypt.el (org-crypt-key): Allow nil value.
(org-crypt-key-for-heading): Handle nil value for `org-crypt-key'.
2020-05-17 00:04:35 +02:00
Nicolas Goaziou 5441b2d5ca crypt: Add autoloads, cleanup headers and requires 2020-05-17 00:04:35 +02:00
Nicolas Goaziou d3c15e2b34 crypt: Small improvements
* lisp/org-crypt.el (org-crypt--encrypted-text): New function.
(org-at-encrypted-entry-p): Better return value and more thorough
checks.
(org-encrypt-entry):
(org-decrypt-entry): Use new function.  Better handling of indented
crypted text, and folding.
2020-05-17 00:04:35 +02:00
Mak Kolybabi 18d37e5803 ox-md: Fix docstring
* lisp/ox-md.el (org-md-link): Fix docstring.
2020-05-16 20:45:31 +02:00
Nicolas Goaziou 8e6fb13a48 clock: Generate clock report with archives in indirect buffers
* lisp/org-clock.el (org-dblock-write:clocktable): Get archives from
original buffer, not from indirect one.

Reported-by: Alois Janíček <janicek.dev@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00282.html>
2020-05-16 20:42:01 +02:00