Commit Graph

16868 Commits

Author SHA1 Message Date
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
Maxim Nikulin 24a7ed50b3 org-protocol.el: Fix detection of old-style URIs
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol): Avoid
incorrect regexp in check whether command line argument uses new syntax.
Fix failures of org-protocol tests.

Question mark was not escaped in the previous version 928e67df7e,
so any string was matched by lazy "*".  Match in never used,
thus `string-match-p` would be better, but actually regexp is redundant
here.

It is not documented what browser or desktop environment adds extra
slash before "?".  Accordingly to
mid:A2B0655F-BF28-4943-BC05-99021BFDA1B3@robewald.de, Windows may be
involved.  Likely it happens with double slash after schema as in
org-protocol://capture?url=URL&title=TITLE due to subprotocol is
considered as host name and URI is normalized by adding a slash
as mandatory path part before "?" query.  So just reverting the original
commit will likely cause a regression.  Another guess is that
with single or triple slash (org-protocol:/capture?url=URL)
subprotocol is a part of path thus no "smart" actions are necessary.
2021-04-28 09:23:22 +02:00
Bastien Guerry ebcee052fd Revert "org.el (org-sort-remove-invisible): Remove spurious spaces"
This reverts commit 5be650714d.
2021-04-28 08:48:29 +02:00
TEC 2a1b0d8ae0 ox-html.el: add lang label to authinfo src blocks
* lisp/ox-html.el (org-html-style-default): `authinfo-mode' is defined
in Emacs 27. As such, in the CSS add an "Authinfo" lang label to
authinfo src blocks.
2021-04-28 08:27:32 +02:00
Bastien Guerry a51c0f22b8 ox-html.el (org-html-scripts, org-html-style-default): Use defcustom
* ox-html.el (org-html-scripts, org-html-style-default): Turn
into configurable options.
2021-04-28 08:25:28 +02:00
TEC 70c4903c9f lisp/ox-html.el: Enhance `org-html-style-default'
* lisp/ox-html.el (org-html-style-default): Enhance.
2021-04-28 08:21:04 +02:00
TEC 00cd6de31b ox-html.el: Limit maximum content width and center
* lisp/ox-html.el (org-html-style-default): Improve appearance and
legibility on large screens buy centering and limiting the content
width to the upper end of advised line width, ~140 characters.
2021-04-28 08:17:13 +02:00
TEC ce04ec0e55 ox-html.el: remove CDATA strings
* lisp/ox-html.el (org-html-scripts, org-html-style-default)
(org-html-infojs-template): Remove CDATA strings, now obsolete.

See https://developer.mozilla.org/en-US/docs/Web/API/CDATASection#specifications
2021-04-28 08:15:45 +02:00
Juan Manuel Macias 5be650714d org.el (org-sort-remove-invisible): Remove spurious spaces
* org.el (org-sort-remove-invisible): Remove spurious spaces.

TINYCHANGE
2021-04-28 07:45:05 +02:00
David Asabina 08e62edb3a org-protocol: Fix missing '+' in js snippet
* org-protocol (org-protocol-capture): Add missing plus-sign to
javascript snippet to allow readers of the doc string to use example
snippet with minimal edits.

TINYCHANGE
2021-04-28 07:38:08 +02:00
Bastien Guerry 73fda22519 Merge branch 'maint' 2021-04-28 07:37:55 +02:00
David Asabina a32f015aac org-protocol: Fix missing '+' in js snippet
* org-protocol (org-protocol-capture): Add missing plus-sign to
javascript snippet to allow readers of the doc string to use example
snippet with minimal edits.

TINYCHANGE
2021-04-28 07:37:45 +02:00
Eric Abrahamsen 0c4e844c86 Remove default binding for org-table-blank-field
* lisp/org-keys.el: The command isn't useful enough to occupy such a
useful keybinding as "C-c SPC".
2021-04-28 05:50:17 +02:00
Nicolas Goaziou ff72928da1 Merge branch 'maint' 2021-04-27 23:27:56 +02:00
Nicolas Goaziou e9f03779bc ol-info: Fix description when storing "info" link
* lisp/ol-info.el (org-info-store-link): Fix typo.

