0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 16:02:52 +00:00
Commit graph

16885 commits

Author SHA1 Message Date
Bastien 81c7a2dee8 lisp/org-agenda.el: Use "09:00" instead of " 9:00"
* lisp/org-agenda.el (org-get-time-of-day): Use "09:00" instead
of " 9:00" when displaying as a string.

This makes the string more readable, especially for users reading
the agenda with a screen reader.

Reported-by: Sébastien Hinderer
2021-05-15 16:13:49 +02:00
Bastien c6d11502e0 Fix code typo in 06c064e9 (take 2) 2021-05-15 16:13:49 +02:00
Bastien e53572e130 Fix code typo in 06c064e9 2021-05-15 16:13:49 +02:00
Adam Spiers 33027f992d New command `org-refile-reverse' bound to C-c C-M-w
* lisp/org-refile.el (org-refile-reverse): New command.

* lisp/org-keys.el (org-mode-map): Bind C-c C-M-w to
`org-refile-reverse'.

* doc/org-manual.org (Refile and Copy): Document
`org-refile-reverse'.

* etc/ORG-NEWS (New command ~org-refile-reverse~ (=C-c C-M-w=)):
Announce the new command.

Link: https://orgmode.org/list/20200830001047.21362-1-orgmode@adamspiers.org/
2021-05-15 16:13:49 +02:00
Ihor Radchenko 8f39743ce6 Use cache in org-up-heading-safe
* lisp/org.el (org-up-heading-safe): Use buffer-local cache to store
positions of parent headings.  The cache is invalidated when buffer
text is changed, according to `buffer-chars-modified-tick'.
(org--up-heading-cache):  Buffer-local hash-table storing the cache.
(org--up-heading-cache-tick):  The buffer modification state for
currently active `org--up-heading-cache'.

The optimisation is critical when running agenda or org-entry-get
queries using property/tag inheritance.  In such scenarios
`org-up-heading-safe' can be called thousands of times.  For example,
building todo agenda on large number of headings lead to the following
benchmark results:

Benchmark:

