Commit Graph

23570 Commits

Author SHA1 Message Date
Bastien 3f8fe39695 Merge branch 'maint' 2020-09-05 09:41:42 +02:00
Kyle Meyer 4696aef580 goto: Avoid invoking org-mode for outline navigation
* lisp/org-goto.el (org-goto-location): Call make-indirect-buffer with
a non-nil CLONE to preserve the base buffer's state, avoiding a more
expensive call to org-mode.

Reported-by: Vladimir Nikishkin <lockywolf@gmail.com>
Suggested-by: Ihor Radchenko <yantar92@gmail.com>
2020-09-05 09:41:24 +02:00
Bastien 0e580d169f ob-J.el: Add a maintainer
* lisp/ob-J.el: Add a maintainer.
2020-09-05 08:06:01 +02:00
Bastien 42bd67fdf0 Merge branch 'maint' 2020-09-05 08:03:12 +02:00
Bastien ee3c3b5547 org.el: Allow empty subtrees to be folded back
* lisp/org.el (org-cycle-internal-local): Allow empty subtrees to
fold back.

See <https://orgmode.org/list/CA+Yh0SRPgeMUYAD0ds3TZnwpPKq8_mpact-OeKK-rXoQNb-eEg@mail.gmail.com>

Reported-by: Dmitrii Korobeinikov <dim1212k@gmail.com>
2020-09-05 08:01:58 +02:00
Bastien 8a3777e35b org.el: Use `string-match-p' in two functions
* lisp/org.el (org-remove-empty-overlays-at)
(org-cycle-internal-global): Use `string-match-p' as match data
are not used.
2020-09-05 08:00:29 +02:00
Bastien 5beeb094a2 Merge branch 'maint' 2020-09-05 07:30:47 +02:00
Dmitrii Korobeinikov a8e812e601 org.el: Restore the scroll position after cycling
* lisp/org.el (org-scroll-position-to-restore): New variable.
(org-optimize-window-after-visibility-change): Use it to restore
the scroll position when needed.

TINYCHANGE

See <https://orgmode.org/list/CA+Yh0STTE+Zx-zct3qy7eyqTovogr_fqwwOCLx9z3da7_hFRnw@mail.gmail.com>
2020-09-05 07:28:20 +02:00
Bastien 3c524c5fd5 org.el: Fix the "version" keyword in the header
* lisp/org.el: Fix the "version" keyword in the header.
2020-09-05 07:28:20 +02:00
Jack Kamm e617d1afd0 ob-python: Add maintainer to header 2020-09-04 17:59:18 -07:00
Jack Kamm b5709ddc98 ob-python: Fix session blocks not waiting for value result
* lisp/ob-python.el (py-shell-send-string): Remove unneeded
declare-function.
(org-babel-python-eoe-indicator): Add back this const.
(org-babel-python--eval-ast): Fix spacing so the block can be entered
line by line into the interpreter.
(org-babel-python-evaluate-session): Revert previous changes to
evaluation for value results.
* testing/lisp/test-ob-python.el (test-ob-python/session-value-sleep):
New test for session blocks that don't return immediately.

632ceabb1 introduced a bug where session blocks don't wait for value
results if not returned immediately.  This reverts part of that
commit, specifically for evaluation of session blocks with value
results.  It leaves other parts of that commit alone, for example the
changes to session output results, which is more robust handling
prompts from ipython interpreter.

A downside of reverting the session value implementation is that the
ugly code from org-babel-python--eval-ast is again printed in the
console, but this is less bad than the new bug that was introduced by
the change, hence reverted.
2020-09-04 17:51:37 -07:00
Kyle Meyer 3377105c92 Merge branch 'maint' into master 2020-09-04 20:32:58 -04:00
Kyle Meyer 4b2123fb71 manual: Clarify behavior of :file-desc
* doc/org-manual.org (Results of Evaluation): Distinguish between
behavior when the :file-desc header argument is not present and when
it has no value.

The current handling of the :file-desc argument is to omit the
description if the header argument isn't present and to use the :file
value as the description if :file-desc is present without a value.
This matches the original intention [*].

[*] https://orgmode.org/list/87vclky211.fsf@med.uni-goettingen.de

Reported-by: Matt Huszagh <huszaghmatt@gmail.com>
  https://orgmode.org/list/87sgbzl6uy.fsf@gmail.com