Reported-by: Alex <alex.giorev@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00696.html>
2021-04-27 23:26:55 +02:00
Cheong Yiu Fung a1184f7d61 Add `ancestors-full' visibility setup to `org-show-context-detail'
* lisp/org.el(org-show-context-detail): Add `ancestors-full' visibility setup.
(org-show-set-visibility): Update accordingly.
* testing/lisp/test-org.el: Add tests.
2021-04-27 22:26:29 +02:00
Nicolas Goaziou 10e22f57f7 ol: Inserting help links ask for description again
* lisp/ol.el (org-store-link): Allow a store function to
set :description to nil without falling back to link value.
(org-link--store-help): Set :description to nil.
2021-04-27 21:58:55 +02:00
Protesilaos Stavrou 667cb6f1ae org-faces.el: Use fixed-pitch
* org-faces.el (org-hide, org-date, org-table, org-formula)
(org-code, org-block, org-verbatim): Use fixed-pitch.

Link: https://orgmode.org/list/875z8njaol.fsf@protesilaos.com/
2021-04-27 21:26:37 +02:00
Nicolas Goaziou beb010a3a5 ol: Fix storing link from a keybinding help buffer
* lisp/ol.el (org-link--store-help): Store the function attached to
the binding instead of the binding itself.
2021-04-27 17:50:18 +02:00
Nicolas Goaziou 3d353b0065 ol: Fix org-link--store-help
* lisp/ol.el (org-link--store-help): Read symbol without relying on
a hack.
2021-04-27 17:47:34 +02:00
Nicolas Goaziou 3b1467daa6 ol: Add missing docstring
* lisp/ol.el (org-link--store-help): Add missing docstring.
2021-04-27 17:28:39 +02:00
Nicolas Goaziou 4f8a2758cb ol: Factorize "help" link store function
* lisp/ol.el (org-link--store-help): New function.
(org-store-link): Do not hard-code "help" links. Use regular
`org-link-set-parameters' process.
2021-04-27 17:26:11 +02:00
Bastien Guerry 17084f6425 Merge branch 'maint' 2021-04-27 10:21:53 +02:00
Bastien Guerry b1ff9afc3b ox.el: Remove .gpg extension from the exported file-name
* ox.el (org-export-output-file-name): Remove .gpg extension.

Reported-by: Adalricus Ovicula <adalricus@inventati.org>
Link: https://orgmode.org/list/87a74x7g6v.fsf@xenon.ovicula/

This is a rework of the previous reverted commit e8c24b66a.
2021-04-27 10:21:05 +02:00
Bastien Guerry 82707041b0 Revert "ox.el: Remove .gpg extension from the exported file-name"
This reverts commit e8c24b66af.
2021-04-27 10:16:13 +02:00
Bastien Guerry e8c24b66af ox.el: Remove .gpg extension from the exported file-name
* ox.el (org-export-output-file-name): Remove .gpg extension.

Reported-by: Adalricus Ovicula <adalricus@inventati.org>
Link: https://orgmode.org/list/87a74x7g6v.fsf@xenon.ovicula/
2021-04-27 10:04:27 +02:00
Bastien Guerry 94d8d8ff50 etc/ORG-NEWS: Announce the signature change for `org-tags-expand'
* lisp/org.el (org-tags-expand): Remove obsolete argument.

* etc/ORG-NEWS: Announce the signature change for `org-tags-expand'.
2021-04-27 09:51:21 +02:00
Yuri D. Lensky 8bdcf51acf lisp/org.el: Update previews correctly when color chnages.
* lisp/org.el (org-format-latex): When computing a hash that
determines if a preview needs to be re-generated, use the actual color
of the face rather than just the setting symbol.
2021-04-27 09:45:49 +02:00
Bastien Guerry 31d48755bf Merge branch 'maint' 2021-04-27 09:43:11 +02:00
Bastien Guerry 13a1a4fb96 Be more consistent about treating tags as case-sensitive
* lisp/org-agenda.el (org-agenda-finalize):
(org-agenda-format-item): Do not downcase tags.
(org-downcase-keep-props): Remove unused function.
(org-agenda-filter-expand-tags): Do not case-fold search.