1. (elp-instrument-function #'org-up-heading-safe)
2. Run agenda
3. (elp-results) ;; function, # calls, total time, avg time

Without cache:
org-up-heading-safe  27555       8.4234025759  0.0003056941

With cache, first run:
org-up-heading-safe  23227       0.5300747539  2.282...e-05

With cache, second run on unchanged buffer:
org-up-heading-safe  23227       0.1447754880  6.233...e-06

The final speedup is 1-2 orders of magnitude (~15-56 times).
2021-05-15 16:13:49 +02:00
Bastien 24473b5e08 lisp/org.el: Use "[BUG]" instead of "Bug:" for bug reports
* lisp/org.el (org-submit-bug-report): Use "[BUG]" as the subject
prefix.
2021-05-15 16:13:49 +02:00
Bastien bfda3cc7df lisp/org.el: Don't let RET indent in source code blocks
* lisp/org.el (org-return): Don't try to indent in source code
blocks.

Reported-by: Nathaniel W Griswold <nate@manicmind.earth>
Link: https://orgmode.org/list/5DCBAF63-0E88-44AC-B892-1260F37E7E00@manicmind.earth/
2021-05-15 16:13:49 +02:00
Bastien 99d873b9c3 lisp/org.el: Fix indenting of planning line
* lisp/org.el (org-indent-line): Fix indenting of planning line.
2021-05-15 16:13:49 +02:00
Ihor Radchenko 7dcb1afb69 Improve org-link-plain-re
* lisp/ol.el (org-link-make-regexps): Allow URLs with up to two
levels of nested brackets.

* lisp/org.el (org-link-plain-re): Update docstring.

* testing/lisp/test-ol.el: Add tests for the plain link regular
expression.

(org-link-plain-re): Update docstring.  Now,

Now, URLs like [1] can be matched.  The new regexp is based on [2].
The docstring of `org-link-plain-re'  explicitly mentions that the
regexp must contain groups for the link type and the path.

[1] https://doi.org/10.1016/0160-791x(79)90023-x
[2] https://daringfireball.net/2010/07/improved_regex_for_matching_urls
2021-05-15 16:13:49 +02:00
satotake f00ad09e25 org-refile.el: Fix the case of emtpy buffer name
* lisp/org-refile.el (org-refile-get-targets): Ensure that the
arguments of `file-name-nondirectory' and `file-truename' are not nil.

This prevents errors from being raised when calling `org-refile' in a
buffer that is not visiting a file.

TINYCHANGE
2021-05-15 16:13:49 +02:00
Bastien 8531bb615c lisp/org.el: Minor aesthetic clean-up 2021-05-15 16:13:49 +02:00
Samim Pezeshki 90a9ee1741 lisp/org-agenda.el: Fix bug in `org-agenda-highlight-todo'
* lisp/org-agenda.el (org-agenda-highlight-todo): Skip formatting
the to-do keyword when `org-agenda-todo-keyword-format' is the
empty string.

TINYCHANGE
2021-05-15 16:13:49 +02:00
Bastien 5a0f6c9f75 lisp/ox-md.el: Mark some arguments as unused
* lisp/ox-md.el (org-md-latex-environment)
(org-md-latex-fragment): Mark some arguments as unused.
2021-05-15 16:13:49 +02:00
Bastien dd88356d3a lisp/org-inlinetask.el: Silent the byte-compiler
* lisp/org-inlinetask.el (org-inlinetask-promote)
(org-inlinetask-demote): Fix calls to `looking-back'.
2021-05-15 16:13:49 +02:00
Bastien fa3c9c8b69 lisp/org-id.el: Small enhancements
* lisp/org-id.el (org-id-locations-load, org-id-add-location):
Update messages.
(org-id-hash-to-alist, org-id-paste-tracker, org-id-find-id-file):
Docstring minor enhancements.
(org-id-new): Tiny refactoring.
2021-05-15 16:13:49 +02:00
Ihor Radchenko 4da4b3aa66 Allow moving inlinetasks using org-metaup/down
* lisp/org.el (org-metaup, org-metadown): Use
`org-drag-elementbackward'/`org-drag-element-forward' to move
inlinetasks.
2021-05-15 15:06:01 +02:00
Bastien ed5e28939b Fix code typo in 06c064e9 (take 2) 2021-05-15 14:26:56 +02:00
Bastien 77213acb8f Fix code typo in 06c064e9 2021-05-15 14:17:38 +02:00
Bastien 4ce78810ac lisp/org.el: Don't let RET indent in source code blocks
* lisp/org.el (org-return): Don't try to indent in source code
blocks.

Reported-by: Nathaniel W Griswold <nate@manicmind.earth>
Link: https://orgmode.org/list/5DCBAF63-0E88-44AC-B892-1260F37E7E00@manicmind.earth/
2021-05-15 13:48:40 +02:00
Bastien d37e8a14b7 lisp/org.el: Fix indenting of planning line
* lisp/org.el (org-indent-line): Fix indenting of planning line.
2021-05-15 11:00:49 +02:00
Ihor Radchenko f313b81841 Improve org-link-plain-re
* lisp/ol.el (org-link-make-regexps): Allow URLs with up to two
levels of nested brackets.

* lisp/org.el (org-link-plain-re): Update docstring.

* testing/lisp/test-ol.el: Add tests for the plain link regular
expression.

(org-link-plain-re): Update docstring.  Now,

Now, URLs like [1] can be matched.  The new regexp is based on [2].
The docstring of `org-link-plain-re'  explicitly mentions that the
regexp must contain groups for the link type and the path.

[1] https://doi.org/10.1016/0160-791x(79)90023-x
[2] https://daringfireball.net/2010/07/improved_regex_for_matching_urls
2021-05-15 10:33:23 +02:00
satotake d285831af3 org-refile.el: Fix the case of emtpy buffer name
* lisp/org-refile.el (org-refile-get-targets): Ensure that the
arguments of `file-name-nondirectory' and `file-truename' are not nil.

This prevents errors from being raised when calling `org-refile' in a
buffer that is not visiting a file.

TINYCHANGE
2021-05-15 10:19:19 +02:00
Samim Pezeshki 06c064e97c lisp/org-agenda.el: Fix bug in `org-agenda-highlight-todo'
* lisp/org-agenda.el (org-agenda-highlight-todo): Skip formatting
the to-do keyword when `org-agenda-todo-keyword-format' is the
empty string.

TINYCHANGE
2021-05-15 10:11:36 +02:00
Bastien 8544f555ac lisp/org-inlinetask.el: Silent the byte-compiler
* lisp/org-inlinetask.el (org-inlinetask-promote)
(org-inlinetask-demote): Fix calls to `looking-back'.
2021-05-15 09:55:12 +02:00
Bastien 0e39bf839a Throw user errors when trying to drag inline tasks
* lisp/org.el (org-metaup, org-metadown): Throw a user error
explaining that dragging inline tasks is not supported.

* lisp/org-inlinetask.el (org-inlinetask-insert-task)
(org-inlinetask-promote, org-inlinetask-demote): Fix bug when
demoting/promoting inline tasks at the end of the buffer and
throw user errors instead of errors.

Based on an initial patch by Carsten.

Reported-by: Christian Hemminghaus <chrhemmi@gmail.com>
Link: https://orgmode.org/list/CAE47VC=yhObXs3jexLUkf53cNzcOWUkTMqpF8QK4Dcg98QijyQ@mail.gmail.com/
2021-05-14 21:24:52 +02:00
Bastien 8b18405857 Throw user errors when trying to drag inline tasks
* lisp/org.el (org-metaup, org-metadown): Throw a user error
explaining that dragging inline tasks is not supported.

* lisp/org-inlinetask.el (org-inlinetask-insert-task)
(org-inlinetask-promote, org-inlinetask-demote): Fix bug when
demoting/promoting inline tasks at the end of the buffer and
throw user errors instead of errors.

Based on an initial patch by Carsten.

Reported-by: Christian Hemminghaus <chrhemmi@gmail.com>
Link: https://orgmode.org/list/CAE47VC=yhObXs3jexLUkf53cNzcOWUkTMqpF8QK4Dcg98QijyQ@mail.gmail.com/
2021-05-13 14:56:18 +02:00
Nicolas Goaziou dcb6013fb6 agenda: Fix org-duration-to-minutes error (take 2)
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
2021-05-12 06:37:54 +02:00
Bastien 88fbe21a88 Add Luc Pellissier as maintainer for two ob-* files
* lisp/ob-coq.el: Add a maintainer.

* lisp/ob-asymptote.el: Ditto.
2021-05-12 06:30:22 +02:00
Nicolas Goaziou c26f8d2cc5 agenda: Fix org-duration-to-minutes error (take 2)
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
2021-05-11 09:39:08 +02:00
Nicolas Goaziou 9a7207404c Merge branch 'maint' 2021-05-10 18:02:32 +02:00
Nicolas Goaziou 6107c2b15b Revert "agenda: Fix "org-duration-to-minutes: Invalid duration format" error"
This reverts commit bc857bfc62.

The "fix" breaks elsewhere, as reported below.

Reported-by: Daniel Ortmann <daniel.ortmann@oracle.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00592.html>
2021-05-10 18:00:58 +02:00
Timothy 981f25031d
ox-md: Use TeX-style $ math wrapping
* lisp/ox-md.el (org-md-latex-environment, org-md-latex-fragment):
These two new filters wrap LaTeX maths in $ / $$ TeX-style notation.
While ox-md endeavours to adhere to the original Markdown specification,
and not any particular variant, the original specification does not deal
with LaTeX fragments at all, and so this change does not reduce how
faithfully the original specification is followed.
There is a major upside to this though. Of the many Markdown variants
that have emerged, those that support LaTeX very often exclusively
support TeX style notation.  This change thus improves the utility of
the Markdown export for many use cases, and deviates no more from the
original specification that the current method.
2021-05-10 04:11:00 +08:00
Nicolas Goaziou 6f1ea80bbd Merge branch 'maint' 2021-05-09 21:51:17 +02:00
Nicolas Goaziou bc857bfc62 agenda: Fix "org-duration-to-minutes: Invalid duration format" error
* lisp/org-agenda.el (org-agenda-format-item): Compute duration with
`org-duration-to-minutes' before normalizing input.

Reported-by: Stephen Eglen <sje30@cam.ac.uk>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00584.html>
2021-05-09 21:49:23 +02:00
TEC 2ae308342a
org-plot: Fix calling at start of #+plot line
* lisp/org-plot.el (org-plot/gnuplot): When called with point at the
start of the #+plot: line, the behaviour of `org-table-begin' (called in
`org-table-to-lisp') caused no table to be detected.  To work around
this, when the point is at the zeroth column, it is temporarily shifted
one character to the right.
2021-05-09 23:49:46 +08:00
TEC 7dd667af67
org-plot: Use labels with 2d histogram plot
* lisp/org-plot.el (org-plot/preset-plot-types): When the :with
parameter is histograms, use text indices as the x-values.
2021-05-09 23:49:37 +08:00
Boruch Baum 5d2ccdae7f ol-w3m: handle w3m-image link information
* ol-w3m.el (org-w3m-copy-for-org-mode)
(org-w3m-get-next-link-start, org-w3m-get-prev-link-start):
Account for w3m-img links.
(org-w3m-get-anchor-start, org-w3m-get-prev-link-start)
(org-w3m-no-prev-link-p): Unused function notes.
(org-w3m-get-image-end): New function, for w3m-img links.

Related to Emacs bug #47088.
2021-05-08 07:31:50 -04:00
Bastien 348ecd8789 lisp/ob-awk.el: Add Tyler Smith as the maintainer 2021-05-08 09:40:23 +02:00
Bastien da2938d352 Merge branch 'maint' 2021-05-08 09:37:36 +02:00
Bastien 2956c86c20 lisp/ox-html.el (org-html-scripts): Fix missing curly bracket
* lisp/ox-html.el (org-html-scripts): Fix missing curly bracket.

Reported-by: Sebastian Berntsson <sebastian@ilait.se>
Link: https://orgmode.org/list/21ac82d9-91a5-fbdf-c22c-302f28d58ebe@ilait.se/
2021-05-08 09:37:11 +02:00
Stefan Kangas f1b9119954 lisp/org.el: Make `org-load-hook' obsolete
* lisp/org.el (org-load-hook): Make obsolete in favor of
`with-eval-after-load'.
2021-05-08 09:33:37 +02:00
Bastien 0f2ece647b Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
Tom Gillespie cbc1f96c41 lisp/ob-calc.el: Add Tom Gillespie as the maintainer
* lisp/ob-calc.el: Add Tom Gillespie as the maintainer.
2021-05-07 09:31:36 +02:00
Bastien eb3de47d25 Merge branch 'maint' 2021-05-06 14:40:38 +02:00
Bastien b4b35fc92d lisp/ol.el: Fix bug when storing links
* lisp/ol.el (org-store-link): Don' store two links when an a
radio link within a headline that contains a CUSTOM_ID property.

Reported-by: Fr Ml <fr_ml@t-online.de>
Link: https://orgmode.org/list/aadb23f3-c0fe-19aa-be79-50e51d16c41a@t-online.de/
2021-05-06 14:39:14 +02:00
Bastien f95a5cbacb Merge branch 'maint' 2021-05-06 13:51:52 +02:00
Bastien 3f39608857 lisp/org.el: Fix inserting a heading before the first entry
* lisp/org.el (org-insert-heading): When inserting a headline
before the first one, insert a blank line after the inserted
heading if the previous call to `org--blank-before-heading-p'
returned `t'.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87y2cxoybz.fsf@gmail.com/
2021-05-06 13:50:21 +02:00
Sébastien Miquel 6e5b39acd1 ob-tangle.el: Fix single block tangle
lisp/ob-tangle.el (org-babel-tangle-single-block): Fix the result when
`only-this-block' is `t' to match what is expected by
`org-babel-tangle'.
(org-babel-effective-tangled-filename): Extract the
computation of filename of tangled src block.
(org-babel-tangle-collect-blocks): Use `org-babel-effective-tangled-filename'.
2021-05-06 13:37:18 +02:00
Atlas48 bfc3d18b04 lisp/org-entities.el (org-entities): Add the Turkic dotted and dotless 'i'
* lisp/org-entities.el (org-entities): Add the Turkic dotted and
dotless 'i'.

TINYCHANGE
2021-05-06 13:10:18 +02:00
Nicolas Goaziou 62c90bef35 compat: Add `org-string-distance'
* lisp/ob-core.el (org-babel-edit-distance): Rename function
`org-string-distance' and move it to "org-compat.el".
(org-babel-check-src-block): Use `org-string-distance' instead.
* lisp/org-compat.el: Add `org-string-distance' for a future
deprecation in favor of `string-distance'.
2021-05-05 17:54:36 +02:00
Nicolas Goaziou 53d69d0002 Fix typo in `org-modules'
* lisp/org.el (org-modules): Fix typo.
2021-05-05 17:49:01 +02:00
Bastien 0a651b7469 lisp/org.el (org-adapt-indentation): Use nil by default
* etc/ORG-NEWS: Announce the new value of nil for
`org-adapt-indentation'.

* lisp/org.el (org-adapt-indentation): Use nil by default.

Link: https://orgmode.org/list/878s4x3bwh.fsf@gnu.org/
2021-05-05 09:52:50 +02:00
Sébastien Miquel 501b2a191c ob-tangle.el: (org-babel-tangle-collect-blocks): Use correct tangle name
* lisp/ob-tangle.el: (org-babel-tangle-collect-blocks): Use correct
tangle name.

The :tangle header argument might be some elisp, to be evaluated.
2021-05-05 09:03:45 +02:00
Sébastien Miquel d59f35fbb7 ob-tangle.el (org-babel-tangle): Fix readonly tangle
* lisp/ob-tangle.el (org-babel-tangle): Fix readonly tangle.
2021-05-05 08:42:46 +02:00
Bastien f838dbae77 Merge branch 'maint' 2021-05-04 22:44:34 +02:00
Nicholas Savage f8ee4ab4a7 lisp/ob-sqlite.el: Prevent output from being incorrectly parsed if it contains double-quotes.
* lisp/ob-sqlite.el (org-babel-sqlite--read-cell): New function.
(org-babel-sqlite-table-or-scalar): Use `org-babel-sqlite--read-cell'
instead of `org-babel-string-read' to prevent data from being ignored
if it contains double-quotes.

Reported-by: learnorchids@gmail.com
Link: https://orgmode.org/list/CAK5xwica4i8h09ObzCVPx2pe-T6B0_ju_MXiduRiY7GH+PkE_A@mail.gmail.com/
2021-05-04 22:44:22 +02:00
Bastien 4d15360bea Merge branch 'maint' 2021-05-04 22:24:46 +02:00
Bastien b718b7035d lisp/org.el (org-indent-line): Add missing arg to `looking-back'
* lisp/org.el (org-indent-line): Add missing arg to `looking-back'.
2021-05-04 22:23:51 +02:00
Bastien bc2659b8b9 lisp/ob-ledger.el: Add Eric S Fraga as the maintainer
* lisp/ob-ledger.el: Add Eric S Fraga as the maintainer.
2021-05-04 13:06:21 +02:00
Bastien edc2e68e85 Merge branch 'maint' 2021-05-04 00:22:45 +02:00
Bastien eecc0574d8 lisp/org-agenda.el: Prevent wrong scrolling
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
2021-05-04 00:22:33 +02:00
Bastien dfc0d522f1 Revert "lisp/org-agenda.el: Prevent wrong scrolling"
This reverts commit eca93742b6.
2021-05-04 00:20:07 +02:00
Bastien 01d3e671b4 Merge branch 'maint' 2021-05-03 22:28:47 +02:00
Bastien eca93742b6 lisp/org-agenda.el: Prevent wrong scrolling
* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
2021-05-03 22:27:48 +02:00
TEC ec6d1df9bc lisp/ox.el (org-export-to-file): Don't load the major mode
* lisp/ox.el (org-export-to-file): Don't load the major mode.

Prior to this, when `org-export-to-file' was called it activated the
major mode for that file type based on `auto-mode-alist'.  This can be
mildly annoying in various ways as loading the major mode (1) makes
the export take longer, (2) can produce unwanted "noise" while
initialising, namely warnings and errors related to the mode itself,
(3) can produce spurious files like an .auctex-auto folder.  By
locally binding `auto-mode-alist' to nil, all of these undesirable
behaviours can be avoided.

Link: https://orgmode.org/list/87lfa3fips.fsf@gmail.com/
2021-05-03 19:23:39 +02:00
Bastien 832b3951e8 Merge branch 'maint' 2021-05-03 19:11:47 +02:00
Mingkai Dong dfdd5cd0cd lisp/ox-html.el: Finish the headline numbering part by a full stop
* lisp/ox-html.el (org-html-headline): Finish the numbering part
with a full stop, to be consistent with the TOC numbers.

TINYCHANGE

Link: https://orgmode.org/list/2F46C11A-B2CD-445C-A811-CB05A043FE46@dong.mk
2021-05-03 19:10:52 +02:00
Bastien d48276b894 Replace org-speed-commands-user' by org-speed-commands'
* etc/ORG-NEWS: Announce `org-speed-commands'.

* doc/org-manual.org (Speed Keys): Document `org-speed-commands'
instead of `org-speed-commands-user'.

* lisp/org-compat.el (org-speed-commands-user): Make an obsolete
variable.

* lisp/org-keys.el (org-speed-commands-user): Remove.
(org-speed-commands): Rename from `org-speed-commands-default' and
make a defcustom.  Add the docstring of `org-speed-commands-user'.
(org-speed-command-help): Throw a message about obsolete option
`org-speed-commands-user' when set in the user configuration.
(org-speed-command-activate): Update docstring.

Link: https://orgmode.org/list/87eeep3c1u.fsf@bzg.fr/
2021-05-03 16:30:04 +02:00
Bastien 5e534aecaa Merge branch 'maint' 2021-05-03 16:25:55 +02:00
Bastien de93bf02bf lisp/org.el: More fixes to `org-indent-line'
* lisp/org.el (org-indent-line): Fixes indentation.
(org--get-expected-indentation): Don't handle the 'headline-data
value for `org-adapt-indentation' here, it is taken care upstream
in `org-indent-line'.
2021-05-03 16:25:24 +02:00
Bastien 2f200f50d6 Merge branch 'maint' 2021-05-03 15:59:53 +02:00
Nicholas Savage 238a80d3ad org-colview.el (org-columns): Replace org-map-entries with org-scan-tags
* lisp/org-colview.el (org-columns): Replace call to `org-map-entries'
to build cache with `org-scan-tags'.

Simplifies `org-columns' to call `org-scan-tags' instead of
`org-map-entries'.  This is to fix a bug where an unexpected non-existent
agenda file error was thrown if the buffer that `org-columns' was called
on was not yet saved to disk.  This also simplifies `org-columns' and
prevents unnecessary agenda preparation functions from running.
2021-05-03 15:59:39 +02:00
Bastien 4ca4b45a93 lisp/ob-groovy.el: Fix link
* lisp/ob-groovy.el: Fix link to the official website.
2021-05-03 14:59:44 +02:00
Bastien 096cacfdbf lisp/org-clock.el: Point to the new location of x11idle.c
* lisp/org-clock.el (org-clock-x11idle-program-name): Update
docstring to point to the new location of the x11idle.c program.
2021-05-03 13:10:03 +02:00
Bastien 670f45e0ee Merge branch 'maint' 2021-05-03 10:05:32 +02:00
Bastien ba9e531016 lisp/org.el: Fix another indentation case
* lisp/org.el (org-indent-line): With `org-adapt-indentation' set
to 'headline-data, don't indent after a headline, a planning line
or a drawer.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Link: https://orgmode.org/list/878s4wu9oe.fsf@gmail.com/T/#m658a98441dcce099a569ca5b228778aad5d102f3
2021-05-03 10:04:57 +02:00
Bastien d33c935ee7 Merge branch 'maint' 2021-05-03 10:01:25 +02:00
Bastien 445be13972 lisp/org.el: Fix indentation again
* lisp/org.el (org-indent-line): Take care of checking at the
beginning of the line.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Link: https://orgmode.org/list/878s4wu9oe.fsf@gmail.com/T/#m658a98441dcce099a569ca5b228778aad5d102f3
2021-05-03 09:59:54 +02:00
Bastien f3cdc5b211 Merge branch 'maint' 2021-05-03 08:57:17 +02:00
Bastien e7fc34ecf4 lisp/org.el: Update docstring of `org-return-and-maybe-indent'
* lisp/org.el (org-return-and-maybe-indent): Update docstring to
reflect the current behavior.
2021-05-03 08:56:47 +02:00
Bastien a31aeeebec Merge branch 'maint' 2021-05-03 08:47:46 +02:00
Bastien c3917c3a0b lisp/org.el (org-indent-line): Fix another bug
* lisp/org.el (org-indent-line): When `org-adapt-indentation' is
'headline-data, prevent indentation for any first non-empty line
after the headline, not just the one right after the headline.
2021-05-03 08:46:37 +02:00
Bastien c9be80ceb0 Add Nicolas as the maintainer for a few ox-*.el files
* lisp/ox.el:
* lisp/ox-texinfo.el:
* lisp/ox-publish.el:
* lisp/ox-org.el:
* lisp/ox-md.el:
* lisp/ox-icalendar.el:
* lisp/ox-beamer.el:
* lisp/ox-ascii.el: Add Nicolas as the maintainer.
2021-05-03 06:41:56 +02:00
Bastien 945c019176 lisp/org.el: Fix indentation when `org-adapt-indentation' is 'headline-data
* lisp/org.el (org--get-expected-indentation): Fix indentation of
non-headllines with `org-adapt-indentation' set to 'headline-data.
(org-indent-line): When `org-adapt-indentation' is 'headline-data,
don't indent when point is at the first line after a headline.
Update the docstring to make it explicit that indenting relatively
to current level only happens when `org-adapt-indentation' is set
to `t'.
2021-05-03 06:35:33 +02:00
Bastien c7331f859d lisp/org.el: Fix indentation when `org-adapt-indentation' is 'headline-data
* lisp/org.el (org--get-expected-indentation): Fix indentation of
non-headllines with `org-adapt-indentation' set to 'headline-data.
(org-indent-line): When `org-adapt-indentation' is 'headline-data,
don't indent when point is at the first line after a headline.
Update the docstring to make it explicit that indenting relatively
to current level only happens when `org-adapt-indentation' is set
to `t'.
2021-05-03 06:23:03 +02:00
Jeremie Juste ac8c009e00 lisp/ob-R.el: Fix session output with substrings matching prompts
* lisp/ob-R.el (org-babel-R-evaluate-session): New implementation for session output
results, that concat "^" to comint-prompt-regexp to avoid prompt
confusion with R.

Patch suggested by Jack Kamm:
https://orgmode.org/list/87h7slgbi5.fsf@gmail.com/
2021-05-03 00:15:09 +02:00
Bastien 884a3454fc Merge branch 'maint' 2021-05-02 19:30:31 +02:00
Ihor Radchenko 4c76962814 lisp/org.el: Don't fontify headlines with "::" as description items
* lisp/org.el (org-set-font-lock-defaults): Avoid fontifying headlines
with "::" as description list items.

Lists can start with "*", but "*" must not be at the beginning of
line.  Old regexp did not require whitespace before "*" in description
list items.

Reported-by: Ypo <ypuntot@gmail.com>
Link: https://orgmode.org/list/5adcfcda-35de-8281-a1ff-18d1c95bbde6@gmail.com/
2021-05-02 19:29:23 +02:00
Nicholas Savage 562e325c75 lisp/org-colview.el: Update org-columns to respect global-visual-line-mode
* lisp/org-colview.el (org-columns): Prevent enabling `truncate-lines'
when `global-visual-line-mode' is enabled.

This fixes a bug where `org-columns' overlays were disabling wrapping
of lines when `global-visual-line-mode` was already activated, and so
therefore expectation was that the lines would continue wrapping.
This is because `org-columns' was setting truncate-lines to t, when
global-visual-line-mode requires it to be set to nil. The interaction
between the two caused the wrapping not to occur.
2021-05-02 19:21:44 +02:00
Nicholas Savage cb0ef12801 lisp/org-colview.el: Update org-columns to respect global-visual-line-mode
* lisp/org-colview.el (org-columns): Prevent enabling `truncate-lines'
when `global-visual-line-mode' is enabled.

This fixes a bug where `org-columns' overlays were disabling wrapping
of lines when `global-visual-line-mode` was already activated, and so
therefore expectation was that the lines would continue wrapping.
This is because `org-columns' was setting truncate-lines to t, when
global-visual-line-mode requires it to be set to nil. The interaction
between the two caused the wrapping not to occur.
2021-05-02 19:21:26 +02:00
Nicolas Goaziou 3e497bec35 Merge branch 'maint' 2021-05-02 17:51:15 +02:00
Nicolas Goaziou ab82d6ae25 ox-ascii: Fix title when 2 width char is used
* lisp/ox-ascii.el (org-ascii-template--document-title): Find width of
title with `string-width' instead of counting characters.

Fixes: #48148

Reported-by: Shingo Tanaka <shingo.fg8@gmail.com>
2021-05-02 17:48:47 +02:00
Bastien c67413a7b6 Merge branch 'maint' 2021-05-02 08:50:18 +02:00
Bastien 5584ffc6c4 lisp/org.el (org--backward-paragraph-once): Handle corner case
* lisp/org.el (org--backward-paragraph-once): Don't throw an error
when at the first headline after a single empty line.
2021-05-02 08:49:53 +02:00
Bastien feacffe865 Merge branch 'maint' 2021-05-02 07:10:46 +02:00
Bastien 5021bada95 lisp/org.el: Fix bug when unfolding a subtree
* lisp/org.el (org-cycle-internal-local): Use 'tree instead of
'canonical when setting the visibility of the subtree to unfold.

Reported-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
Link: https://orgmode.org/list/CAELBRWLakDCbawmMdS5Qi0qh5FC2ixF82xNfCg75wMjmze6pbA@mail.gmail.com/
2021-05-02 07:09:55 +02:00
Bastien c7824f9cf8 Merge branch 'maint' 2021-05-02 05:46:57 +02:00
Bastien eedbe286ef lisp/org-table.el: Fix bug with `org-table-wrap-region'
* lisp/org-table.el (org-table-copy-region): Only display a
message when called interactively.
(org-table-wrap-region): Prevent `org-table-cut-region' from
losing track of the region beginning.

Reported-by: Marko Schuetz-Schmuck <marko.schutz@upr.edu>
Link: https://orgmode.org/list/875z84fnwv.fsf@tpad-m.i-did-not-set--mail-host-address--so-tickle-me/
2021-05-02 05:44:46 +02:00
Sébastien Miquel a2cb9b853d ob-tangle.el: Improve tangling
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Group
collected blocks by tangled file name.
(org-babel-tangle): Avoid quadratic behavior in number of blocks and
set modes before writing to file.
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): Update test.
2021-05-01 22:30:42 +02:00
Bastien f84033b088 Merge branch 'maint' 2021-05-01 22:26:06 +02:00
Bastien ccd513a3c5 lisp/org.el: Don't let `visual-line-mode' override Org's keybindings
* lisp/org.el (org-mode): Don't let `visual-line-mode' override
Org's keybindings for C-a, C-e and C-k.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87a6zkv3m2.fsf@gmail.com/
2021-05-01 22:24:57 +02:00
Kyle Meyer 2d965df01a Merge branch 'maint' 2021-05-01 15:49:24 -04:00
Kyle Meyer 94837fc6b5 agenda: Fix org-agenda-show-new-time on Emacs 24
* lisp/org-agenda.el (org-agenda-show-new-time): Add fallback for when
window-font-width isn't available.

efbf96389 (org-agenda.el: Fix display of agenda new time, 2020-02-02)
reworked the column calculation to use window-font-width, but that
function isn't available until Emacs 25, and it's definition can't be
easily ported to org-compat.

Instead just use the old logic, which had been in place since v8.2.6,
when window-font-width isn't available.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 15:48:11 -04:00
Kyle Meyer 8bd3bd093b ob-C: Adjust pcase pattern for Emacs 24 compatibility
* lisp/ob-C.el (org-babel-C-header-to-C): Switch pcase patterns to
"`X" rather than "'X", which isn't supported until Emacs 25.

These were introduced by 38f87a26b (ob-C.el: Fix a number a
regressions related to table parameters, 2021-04-29).

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 15:43:01 -04:00
Ihor Radchenko 0a8079b4d7 Bypass read-only state in org-entry-put
* lisp/org.el (org-entry-put): Ignore read-only state of the buffer.

Fixes bug when ID property is not insered when creating ID in an
indirect read-only org-goto buffer. [1]

[1] https://orgmode.org/list/8ffe2da5-e2cb-f44c-0a46-b19873c0bdf2@gmx.de/
2021-05-01 18:45:15 +02:00
Bastien Guerry 6ceb4c1c89 Merge branch 'maint' 2021-05-01 18:40:26 +02:00
Bastien Guerry 842ab092ae lisp/org.el: Make `org-toggle-link-display' more consistent
* lisp/org.el (org-do-emphasis-faces): Don't hide with `org-link'
as the value for the invisible text property.

Before this commit, M-x org-toggle-link-display RET would also toggle
the emphasis markers.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87o8jnzjao.fsf@gmail.com/
2021-05-01 18:38:31 +02:00
Bastien Guerry 6f72efd390 Merge branch 'maint' 2021-05-01 18:00:08 +02:00
Bastien Guerry fb30301888 lisp/org.el: Fix bug about inserting a heading before the first headline
* lisp/org.el (org-insert-heading): Fix bug when inserting a
heading before the first headline.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/875z73br32.fsf@gmail.com/
2021-05-01 17:59:20 +02:00
Gustavo Barros e8562a3327 date/time prompt: Provide support for HHhMM time input
* lisp/org.el (org-read-date-analyze): Add support for HHhMM time
input, in similar way as for am/pm times.
* doc/org-manual.org (The date/time prompt): Add example to illustrate
the feature.

TINYCHANGE
2021-05-01 17:40:17 +02:00
Ihor Radchenko c7de815c5a lisp/ob-gnuplot.el: Use `org-babel-local-file-name'
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): Use
`org-babel-local-file-name'.

TINYCHANGE
2021-05-01 16:32:56 +02:00
Richard Garner 154e1f19a9 lisp/org-capture.el: Add a new :refile-targets template option
* lisp/org-capture.el (org-capture-templates): Add :refile-targets.
(org-capture-refile): Honor :refile-targets.

TINYCHANGE
2021-05-01 13:07:55 +02:00
TEC b90b850ae8 ob-core: Remove LaTeX environment #+results type
* lisp/ob-core.el (org-babel-result-end): Alloow the result to end
into a LaTeX environment.

By adding latex-enviroment to the possible results types, a much
richer experience is possible for backends that can produce
LaTeX-formatted maths as their results (for example: Calc, Julia with
Latexify, Python with SymPy, Octave with symbolic). This is superior
to a LaTeX export block as LaTeX environments can be (1) rendered
inline, and (2) better used in non-LaTeX export formats (e.g. HTML
with MathJax).  Without this, backends can output a LaTeX environment,
but new results will be added in front instead of replacing the
environment.
2021-05-01 13:03:09 +02:00
Bastien Guerry ab01161b2a Fix 7da20ff21 2021-05-01 12:50:10 +02:00
Bastien Guerry e080eb759a lisp/org-agenda.el: Small refactoring and docstring enhancement
* lisp/org-agenda.el (org-agenda-priority): Small refactoring
and docstring enhancement.

Link: https://orgmode.org/list/87o8j3360f.fsf@kyleam.com/
2021-05-01 12:41:46 +02:00
Bastien Guerry 4394eaf0e2 Merge branch 'maint' 2021-05-01 12:27:18 +02:00
Ivan Sokolov 45ca597f96 lisp/ob-sql.el: Prevent from getting stuck with an error
* lisp/ob-sql.el (org-babel-edit-prep:sql): Prevent from getting
stuck with an error.

TINYCHANGE
2021-05-01 12:26:38 +02:00
TEC eef9027cd2 org: Add font-lock rule for inline export snippets
* lisp/org.el (org-set-font-lock-defaults): Add font-lock rule for
inline export snippets.
2021-05-01 12:00:20 +02:00
Bastien Guerry 80a676c722 Revert "org: Add font-lock rule for inline export snippets"
This reverts commit 9af8d55f07.
2021-05-01 12:00:08 +02:00
TEC 9af8d55f07 org: Add font-lock rule for inline export snippets
* lisp/org.el (org-set-font-lock-defaults): Add font-lock rule for
inline export snippets.
2021-05-01 11:59:46 +02:00
Bastien Guerry c1f576a7e5 Merge branch 'maint' 2021-05-01 11:57:37 +02:00
TEC 400d2d9fd7 org-src: Use point instead of column for coords
* lisp/org-src.el (org-src--coordinates)
(org-src--goto-coordinates): Use point instead of column.

Using a column-based approach fails to account for invisible regions
or display overlays that change the number of columns: for example,
showing a LaTeX \alpha as α.  In src edits which involve such
structures, this causes the point to be shifted undesirably.  By using
a point-based approach this issue does not occur.
2021-05-01 11:57:27 +02:00
Alan D. Salewski 9aa9f3b1f7 org-clock.el: clocktable ':formula %' now includes per-file time pct
* lisp/org-clock.el (org-clocktable-write-default): When ':formula %'
  is in-effect, show the per-file time percentage in the '%' column.

TINYCHANGE

This change only has an effect when multiple files are contributing to
a given clocktable (such as when ':scope agenda' has been specified).
The existing behavior is that such tables have an extra 'File' column,
and each individual file that contributes has its own summary line
with the headline value '*File time*'.  Those summary rows also
produce a rollup time value for the file in the 'Time' column.

Prior to this change, the built-in '%' formula does not produce a
calculation for those per-file times in the '%' column (the relevant
cells in the '%' column were blank).  With this change, the percentage
contribution of each individual file time to the total time is shown.

The more agenda files you have, the more useful this behavior becomes.

Signed-off-by: Alan D. Salewski <ads@salewski.email>
2021-05-01 11:51:18 +02:00
Bastien Guerry bb24248b82 lisp/ox-html.el: Set `org-html-head-include-scripts' to nil
* lisp/ox-html.el (org-html-scripts): Enhance docstring.
(org-html-head-include-scripts): Default to nil and enhance docstring.

Link: https://orgmode.org/list/498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org/
2021-05-01 11:25:51 +02:00
Anthony Carrico dcd7b576b7 lisp/ox-html.el (org-html-scripts): Small refactoring
* lisp/ox-html.el (org-html-scripts): Small refactoring.

This replays the Javascript refactoring of commit 471054136.

Link: https://orgmode.org/list/498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org/
2021-05-01 11:12:51 +02:00
Anthony Carrico 7c9bf397b5 lisp/ox-html.el (org-html-scripts): Small refactoring
* lisp/ox-html.el (org-html-scripts): Small refactoring.

This replays the Javascript refactoring of commit 471054136.

Link: https://orgmode.org/list/498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org/
2021-05-01 11:10:17 +02:00
Nick Daly 7da20ff219 lisp/ob-plantuml.el: New option `org-babel-plantuml-svg-text-to-path'
* lisp/ob-plantuml.el (org-babel-plantuml-svg-text-to-path): New option.
(org-babel-execute:plantuml): Use the new option to add a SVG-specific
post-export step that runs inkscape text-to-path replacement over
the output file.

TINYCHANGE
2021-05-01 10:58:25 +02:00
Utkarsh Singh 7c99d15557 org-table.el: Allow to import files with no .txt, .tsv or .csv
* lisp/org-table.el (org-table-import): Allow to import files
with no .txt, .tsv or .csv extension.

TINYCHANGE
2021-05-01 10:48:07 +02:00
Bastien Guerry 0a689bf6c5 lisp/ox-html.el: Add TEC as the maintainer
* lisp/ox-html.el: Add TEC as the maintainer.
2021-05-01 10:26:06 +02:00
Bastien Guerry ee507de478 lisp/org.el (org-ctrl-c-ctrl-c): Fix bug
* lisp/org.el (org-ctrl-c-ctrl-c): Fix bug.

Commit aea31b065 introduced a bug: C-c C-c on a row of a table that
has no #+plot line, (org-element-property :post-affiliated context)
would return nil, so we first need to check whether we are on a #+plot
line.
2021-05-01 08:52:35 +02:00
Bastien Guerry 84d6c31069 Merge branch 'maint' 2021-05-01 08:35:01 +02:00
Bastien Guerry d18071b4ff lisp/org-agenda.el: Make tags filtering case-sensitive
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-get-represented-tags)
(org-agenda-filter-make-matcher-tag-exp): Make tags filtering
case-sensitive.

