Commit Graph

23204 Commits

Author SHA1 Message Date
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
Nicolas Goaziou 12275cc9fe ox-html: Fix URI for LaTeX fragments
* lisp/ox-html.el (org-html-latex-environment):
(org-html-latex-fragment): Use `org-export-file-uri' to write proper
URI.

Reported-by: bpanthi <bpanthi977@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00271.html>
2020-05-16 19:28:59 +02:00
Nicolas Goaziou 93c50e3a78 Speed-up `org-(next|previous)-visible-heading
* lisp/org.el (org-next-visible-heading): Do not stop at every
invisible heading.
(org-previous-visible-heading): Use `org-next-visible-heading'.
2020-05-15 23:48:48 +02:00
Stanley Jaddoe bbf9c062a4 ox: Add Dutch translations
* lisp/ox.el (org-export-dictionary): Add missing Dutch (nl) translations.

TINYCHANGE
2020-05-15 21:53:06 +02:00
Nicolas Goaziou 7939da783e crypt: Fix crypting with multiple keys
* lisp/org-crypt.el (org-crypt-key): Improve docstring accuracy.
(org-encrypt-string): Remove function.
(org-crypt-key-for-heading): Correctly handle `epa-file-encrypt-to'
value.  Really return nil for symmetric encryption.
(org-encrypt-entry): Inline removed function. Tiny refactoring.
2020-05-15 16:56:57 +02:00
Nicolas Goaziou 48b223d45d Fix test
* testing/lisp/test-org.el (test-org/return): Use `call-interactively'
so that `interactive' arguments are also checked.
2020-05-15 00:48:26 +02:00
Nicolas Goaziou 817acdcdfb manual: Small rewording
* doc/org-manual.org (Attachments): Avoid using "cloud" term.
(Attachment defaults and dispatcher): Use present tense.
(Attachment options): Use Org attach instead of symbol org-attach.
2020-05-14 23:56:52 +02:00
Nicolas Goaziou 99bb514f7f Follow links with RET even in read-only buffers
* lisp/org.el (org-return): Fix `interactive' arguments.
* testing/lisp/test-org.el (test-org/return): Add test.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00247.html>
2020-05-14 23:28:10 +02:00
Nicolas Goaziou 37a5020bbe id: Faster `org-id-update-id-locations'
* lisp/org-id.el (org-id-update-id-locations): Do not copy contents of
files in order to parse them.
2020-05-14 22:56:29 +02:00
Nicolas Goaziou 4a727d2cfc manual: Some typographical fixes
* doc/org-manual.org (Global and local cycling):
(Initial visibility): Use complete sentences.  Use @var{...} for
meta-syntactical variables.  Do not capitalize CONTENTS.
2020-05-14 15:21:11 +02:00
stardiviner 1abf4f600a pcomplete: improve header arguments completion
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Make it
complete all available header arguments.

* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/src-block):
New test.
2020-05-14 14:52:30 +02:00
Kyle Meyer cd2b108d22 manual: Update for change in org-startup-folded default
* doc/org-manual.org (Initial visibility):
(Summary of In-Buffer Settings): Update description of
org-startup-folded default, which changed in 88f5ed91c.

Reported-by: Charles Millar <millarc@verizon.net>
<708b3f3d-147b-a798-52cf-a13809c7470f@verizon.net>
2020-05-14 00:00:27 -04:00
Kyle Meyer 8d3f9e4de2 CONTRIBUTE: Fix "maintenance" typos
Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<20200513202909.23448-1-jonas@bernoul.li>
2020-05-13 23:35:40 -04:00
Jonas Bernoulli 71604cbc2d Fix typos 2020-05-13 23:27:49 -04:00
Nicolas Goaziou 3dc582c8d5 list: Tiny fix to a docstring
* lisp/org-list.el (org-sort-list): Remove escaped parenthesis.
2020-05-13 19:10:35 +02:00
Nicolas Goaziou c76bacc483 ob: Ignore RESULTS keyword case
* lisp/ob-core.el (org-babel-current-result-hash):
(org-babel-hide-hash):
(org-babel-hide-all-hashes):
(org-babel-result-hide-all):
(org-babel-hide-result-toggle-maybe):
(org-babel-hide-result-toggle):
(org-babel--clear-results-maybe):
(org-babel-remove-result): Bind `case-fold-search' to t before looking
for `org-babel-result-regexp'.
2020-05-13 18:13:18 +02:00