* lisp/org.el (org-tags-expand): Document `downcased' argument as
obsolete and do not allow to expand downcased tags.

* testing/lisp/test-org.el (test-org/tags-expand): Remove test for
downcased tags expansion.

* doc/org-manual.org (TODO keywords, tags, properties, etc.):
Suggest that user-defined are usually lowercase, but don't make it
a requirement.

Reported-by: David Masterson <dsmasterson92630@outlook.com>
Link: https://orgmode.org/list/SJ0PR03MB5455D8D0C4F71AA495A9ABF79B709@SJ0PR03MB5455.namprd03.prod.outlook.com/
2021-04-27 09:41:26 +02:00
Bastien Guerry e6d9b642c9 Merge branch 'maint' 2021-04-27 09:29:29 +02:00
Bastien Guerry 26d1d29cf9 lisp/org.el: Small refactoring
* lisp/org.el (org--get-expected-indentation): Use
`org-element-lineage' to check whether the point is right at the
beginning of a logbook drawer.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87pmygnr7h.fsf@localhost
2021-04-27 09:28:17 +02:00
Bastien Guerry bd10c31e70 Merge branch 'maint' 2021-04-27 08:43:35 +02:00
Bastien Guerry 730a05f787 org.el: Fix indentation of new notes in a logbook drawer
* lisp/org.el (org--get-expected-indentation): Fix indentation of
new notes in a logbook drawer when org-adapt-indentation is set to
'headline-data.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/878s9p4xtt.fsf@gnu.org/
2021-04-27 08:41:04 +02:00
Bastien Guerry 43f6ced0da lisp/org.el: Indent list items in drawers correctly
* lisp/org.el (org-fixup-indentation): Indent list items in drawers
correctly, by respecting existing relative indentation.
2021-04-27 08:37:32 +02:00
Bastien Guerry 29d4cc1802 Merge branch 'maint' 2021-04-26 21:52:25 +02:00
Bastien Guerry 058339d6e6 org-table.el: Fix a bug when displaying a table header
* lisp/org-table.el (org-table-row-get-visible-string): Fix wrong
beginning of the header string.
(org-table-header-set-header): Get the real beginning of the line.

Reported-by: "Oorja Sandhu" <oorja.sandhu@inoutbox.com>
Link: https://orgmode.org/list/7beea3b5-6fe5-4ba6-831e-19a88d87de6b@www.fastmail.com/
2021-04-26 21:51:12 +02:00
TEC ac3148ef8d
org-plot: Don't move point when plotting
* lisp/org-plot.el (org-plot/gnuplot): Expanding the `save-excursion'
block to include `org-plot/goto-nearest-table` prevents the current
point from being moved, and doesn't affect the rest of the function.
2021-04-26 23:51:12 +08:00
TEC 2c22bba4a2
org-plot: Expand file name of output image
* lisp/org-plot.el (org-plot/gnuplot-script): The gnuplot process this
generated content is sent to may be operating in a different directory,
and hence this may write to a different file than intended.  By
expanding the file name first, this is no longer a concern.
2021-04-26 23:51:12 +08:00
TEC 73a96c63a9
org-plot: Ignore gnuplot buffer read-only error
* lisp/org-plot.el (org-plot/gnuplot): When
`gnuplot-send-buffer-to-gnuplot` is called, it may emit the error
"kill-region: Text is read-only: #<buffer *gnuplot*>" when the plot
operation has been successful.  This prevents `org-plot/gnuplot` from
executing the rest of the function, which is undesirable.
It's preferable just to ignore this error.
2021-04-26 23:51:12 +08:00
TEC dadbd025fa
org-plot: Refresh inline images after plotting
* lisp/org-plot.el (org-plot/redisplay-img-in-buffer): New function
which searches the current Org buffer for overlays of a certain image,
and refreshes those overlays.
(org-plot/gnuplot): Use `org-plot/redisplay-img-in-buffer' after
plotting to redisplay any associated inline images.
2021-04-26 22:50:37 +08:00
TEC 0f7d2823fd
org-plot: Make checkdoc happier
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data,
org--plot/values-stats, org--plot/sensible-tick-num,
org--plot/nice-frequency-pick, org--plot/merge-alists,
org--plot/prime-factors, org-plot/preset-plot-types,
org--plot/radar-setup-template, org-plot/gnuplot-term-extra,
org-plot/gnuplot): Rewrite docstrings to make checkdoc happier.
2021-04-26 22:50:36 +08:00
Bastien Guerry 97a2022382 Merge branch 'maint' 2021-04-26 14:24:03 +02:00
Bastien Guerry 29d21ea628 Revert "ox-html.el: Use classList and put in the public domain"
This reverts commit 4710541365.
2021-04-26 14:23:43 +02:00
Sameer Rahmani 4efab7681e ox-html.el: Add HTML_CONTENT_CLASS to support css classes in content tag
* lisp/ox-html.el (org-html-template): Added the support for a CSS
class name to the content tag which wraps the entire content. The CSS
class name can be set via in buffer HTML_CONTENT_CLASS property or
:html-content-class for org publish.