This fixes a bug introduced in commit 13a1a4fb9.
2021-05-01 08:33:20 +02:00
Kyle Meyer d63dd37e78 Merge branch 'maint' 2021-05-01 00:40:00 -04:00
Pablo Barraza Cornejo 390063d8df ox-html.el/inline-image export: Fix caption numbering
* lisp/ox-html.el (org-html-standalone-image-p): Remove quote which
causes `org-html-standalone-image-p' to not check if
`org-html-standalone-image-predicate' is fbound and see if it's
initialized.

TINYCHANGE
2021-05-01 00:38:39 -04:00
Kyle Meyer df84100d0c org-display-inline-images: Silence byte-compiler on Emacs <26
* lisp/org.el (org-display-inline-images): Guard image-map use with
boundp check rather than version check.

Guarding with a boundp will pacify the byte-compiler and is a direct
check that the thing we care about is available, so there's no need to
rely on the version check.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 00:38:39 -04:00
Kyle Meyer 869b7a21b9 org-open-file: Avoid make-process for Emacs 24 compatibility
* lisp/org.el (org-open-file): Select a pipe connection type with
process-connection-type rather than make-process, which isn't
available until Emacs 25.

This uses the alternative approach suggested by Eli Zaretskii in the
thread that led to 5db61eb0f (org.el: Avoid xdg-open silent failure,
2021-03-21): https://orgmode.org/list/83y2g96ta6.fsf@gnu.org

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
2021-05-01 00:38:39 -04:00
Kyle Meyer 45a3d7a900 org-tags-expand: Mark unused argument to silence byte-compiler
* lisp/org.el (org-tags-expand): Mark DOWNCASED as unused.
2021-05-01 00:07:09 -04:00
Nicolas Goaziou e3153145f4 Merge branch 'maint' 2021-04-30 15:51:20 +02:00
Nicolas Goaziou e266fac1ed ox-texinfo: Property display images with relative file names
* lisp/ox-texinfo.el (org-texinfo--inline-image): Make sure to remove
leading "./" from file name.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00873.html>
2021-04-30 15:50:25 +02:00
Bastien Guerry f2bedc8881 lisp/ox-html.el: Remove type="text/javascript"
* lisp/ox-html.el (org-html-scripts, org-html-infojs-template)
(org-html-mathjax-template): Remove type="text/javascript".