2020-09-04 20:32:50 -04:00
Bastien Guerry ae0aec4959 Merge branch 'maint' 2020-09-04 19:16:27 +02:00
Bastien Guerry 39d9eb541f org-agenda.el: Filter category names with a hyphen specially
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-get-represented-categories): Handle category names
with one hyphen specially.

See <https://orgmode.org/list/87d06ds46s.fsf@fastmail.fm>
2020-09-04 19:15:15 +02:00
Max Nikulin 20aa3507af ol.el: Fix store and insert link in indirect buffer
* lisp/ol.el (org-store-link): Store link with CUSTOM_ID anchor
in indirect buffer.
(org-insert-link): Do not add file name to search and CUSTOM_ID
links pointed to the same file when called from indirect buffer.

When a subtree was open in an indirect buffer, wrong argument
of `abbreviate-file-name' prevented storing link to a CUSTOM_ID
anchor.  Internal link to a header line or to a CUSTOM_ID anchor
was created with file name instead of concise form.

This is a follow up of 784e5f1488.

TINYCHANGE
2020-09-04 17:59:21 +02:00
Bastien Guerry fd28d0ace6 Merge branch 'maint' 2020-09-04 17:48:20 +02:00
Bastien Guerry de3ffe99d0 org-agenda.el: Only recenter when called interactively
* lisp/org-agenda.el (org-agenda-redo): Only recenter when called
interactively.

See <https://orgmode.org/list/CAL1eYuKemsB-RTaechv0EYVLFr_t9rNdrjbMh6Jm1dH+aqga7w@mail.gmail.com>
2020-09-04 17:46:25 +02:00
Bastien Guerry 13cf0dc6d6 Merge branch 'maint' 2020-09-04 15:45:23 +02:00
Bastien Guerry 2df7a8fab0 org-manual.org: Document . and C-. keybindings
* doc/org-manual.org (The date/time prompt): Document . and
C-. keybindings.

See <https://orgmode.org/list/20200829224748.32186-1-orgmode@adamspiers.org>
2020-09-04 15:44:41 +02:00
Bastien Guerry 399867388e Merge branch 'maint' 2020-09-04 12:42:11 +02:00
Bastien Guerry fd460ea468 ox-html.el: Fix overflow css for pre.src HTML tag
* lisp/ox-html.el (org-html-style-default): Fix overflow css
for pre.src HTML tag.

See <https://orgmode.org/list/CAPRwMaYiWVRLB=oTvQv=1JDNdUPxiYMow8MYdqj1sh_udfhUEw@mail.gmail.com>
2020-09-04 12:41:21 +02:00
Terje Larsen 186371eac7 ob-plantuml: Add support for plantuml executable
* lisp/ob-plantuml (org-babel-variable-assignments:plantuml): Support
using plantuml executable instead of jar.

Some systems come with an executable for plantuml instead of a specific
JAR file. This adds support for two different modes:
- jar :: using java together with a JAR (previous behavior)
- plantuml :: using a PlantUML executable

The PlantUML executable can be configured via
`org-plantuml-executable-path` and also the arguments that will be given
via `org-plantuml-executable-args`.
2020-09-04 12:36:58 +02:00
Bastien Guerry 416b97b5ca Merge branch 'maint' 2020-09-04 12:12:37 +02:00
Bastien Guerry 60a4e7b3bc lisp/ob-C.el: Don't trim results
This may lead to faulty output.

See <https://orgmode.org/list/CADt3fpPofOUXvrdUNDLJUPKsGTzP9xZ2K1MG9yEonikhbTG03Q@mail.gmail.com>.
2020-09-04 12:11:42 +02:00
Bastien Guerry 3ff8358139 Merge branch 'maint' 2020-09-04 11:35:39 +02:00
Nicholas Vollmer 50c4556977 capture: Document defualt template strings
* lisp/org-capture.el (org-capture-templates): Document default entry
type template strings.

TINYCHANGE
2020-09-04 11:35:32 +02:00
Bastien Guerry 90eb26facd Merge branch 'maint' 2020-09-04 10:08:14 +02:00
Bastien Guerry a3576543f5 org.el: Fix `org-display-outline-path'
* lisp/org.el (org-display-outline-path): Always remove faces when
setting the outline path to display.