TINYCHANGE
2021-04-26 10:49:24 +02:00
Jamie Bayne ea8f7610ce Allow user to set ob-lilypond header arguments
* ob-lilypond.el (org-babel-lilypond-set-header-args): Replace
hard-coded settings with user-configurable variable.
(org-babel-header-args:lilypond): Modify documentation.
(ob-lilypond-header-args): New variable.

TINYCHANGE
2021-04-26 10:26:07 +02:00
Ihor Radchenko 0260d2fcf6 Allow multiple %(expression) instances in org-agenda-prefix-format
* lisp/org-agenda.el (org-compile-prefix-format): Use non-greedy match
for %(expression).

Previously, format like "%-12.12s%(expr1) %(expr2)" would not be
parsed correctly because of greedy "(.+)" regexp used to match the
expressions.
2021-04-26 10:06:18 +02:00
TEC d96e897579 ox-html: Use <img> tags for svgs, not <object>
* lisp/ox-html.el (org-html--format-image, org-html--svg-image): Remove
special treatment of SVGs with <object>, and just use <img>.  This used
to be poorly supported, but since Firefox 4 / Chrome 28 / Safari 9 this
is no longer a concern (https://caniuse.com/svg-img) and the last
browser release that didn't support SVG images was in 2010 (SVG data
URIs took until 2015 to be fully supported, but this is a lesser
concern).
2021-04-26 09:54:13 +02:00
Nicholas Savage 38842b2ffa Refactor org-set-font-lock-defaults to improve code readability
* org.el (org-set-font-lock-defaults): Reduce number of local
variables to improve code readability.
2021-04-26 09:39:17 +02:00
Bastien Guerry 55ef8e8584 lisp/ob-sqlite.el: Add Nick Savage a the maintainer
* lisp/ob-sqlite.el: Add Nick Savage a the maintainer.

See https://orgmode.org/list/92248525-6f48-af1a-71f6-c0b29ade45fb@nicksavage.ca/
2021-04-25 14:15:39 +02:00
tbanel c43041cf1a ob-C.el: Fix regression which mixes int, double, char* types
* lisp/ob-C.el (org-babel-C-val-to-C-type): Distinguish C, C++, D
  declarations of two-dimensions data.  C and C++ are row major,
  whereas D is column major.

  (org-babel-C-var-to-C): Generate a `typedef' (in C, C++) or an
  `alias' (in D) to carry the type of every two-dimensions matrices.

  (org-babel-C-header-to-C): Move to preferred D declaration,
  `string[n] header;' instead of `string header[n];'.  Use previously
  generated `typedef' or `alias' as the return type of the `data_h()'
  generated access utility functions.

Reported-by: Richard Sent <richard.j.sent@tutamail.com>
2021-04-22 09:51:27 +02:00
Kyle Meyer e641d37360 Merge branch 'maint' 2021-04-19 22:55:58 -04:00
Kyle Meyer ca7219db7c Merge branch 'km/from-emacs-master' 2021-04-19 22:55:03 -04:00
Kyle Meyer 9b4dbe5f03 mouse: Honor org-checkbox face
* lisp/org-mouse.el: Use org-checkbox rather than bold for checkbox
face for consistent checkbox appearance.