Reported-by: TEC <tecosaur@gmail.com>
Link: https://orgmode.org/list/874kkkxqma.fsf@gmail.com/
2021-04-30 10:20:11 +02:00
TEC aea31b0656 org: Enable plotting with C-c C-c
* lisp/org.el (org-ctrl-c-ctrl-c): When at a table, call
`org-plot/gnuplot' if the current line starts with "#+plot".
2021-04-30 09:11:04 +02:00
Nicholas Savage c212b7dae8 ob-eval.el: Refactoring `org-babel-eval' to improve readability
* ob-eval.el (org-babel-eval): Improve documentation and rename local
variables to be consistent with `org-babel--shell-command-on-region'
* (org-babel--shell-command-on-region): Remove START and END as
parameters.
* (org-babel--shell-command-on-region): Refactored out parts of
function to `org-babel--write-temp-buffer-input-file' and `org-babel--get-shell-file-name'.

This removes two parameters from
`org-babel--shell-command-on-region'. It appears that START and END
were parameters only because shell-command-on-region has them. This
function is only called by org-babel-eval so it looks safe to remove
those parameters, since they are always (point-min) and (point-max)
and are never changed. Given the way the function works and that it
is, it is unlikely that any user code relies on it.
2021-04-30 08:56:33 +02:00
Bastien Guerry ead3f5d498 Merge branch 'maint' 2021-04-30 08:52:13 +02:00
Aaron L. Zeng e2ffee96d2 ol.el: Fix confusing variable name
* ol.el (org-link--open-help): Fix a confusing variable name.  No
behavior changes.

TINYCHANGE
2021-04-30 08:51:54 +02:00
Bastien Guerry 856591010e Merge branch 'maint' 2021-04-29 16:07:39 +02:00
tbanel 38f87a26b5 ob-C.el: Fix a number a regressions related to table parameters
* ob-C.el (org-babel-C-expand-C, org-babel-C-header-to-C,
org-babel-C-expand-D): Add a `TYPE' parameter to
`org-babel-C-header-to-C' so that the helper functions return the
correct type.  Previoulsy for tables of non-strings the helper
functions would attempt to return a string, leading to compilation
errors.

* ob-C.el (org-babel-C-header-to-C): Correctly quote header elements.
Before, if the elisp value was not a string, it would not quote it,
leading to a syntax error.

* ob-C.el (org-babel-C-utility-header-to-C): Include `string.h' in
header `get_column_num' requires `strcmp', leading to compilation
errors.