See <https://orgmode.org/list/21ef0e94-e766-455c-a45c-fe30e316c121@Spark>
2020-09-04 10:03:48 +02:00
Bastien Guerry 8dc83ef303 Merge branch 'maint' 2020-09-04 09:18:45 +02:00
Joseph Novakovich 7d8247410d ob-J.el: Add ability to customize sit duration
* lisp/ob-J.el (org-babel-execute:J, org-babel-J-eval-string): Add
customizability.

(org-babel-execute:J): Lookup optional parameter `:sit' to allow one
to wait for a specified amount of time before grabbing the output of
the J subprocess.  Pass this specified value or the previous default
of .1 to `org-babel-J-eval-string'.
(org-babel-eval-string): Pass new argument `sit-time' to `sit-for'
before grabbing output.

The problem is that we read the contents of the output after 0.1
seconds, which, for expensive computations, results in the mangling of
output.  Output from expensive computations gets propagated down to
subsequent code-blocks' outputs, producing a horrible mess.

TINYCHANGE
2020-09-04 09:18:38 +02:00
Kyle Meyer 7bc18ebbed ob-core: Avoid table conversion warning for empty results
* lisp/ob-core.el (org-babel-import-elisp-from-file): Don't try to
convert empty file to a table.
* testing/lisp/test-ob.el (test-ob/import-elisp-from-file): Add tests.

If org-babel-import-elisp-from-file is called with an empty file
(which many ob- libraries do when there are no results), feeding that
to org-table-import leads to a beginning-of-buffer error.  Before
14878f3f9 (ob-core: Display warning on failure to read results,
2020-05-21), this error was hard to notice because, after catching it,
it was reported as a quickly buried message.  After that commit, it is
displayed as a warning, which is not appropriate for the common and
unproblematic case of empty results.

Avoid the warning by only doing the table conversion if the file has
content.  Another option would be to do the table conversion but add a
beginning-of-buffer arm to the surrounding condition-case.  However,
that risks swallowing other sources of that error.

Reported-by: Colin Baxter <m43cap@yandex.com>
<https://orgmode.org/list/878se3nhbj.fsf@yandex.com>
2020-09-01 00:02:49 -04:00
Eric S Fraga e8ebf5d6c9 Add other-tab option for org-agenda-window-setup
* org-agenda.el (org-agenda-prepare-window, org-agenda--quit): Handle
other-tab option for agenda view creation and exit.
2020-08-29 08:04:03 -04:00
Jack Kamm 632ceabb14 ob-python: Refactor session evaluation
* lisp/ob-python.el: Require python.el at top-level.
(org-babel-python-eoe-indicator): Remove unused variable.
(org-babel-python-initiate-session-by-key): Rename
python-buffer to avoid obsolete warning.
(org-babel-python-evaluate-external-process): Remove unnecessary
require.
(org-babel-python--exec-tmpfile): Simplify this template.
(org-babel-python--eval-ast): Add printing of results to this
template, requiring additional string escapes.
(org-babel-python-evaluate-session): Simplify to use adjusted
templates, and call out to functionality in python.el or
python-mode.el.
(org-babel-python-evaluate-session): Simplified to use adjusted templates.

This commit refactors and cleans up code related to session
evaluation. python.el is now required at the top-level. Python
templates for wrapping code are simplified. Instead of directly
pasting code to the REPL, functionality from python.el and
python-mode.el are used; this fixes issues with code being echoed to
the REPL, and should be generally more robust. Finally, in the
:results value case, special handling of exceptions is removed, and we
no longer print None when the last statement isn't an expression.
2020-08-28 22:07:56 -07:00
Jack Kamm 30a50d1c0f ob-python: Fix discrepancy of single/multi-line code blocks
* lisp/ob-python.el (org-babel-python-evaluate-session): Fix
discrepancy between how single-line and multiline code blocks return
output.

For example, before this commit, the 2 blocks behaved differently:

+begin_src python :session :results output
  pass
  "foo"
+end_src

+RESULTS:

+begin_src python :session :results output
  "foo"
+end_src

+RESULTS:
: 'foo'

But now, they both behave as the former.
2020-08-28 07:39:06 -07:00
Nicolas Goaziou 66537267eb org-num: Add tests
* testing/lisp/test-org-num.el (test-org-num/skip-numbering): Add
tests. This is a followup to 40474827ea.
2020-08-28 08:45:41 +02:00
Anders Johansson 40474827ea org-num: Fix bug in check for commented headlines
* lisp/org-num.el (org-num--skip-value): Handle empty headlines.