Reported-by: Yaroslav Rogov <rogovyaroslav@gmail.com>
Link: https://orgmode.org/list/A7D22E5B-B1A3-4ADC-9808-121F0D0ECD60@gmail.com
2021-04-19 22:52:15 -04:00
Stefan Kangas e3f0ac7348 Backport commit 0a4dc7083 from Emacs
; Normalize and add missing first and last lines
0a4dc70830f5e8286b47120cabc750cca07a75c1
Stefan Kangas
Mon Apr 19 12:21:01 2021 +0200
2021-04-19 20:07:28 -04:00
Gustav Wikström 3d52843269 Org-id: Clarify customization documentation for org-id, ts option
* lisp/org-id.el (org-id-ts-format, org-id-method): Clarify docstrings.
* doc/org-manual.org (Handling Links): Mention org-id-method in
the manual.
2021-04-19 22:55:48 +02:00
Nicolas Goaziou 9402aaebe7 Merge branch 'maint' 2021-04-19 18:19:29 +02:00
Nicolas Goaziou bc3ed23d16 element: Interpret :post-blank property in strings
* lisp/org-element.el (org-element-interpret-data):
Interpret :post-blank property in strings.
* testing/lisp/test-org-element.el (test-org-element/interpret-data):
Add test.
2021-04-19 18:17:55 +02:00
Nicolas Goaziou f918ba1094 Merge branch 'maint' 2021-04-19 14:34:43 +02:00
Nicolas Goaziou a89d96e6a5 texinfo: Consider any variation on "Top" a reserved node name
* lisp/ox-texinfo.el (org-texinfo--get-node): Change node name if it
conflicts with variations like "top", since they also appear to be
reserved by Texinfo.
2021-04-19 14:32:53 +02:00
Nicolas Goaziou a9a95cbe93 lint: Silence byte-compiler
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template):
Silence byte-compiler.
2021-04-19 02:12:11 +02:00
Nicolas Goaziou 628bb4f324 lint: Improve checks for internal macros
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template): Add
arity checks for internal macros.
* testing/lisp/test-org-lint.el (test-org-lint/invalid-macro-argument-and-template):
Add tests.
2021-04-19 02:06:01 +02:00
Nicolas Goaziou 772f7acb65 macro: Fix modification-time macro
* lisp/org-macro.el (org-macro-initialize-templates): Make second
argument optional for modification-time macro.
2021-04-19 01:11:37 +02:00
Nicolas Goaziou 8c981b0cbf lint: Pacify byte-compiler
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template):
Pacify byte-compiler.
2021-04-18 14:04:55 +02:00
Nicolas Goaziou 9ba4c95242 Add DOI links export
* lisp/ol-doi.el: New file.
* lisp/ol.el (org-link-doi-server-url): Move to new file.
(org-link--open-doi): Remove function.
* lisp/org.el (org-modules): Autoload new library for backward
compatibility.

Reported-by: yarnton--- via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
<http://lists.gnu.org/r/emacs-orgmode/2020-09/msg00908.html>
2021-04-18 14:02:06 +02:00
Kyle Meyer 664b653448 Merge branch 'km/from-emacs-master' 2021-04-18 02:12:44 -04:00
Stefan Monnier 8c29cbdef7 Backport commit c45bfd3c4 from Emacs
* lisp/ox-beamer.el (org-beamer-mode-map): Move initialization
into declaration.
(org-beamer-mode):
* lisp/org.el (org-cdlatex-mode):
* lisp/org-table.el (org-table-header-line-mode)
(org-table-follow-field-mode, orgtbl-mode):
* lisp/org-src.el (org-src-mode):
* lisp/org-list.el (org-list-checkbox-radio-mode):
* lisp/org-indent.el (org-indent-mode):
* lisp/org-capture.el (org-capture-mode):
Avoid old-style positional args to `define-minor-mode`.

* lisp/**/*.el: Avoid positional args to `define-minor-mode`
c45bfd3c4abbfa585c9199f4866b6b8046945117
Stefan Monnier
Sun Apr 11 23:47:14 2021 -0400
2021-04-18 02:11:35 -04:00
Kyle Meyer a02a3bd6ac Merge branch 'maint' 2021-04-17 15:19:41 -04:00
Stefan Kangas 3a7e1c047e Remove diary-list-entries Emacs 21 compat code
* lisp/org-agenda.el (org-get-entries-from-diary): Remove some
Emacs 21 compat code; 'list-diary-entries' was made obsolete in
favour of 'diary-list-entries' in 22.1 and removed in 24.1.
2021-04-17 15:18:04 -04:00
Kyle Meyer f12ca1a562 table: Restore temporary-goal-column after displaying header
* lisp/org-table.el (org-table-header-set-header): Restore
temporary-goal-column to prevent disrupting the expected next-line and
previous-line movement.