* ob-C.el (org-babel-C-var-to-C): prefered declaration of a table in D
differs from C and C++. Example in C: `int table[2][3] = ...;'. In D:
`int[3][2] table=...;'

This patch is mainly based on Asa Zeren <asaizeren@gmail.com> patch of
Nov 5 2020, which was not commited at that time.
2021-04-29 15:31:51 +02:00
TEC 44f409e21e
org-plot: replace ignore-error with condition-case
* lisp/org-plot.el (org-plot/gnuplot): `ignore-error' was introduced
in Emacs 27, and Org's minimum supported Emacs is 24.  So, to maintain
compliance I replaced the `ignore-error' call with a `condition-case`.
2021-04-29 00:49:52 +08:00
Ihor Radchenko 232d9a0600 Bypass read-only state in org-entry-put
* lisp/org.el (org-entry-put): Ignore read-only state of the buffer.

Fixes bug when ID property is not insered when creating ID in an
indirect read-only org-goto buffer. [1]

[1] https://orgmode.org/list/8ffe2da5-e2cb-f44c-0a46-b19873c0bdf2@gmx.de/
2021-04-28 17:25:43 +02:00
Stefan Monnier 17ef1b39b0 ox: Fix various uses of the non-lexical-binding ELisp dialect
* lisp/ox.el (org-export--get-global-options,
org-export-insert-default-template): Use lexical-binding.
(org-export--generate-copy-script): Return a closure rather than
list starting with `lambda`.
(org-export-async-start): Turn it into a function (there seems to be
no reason this was a macro).  Use `write-region` rather than
`with-temp-file`.  Always use `utf-8-emacs-unix` coding system since
it's more efficient and is guaranteed to handle all chars.
Use lexical-binding in the temp file as well.
Actually set `debug-on-error` if `org-export-async-debug` says so.
(org-export-to-buffer, org-export-to-file): Pass a closure rather than
list starting with `lambda` to `org-export-async-start`.
2021-04-28 10:40:32 +02:00
Bastien Guerry 047fa8c319 Merge branch 'maint' 2021-04-28 09:23:29 +02:00