This happens when org-num-skip-commented is non-nil.  When creating
a new headline, often org-num--skip-value is invoked before any
headline text is created. This means that ‘title‘ is nil and the
string-match check breaks. Checking if title is non-nil fixes this.

TINYCHANGE
2020-08-27 11:29:12 +02:00
Kyle Meyer cdfc404bed Merge branch 'maint' into master 2020-08-23 22:39:44 -04:00
Ihor Radchenko 7b657c50e7 org-clock.el: Fix calculated clocking sum in inlinetasks
* lisp/org-clock.el (org-clock-sum-current-item): Do not include
clocked time from the parent when inside inlinetask.

Calling `org-narrow-to-subtree' from inside inlinetask would narrow to
the parent's subtree (correct behaviour).  However, it is not what we
want when calculating the clocking sum.  Inlinetask case should be
treated specially.
2020-08-23 22:38:45 -04:00
Allen Li 76da93aa86 org.el: Don't exclude local tags that are also inherited
This fixes a bug in set-tags-command excluding a tag that is both set
locally and inherited from the initial minibuffer input by modifying
org-get-tags to prefer keeping the locally set tag over the inherited
tag, as this behavior is more intuitive for org-get-tags anyway.

* lisp/org.el (org-get-tags): Keep local tags over inherited.
* testing/lisp/test-org.el (test-org/set-tags-command): Add test.
2020-08-23 22:38:20 -04:00
Christian Vanderwall 312a646fb8 ob-python.el: Fix issue with sessions on remote machines
* lisp/ob-python.el (org-babel-python-evaluate-session): Process
temporary file name with `org-babel-process-file-name' before
inserting it into code Python code snippets.

Before this change, the entire temporary filename was sent to the
Python session for execution, causing a 'No such file' error when the
filename had a Tramp format such as
/ssh:user@server:/tmp/python-ABCDEF.

TINYCHANGE
2020-08-20 18:34:00 -07:00
Kyle Meyer 220f2b0d93 agenda: Fix a docstring's position
* lisp/org-agenda.el (org-agenda-remove-filter): Move docstring to
correct position.
2020-08-17 23:20:05 -04:00
Kyle Meyer 616672c2f3 Merge branch 'maint' into master 2020-08-17 00:12:30 -04:00
Benson Chu bd97851c47 org-clock.el: Update org-clock-out-time from org-resolve-clocks
* lisp/org-clock.el (org-clock-out): If `at-time' was passed, set
org-clock-out-time to that value. Otherwise, set it to now.

TINYCHANGE
2020-08-17 00:11:07 -04:00
Nicolas Goaziou f4687993c5 ox-latex: Fix links to files with name matching an image type
* lisp/ox-latex.el (org-latex-inline-image-rules): Ensure
caracterization happens on extension only.
2020-08-16 12:01:20 +02:00
Nicolas Goaziou 567662d5b0 list: Fix item insertion when split point is near blanks
* lisp/org-list.el (org-list-insert-item): Ignore blanks around cut
position.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-08/msg00065.html>
2020-08-16 11:42:53 +02:00
Kyle Meyer 3f04ad8d2c Merge branch 'maint' into master 2020-08-15 13:16:26 -04:00
Nicholas Vollmer 47f26b1e76 org-eldoc: (org-eldoc-documentation-function): set `eldoc-documentation-functions'
* contrib/lisp/org-eldoc.el (org-eldoc-documentation-function):
b2b587387 did not set eldoc-documentation-functions, resulting in
`eldoc--invoke-strategy' throwing a void-function error.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Added Emacs<25 branch.
2020-08-15 13:09:12 -04:00
Kyle Meyer 5417e384eb Merge branch 'maint' 2020-08-10 20:38:18 -04:00
Nicholas Vollmer ab9b14a80f org.el: (org-get-cursor-date): Fix regular expression
* lisp/org.el (org-get-cursor-date): Fix regular expression.

Previous regular expression assumed the time grid string will have two
digits in the hour portion of the time string.  However, the time grid
string does not always have two digits.  For example:

" 8:00......"
2020-08-10 20:35:36 -04:00