org-table-header-set-header, which org-table-header-line-mode adds to
post-command-hook, changes the value of temporary-goal-column to zero,
interfering with the logic in line-move-1.

Reported-by: Oorja Sandhu <oorja.sandhu@inoutbox.com>
Ref: https://orgmode.org/list/1b8b1a96-149e-4409-9738-fc45fad3a604@www.fastmail.com
2021-04-17 15:06:11 -04:00
Stefan Monnier 8e68eac0bd macro: Do not generate macros with (&optional &rest _) signature
* lisp/org-macro.el (org-macro--makeargs): Fix Emacs-26 burping
because of a bug when functions are declared with 0 optional arguments
like (&optional &rest x).
2021-04-17 11:45:40 +02:00
Nicolas Goaziou 54917a0d73 lint: Update macro checks
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template):
Ignore `eval' macros when checking spurious placeholders.
2021-04-16 16:37:29 +02:00
Stefan Monnier 8abdbbee39 macro: Improve speed for `eval' macros
* lisp/org-macro.el (org-macro--makeargs): New function.
(org-macro--set-templates): New function.
(org-macro--set-template): Remove function.
(org-macro-initialize-templates): Add optional argument to
signature. Add macro definitions as functions.
(org-macro-expand): Allow functions as macro definitions.
(org-macro--counter-increment): Handle nil argument.
* lisp/ox.el (org-export-as): Apply signature change for
`org-initialize-templates'.

The main difference with the previous behaviour is that missing
arguments are now treated as nil instead of the empty string.

See <http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00219.html>.
2021-04-16 16:37:22 +02:00
Nicolas Goaziou 4941444f45 Merge branch 'maint' 2021-04-13 09:56:16 +02:00
Nicolas Goaziou bcc1b0f1bb ob-exp: Do not comma-escape inline source code
* lisp/ob-exp.el (org-babel-exp-code): Do not comma-escape inline
source code.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): Add test.
2021-04-13 09:55:29 +02:00
Nicolas Goaziou 5d5d102254 Revert "element: Un-escape code in inline source blocks"
This reverts commit 4056e11ddc.

We shouldn't code escape inline source blocks, as escaping can be
inlined any time, at which point escape character is no longer treated
specially. E.g.,

    src_c{a
    ,* 2}

may become

    src_c{a ,* a}

where the comma is no longer an escape character.
2021-04-13 09:47:09 +02:00
Nicolas Goaziou b33face41c Merge branch 'maint' 2021-04-13 00:37:16 +02:00
Nicolas Goaziou 6dbd132e62 ox-texinfo: Fix footnotes ending on a special environment
* lisp/ox-texinfo.el (org-texinfo-footnote-reference): Prevent
a footnote from ending on an "@end" line.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00228.html>
2021-04-13 00:36:31 +02:00
Nicolas Goaziou b049f839b0 Merge branch 'maint' 2021-04-12 23:33:12 +02:00
Nicolas Goaziou 4056e11ddc element: Un-escape code in inline source blocks
* lisp/org-element.el (org-element-inline-src-block-parser): Un-escape
code in inline source blocks.
(org-element-inline-src-block-interpreter): Escape it again if
necessary.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add test.
2021-04-12 23:29:38 +02:00
Nicolas Goaziou bf98b12d5c Merge branch 'maint' 2021-04-10 12:29:28 +02:00
Nicolas Goaziou 94be20a334 ox-texinfo: Fix references to low-level headlines
* lisp/ox-texinfo.el (org-texinfo-headline): Provide an anchor for
low-level headlines.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00206.html>
2021-04-10 12:28:08 +02:00
Nicolas Goaziou 85a25e3169 Merge branch 'maint' 2021-04-10 12:08:33 +02:00
Nicolas Goaziou 19947a6e41 ox: Handle missing option value better
* lisp/ox.el (org-export--parse-option-keyword): Do not stop parsing
OPTIONS keyword when an option without a value is encountered.
* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
tset.

This is a followup to 7116914427.
2021-04-10 12:06:47 +02:00
Nicolas Goaziou 80bce047ff Merge branch 'maint' 2021-04-10 00:03:31 +02:00
Tom Gillespie b523ad491d ob-tangle.el: Fix coderef removal during tangling
* lisp/ob-tangle.el (orb-babel-tangle-single-block): Regularize
behavior when removing coderefs during tangling. This fixes an issue
where trailing whitespace would be retained when coderefs were removed
for tangling.
2021-04-10 00:01:49 +02:00
Nicolas Goaziou b07a31cbd7 Merge branch 'maint' 2021-04-09 23:43:36 +02:00
Nicolas Goaziou 5469bc4e55 colview: Ignore operators associated to special properties
* lisp/org-colview.el (org-columns--compute-spec): Ignore operator
associated to a special properties.

This is a followup to e1b8d1d2b4.
2021-04-09 23:41:32 +02:00
Nicolas Goaziou f63bb5eea8 Merge branch 'maint' 2021-04-09 22:49:54 +02:00
Nicolas Goaziou 7116914427 ox: Do not choke on incomplete OPTIONS items
* lisp/ox.el (org-export--parse-option-keyword): Prevent "End of
file during parsing" error when an OPTIONS item is incomplete.
* lisp/org-lint.el (org-lint-unknown-options-item): Check for
incomplete options items.
* testing/lisp/test-org-lint.el (test-org-lint/unknown-options-item):
Add test.
2021-04-09 22:47:57 +02:00
Nicolas Goaziou 0457d8d5a3 Merge branch 'maint' 2021-04-09 22:33:00 +02:00
Nicolas Goaziou f99f26306c ox-texinfo: Do not create menu for headlines without sectioning command
* lisp/ox-texinfo.el (org-texinfo--sectioning-structure): New function.
(org-texinfo-headline): Use new function.
(org-texinfo--menu-entries): Filter out headlines with no sectioning
command defined.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00196.html>
2021-04-09 22:29:50 +02:00
Nicolas Goaziou 2d78ea57cf Merge branch 'maint' 2021-04-07 19:50:02 +02:00
Nicolas Goaziou e1b8d1d2b4 org-colview: Do not choke when updating a special property
* lisp/org-colview.el (org-columns--compute-spec): Do not update
special properties, which are not set through property drawers.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00135.html>
2021-04-07 19:48:37 +02:00
Nicolas Goaziou 196aae41c5 Merge branch 'maint' 2021-04-06 13:50:46 +02:00
Nicolas Goaziou 7575678959 ox-latex: Fix texttt usage in headlines
* lisp/ox-latex.el (org-latex-headline): Properly call
`org-latex--protect-texttt' on verbatim objects.

Reported-by: Greg Minshall <minshall@umich.edu>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00134.html>
2021-04-06 13:47:04 +02:00
Kyle Meyer 5a91a232f7 Merge branch 'maint' 2021-04-05 23:49:21 -04:00
Kyle Meyer 702e782cb6 org.el: Mark org-link-descriptive as buffer-local
* lisp/org.el (org-mode): Mark org-link-descriptive as buffer-local.

Calling org-toggle-link-display is an inherently buffer-local
operation because it works via the buffer-local
buffer-invisibility-spec, so toggling the global value leads to a
mismatched, invalid state in all other buffers.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Ref: https://orgmode.org/list/87lfeqzm3a.fsf@gmail.com
Reported-by: Ingo Lohmar <ingo.lohmar@posteo.net>
Ref: https://orgmode.org/list/87pmzdhl4b.fsf@kenko.localhost.com
2021-04-05 22:15:10 -04:00
Nicolas Goaziou c881b60593 Merge branch 'maint' 2021-04-04 00:18:04 +02:00
TEC bcfe6f985c ox-latex: convert verbatim text in headings to texttt
* lisp/ox-latex.el (org-latex--protect-texttt): New function.
(org-latex--text-markup): Use new function.
(org-latex-headline): Convert any instances of \verb text with
\texttt.  This is required to work around LaTeX peculiarities that
would otherwise cause compilation to fail (see the code comment for
more information).
2021-04-04 00:16:42 +02:00
Nicolas Goaziou 635920c730 Merge branch 'maint' 2021-04-01 17:15:36 +02:00
Nicolas Goaziou f7e0e17e82 ox-texinfo: Fix colons removal in menu entries
* lisp/ox-texinfo.el (org-texinfo--format-entries): Fix regexp
matching unwanted colons.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00008.html>
2021-04-01 17:10:52 +02:00
Stefan Kangas 3089fcd690 Remove redundant #' around lambdas
* contrib/lisp/org-choose.el (org-choose-get-highest-mark-index)
(org-choose-get-fn-map-group, org-choose-keep-sensible)
(org-choose-setup-vars):
* lisp/org-mouse.el (org-mode-hook, org-mouse-context-menu)
(org-mouse-popup-global-menu):
* lisp/ox-beamer.el (org-beamer--format-section):
* lisp/ox.el (org-export-insert-default-template): Remove redundant #'
around lambdas.
2021-03-30 23:54:22 -04:00
Renato Ferreira 6a50e41ea5 org-agenda.el: Rename org-agenda-format-item parameters
* org-agenda.el (org-agenda-format-item): Rename parameters so they
don't clash with dynamic variables used by
`org-prefix-format-compiled'.

TINYCHANGE
2021-03-29 23:09:38 -04:00
Kyle Meyer 4d9dabc36f Merge branch 'maint' 2021-03-29 00:34:15 -04:00
Kyle Meyer 7c23fc7efa ob-ocaml: Update stale tuareg-mode link in commentary
Reported-by: Stefan Monnier <monnier@iro.umontreal.ca>
2021-03-29 00:33:49 -04:00
Maxim Nikulin 4de2fff87d Add quotes to emacsclient arguments in examples
* doc/org-manual.org:
* lisp/org-protocol.el: Quote emacsclient arguments
in examples to prevent interpreting of ampersands as intent
to run processes in background by bash and similar shells.
Single quotes may cause a problem with cmd.exe, so use
double quotes despite they are a bit less safe in bash and Co.
2021-03-29 00:32:29 -04:00
Bastien 05277f5caf lisp/org.el: Fix previous merge commit 2021-03-28 17:54:50 +02:00
Bastien a169bdde3b Merge branch 'maint' 2021-03-28 17:54:17 +02:00
Bastien 287af207fe lisp/org.el: Bump version header to 9.4.5 2021-03-28 08:36:11 +02:00
Kyle Meyer 7a62a4d325 Merge branch 'maint' 2021-03-27 02:21:07 -04:00
Kyle Meyer e2e89cea87 Merge branch 'km/from-emacs-master' 2021-03-27 02:20:45 -04:00
Basil L. Contovounesios f10773675d Backport commit 331ddd803 from Emacs
* lisp/org-macs.el (org--string-from-props): Pacify warnings
about unknown functions in non-GUI bilds.

Address some --without-x byte-compilation warnings
331ddd803a72056d0f0c70e5a677e0d4a6300584
Basil L. Contovounesios
Fri Mar 26 17:35:34 2021 +0000
2021-03-27 02:18:35 -04:00
Sébastien Miquel 36622362d1 org.el (org-do-latex-and-related): Fix duplicate 'latex faces
* lisp/org.el (org-do-latex-and-related): Do not add a
'org-latex-and-related face beyond the fontification limit.
2021-03-27 02:05:30 -04:00
Stefan Kangas b7c26e9036 Backport commit 8b07994e2 from Emacs
Convert many more links to use HTTPS
8b07994e201e478df8a3431cbae5187b4cde1791
Stefan Kangas
Wed Mar 24 10:20:18 2021 +0100
2021-03-25 00:56:53 -04:00
Kyle Meyer 68db6fc064 Merge branch 'maint' 2021-03-25 00:53:11 -04:00
Kyle Meyer 478929ae61 ox-html: Fix org-html-format-drawer-function's docstring
* lisp/ox-html.el (org-html-format-drawer-function): Drop leftover
text from when an example used to be included.

adcebf38f (Fix errors reported by cus-test.el, 2013-11-14) dropped the
example but left the leading part.

Reported-by: Jean-Baptiste Mazon <jmazon@gmail.com>
Ref: https://orgmode.org/list/0e5569e6-15a7-d4c4-0558-8b0ef96a515c@gmail.com
2021-03-24 22:45:22 -04:00
Stefan Kangas 2e1c984153 Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00