Commit graph

16962 commits

Author SHA1 Message Date
Nicolas Goaziou 490eba3a42 Remove spurious `provide'
Provide only features matching file names.
2021-08-11 11:31:54 +02:00
Nicolas Goaziou 733623761d oc-basic: Pacify byte-compilator
* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Use
`org-buffer-hash' instead of `buffer-hash' since Org supports Emacs 25.1.
2021-08-11 11:29:34 +02:00
Nicolas Goaziou 100641bc5a oc-biblatex: Refactor code to simplify byte-compilation
* lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Refactor
code.

Reported-by: Maxim Nikulin <manikulin@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-08/msg00100.html>
2021-08-11 11:27:51 +02:00
Max Nikulin 26d1711167 oc: Add missing `require'
* lisp/oc.el:
* lisp/oc-basic.el: Add some `require' to avoid compile warnings.
2021-08-11 11:15:17 +02:00
Max Nikulin 31c07bd3bd oc: rx compatibility with Emacs < 27.1
* lisp/oc.el (org-cite-adjust-note):
* lisp/oc-basic.el (org-cite-basic-goto):
* lisp/oc-biblatex.el (org-cite-biblatex-prepare-preamble):
* lisp/oc-csl.el (org-cite-csl--label-regexp): Avoid `rx' forms
introduced in Emacs-27.1 to keep compatibility with older versions.

Use `rx-to-string' instead of `rx' due to lack of support of  `regexp'
and `literal' forms with a variable as an argument.
2021-08-11 11:14:22 +02:00
Marco Wahl 01877f4804 org-compat: Fix org-directory-empty-p
* lisp/org-compat.el: Remove COUNT parameter in call of
directory-files.  COUNT not available in Emacs < 28.
2021-08-10 22:38:00 +02:00
Marco Wahl 81eb8c5f9e attach: Fix for Emacs<28
* lisp/org-compat.el: Introduce org-directory-empty-p which is directory-empty-p from Emacs 28.
* lisp/org-attach.el (org-attach-sync): Use org-directory-empty-p instead of directory-empty-p.
* etc/ORG-NEWS: Note about org-directory-empty-p.

Thanks Kyle identifying the issue.  Thanks Arthur for suggesting a
fix.
2021-08-10 22:20:48 +02:00
Kyle Meyer 926dbafe43 Merge branch 'km/from-emacs-master' 2021-08-08 18:07:20 -04:00
Lars Ingebrigtsen 0f7fcc9de0 Backport commit 6a3920c07 from Emacs
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Using `error' here will trigger users with `debug-on-error' so use
`user-error' instead (bug#49920).  It would probably be preferable
to rewrite this to not use the error system to do control flow.

Make `q' in `org-agenda' work even with `debug-on-error' set
6a3920c07eaae58408dd27e7db22bff7ad4d1f80
Lars Ingebrigtsen
Sat Aug 7 12:55:39 2021 +0200
2021-08-08 18:06:30 -04:00
Nicolas Goaziou a6d93cfb62 oc-natbib: Refactor code to ease byte-compilation
* lisp/oc-natbib.el (org-cite-natbib--style-to-command): Refactor code
so byte-compilation is faster, and, in some cases, do not end with
Bytecode overflow error.

Reported-by: Maxim Nikulin <manikulin@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-08/msg00100.html>
2021-08-08 16:10:14 +02:00
Nicolas Goaziou 4198cbd074 Strictly match language when loading Elisp code
* lisp/org.el (org-babel-load-file): Strictly check language before
loading source code.

Reported-by: dmg <dmg@turingmachine.org>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00631.html>
2021-08-07 22:22:05 +02:00
Nicolas Goaziou a43d7a575d ox: Fix docstring
* lisp/ox.el (org-export-define-backend): Fix docstring.

Reported-by: Zachary Kanfer <zkanfer@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-08/msg00009.html>
2021-08-07 22:14:41 +02:00
Juan Manuel Macias 8c78db4910 ox: Fix spanish translation for `footnotes'
* lisp/ox.el (org-export-dictionary): tiny fix in spanish
translation (plural instead of singular).
2021-08-07 22:10:28 +02:00
Nicolas Goaziou 8df3e25db8 Revert "oc: Remove spurious `provide'"
This reverts commit ad006e2930.
2021-08-01 10:29:23 +02:00
Nicolas Goaziou ad006e2930 oc: Remove spurious `provide'
* lisp/oc-basic.el:
* lisp/oc-biblatex.el (biblatex):
* lisp/oc-csl.el:
* lisp/oc-natbib.el:
* lisp/oc.el: Provide only the full library name.
2021-08-01 10:07:39 +02:00
Nicolas Goaziou 3ba46cbe4a Merge branch 'maint' 2021-07-31 10:57:00 +02:00
Nicolas Goaziou dcc3a84a98 keys: Re-instate some RET bindings
* lisp/org-keys.el (org-mode-map): Re-instate S-RET and M-S-RET, which
are not translated from S-<return> and M-S-<return>, unlike
M-<return>/M-RET.

This is a followup to ee652a47df.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
2021-07-31 10:55:01 +02:00
Nicolas Goaziou 18570684ad oc-basic: Improve <mouse-1> handling on citation keys
* lisp/oc-basic.el (org-cite-basic--set-keymap): New function.
(org-cite-basic--make-repair-keymap): Remove function.
(org-cite-basic-activate): Use new function.
2021-07-30 09:47:20 +02:00
Nicolas Goaziou c0dde2c800 oc-basic: Fix `org-cite-basic-goto'
* lisp/oc-basic.el (org-cite-basic-goto): Set BibTeX dialect before
calling `bibtex-search-entry'.
2021-07-30 08:52:34 +02:00
Nicolas Goaziou c839849aba footnote: Allow inserting footnotes at the end of table cells
* lisp/org-footnote.el (org-footnote--allow-reference-p): Allow
inserting footnotes at the end of table cells.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add test.
2021-07-29 21:15:11 +02:00
Nicolas Goaziou 7ea9099725 oc: Allow inserting citations in table cells (part 2)
* lisp/oc.el (org-cite--allowed-p): Allow inserting a citation after
two or more spaces at the end of a table cell.
* testing/lisp/test-oc.el (test-org-cite/insert-capability): Add
tests.
2021-07-29 21:13:01 +02:00
Nicolas Goaziou 78c450247b oc: Allow inserting citations in captions
* lisp/oc.el (org-cite--allowed-p): Allow inserting citations in captions.
* testing/lisp/test-oc.el (test-org-cite/insert-capability): Add test.
2021-07-28 11:11:46 +02:00
Nicolas Goaziou af0fcb6833 element: Allow citations in table cells
* lisp/org-element.el (org-element-object-restrictions): Allow
citations in table cells.
* testing/lisp/test-org-element.el (test-org-element/citation-parser):
Add test.  Remove outdated test.
2021-07-28 10:32:29 +02:00
Juan Manuel Macias 40a20136d3 Prevent partial fontification when a link is displayed full
* lisp/org.el (org-activate-links): apply `face-property' variable in
other cases when handle invisible parts in bracket
links: `(add-face-text-property start end face-property)' suggestion
from Ihor Radchenko
2021-07-27 22:01:36 +02:00
Nicolas Goaziou 229b018b60 ox-latex: Do not duplicate \texttt on inline source blocks
* lisp/ox-latex.el (org-latex-inline-src-block): When
`org-latex-listings' is nil, simply translate source block as code,
without adding an additional \texttt command.

Reported-by: Maxim Nikulin <manikulin@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00489.html>
2021-07-27 21:59:43 +02:00
Tom Gillespie c9dfed48a6
ob-core: tangle check LOB after current buffer
* lisp/ob-core.el (org-babel-expand-noweb-references): Fix order when
searching for named babel blocks so that blocks in the current buffer
are always found first. This fixes a bug where stale versions of
blocks that have been ingested into the library of babel were being
preferentially tangled instead of newly modified versions from the
current buffer.
2021-07-25 03:42:42 +08:00
TEC 604bfd9d75
oc-csl: be more caution about the csl etc location
* lisp/oc-csl.el (org-cite-ctl--etc-dir): The previous value of
`org-cite-ctl--etc-dir' is incorrect when using either package.el or
straight to manage Org. We can be a bit more considerate by just
checking if the initial location exists, and then trying the expected
location when using package.el/straight if it doesn't exist.
2021-07-15 03:36:24 +08:00
Kyle Meyer fc273bfce1 Merge branch 'maint' 2021-07-11 22:42:38 -04:00
Amin Bandali 1ee52c5eb6 Backport commit 348b2aed0 from Emacs
Update IRC-related references to point to Libera.Chat
348b2aed0c8c3630be4c15c8e70acf7ea9c023af
Amin Bandali
Sat Jul 3 23:39:18 2021 -0400
2021-07-11 22:40:57 -04:00
Marco Wahl 61e0837325 org-attach: Possibly delete empty attach directory
* lisp/org-attach.(org-attach-sync): Enable possible deletion of empty
attachment directories.  `org-attach-sync-delete-empty-dir' controls
the action: Never delete, Always delete or Query the user (default).
2021-07-09 21:03:44 +02:00
TEC 32739e35e3
ox-latex: Change default compiler to latexmk
* lisp/ox-latex.el (org-latex-pdf-process): Check for the presence of
latexmk when setting the default, and use it when available.  Fall back
to the current default.  This is important for the incoming citation
support, as PDF generation will now need to involve bibliography
generation.  By using latexmk this is taken care of for us.  The -%latex
part of the command is slightly hacky, but allows latexmk to behave more
intelligently for non-pdflatex options.  Note that latexmk also seems to
care about the order of the arguments.
2021-07-10 00:31:40 +08:00
Nicolas Goaziou 971c1359a5 oc-csl: Implement `csl' citation processor
* etc/csl/chicago-author-date.csl:
* etc/csl/locales-en-US.xml:
* lisp/oc-csl.el (csl): New files.
* etc/Makefile (ETCDIRS): Register new files.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou ae5f5151fe oc-biblatex: Implement `biblatex' citation processor
* lisp/oc-biblatex.el: New file.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou d6cb37f4be oc-natbib: Implement `natbib' citation processor
* lisp/oc-natbib.el: New file.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou c089c234bb Allow `org-edit-special' to open "bibliography" files
* lisp/org.el (org-edit-special): Also edit "bibliography" keywords.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou ef79a8d8e6 org-keys: Plug citation insertion
* lisp/org-keys.el: Add a key-binding for `org-cite-insert'.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou 524d8fe4c1 Plug citations into fontification process 2021-07-09 08:47:14 +02:00
Nicolas Goaziou a20a3ad5f1 Plug citations into `org-open-at-point'
* lisp/org.el (org-open-at-point): Follow citations and citation
references.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou 2c2b720394 ox: Plug citations into export process
* lisp/ox.el (org-export-as): Add citation pre-processing.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou 44156353c9 oc-basic: Implement `basic' citation processor
* lisp/oc-basic.el: New file.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou e844a6fd41 oc: Add Org Cite library
* lisp/oc.el: New file.
* testing/lisp/test-oc.el: New file.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou a922b1764d faces: Add org-cite' and org-cite-key' faces
* lisp/org-faces.el (org-cite):
(org-cite-key): New faces.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou 4c646a6bde ox: Introduce "raw" pseudo objects
* lisp/ox.el (org-export-raw-string): New function
(org-export-data):
(org-export-with-backend): React to raw objects.
* testing/lisp/test-ox.el (test-org-export/raw-string): New test.

A raw object is a pseudo-object (i.e., special object type that exists
only during export) with the property of being exported as-is, with no
processing from an export back-end.

It is particularly useful to add contents to, or pre-process objects
from, a parse tree.
2021-07-09 08:47:14 +02:00
Nicolas Goaziou fed07be5b8 element: Add citation support
* lisp/org-element.el (org-element-citation-key-re):
(org-element-citation-prefix-re): New variables.
(org-element--set-regexps): Set `org-element--object-regexp' so it
finds citations.
(org-element-all-objects): Add citation and citation-reference
objects.
(org-element-recursive-objects): Add citation object.
(org-element-object-restrictions): Add citation and citation-reference
to restrictions.
(org-element-secondary-value-alist): citation and citation references
can hold secondary strings.
(org-element-citation-parser):
(org-element-citation-interpreter):
(org-element-citation-reference-parser):
(org-element-citation-reference-interpreter): New functions.
(org-element--object-lex): Parse citations and citations references.
* testing/lisp/test-org-element.el (test-org-element/citation-parser):
(test-org-element/citation-reference-parser):
(test-org-element/citation-interpreter): New tests.

This patch adds support for [cite:@key], [cite:pre @key post]
[cite:global prefix; pre @key1 post; pre @key2 post; global suffix]
objects along with their [cite/style: ...] counterparts.
2021-07-09 08:47:14 +02:00
Allen Li 622f9fa76c org: Use crm for completing tags
* lisp/org-capture.el (org-capture-fill-template): Changed to use
completing-read-multiple.
* lisp/org.el (org-set-tags-command): Changed to use
completing-read-multiple.
(org-change-tag-in-region): Changed to use a simple completion table.
* testing/lisp/test-org.el (test-org/set-tags-command): Fixed tests.

Change various places which use `completing-read' to read tags using a
custom completion function to instead use `completing-read-multiple'
with a completion table instead.

This makes tab completion play better with alternative completion
frameworks such as vertico, selectrum, etc.

`org-change-tag-in-region' only reads a single tag, so it is changed
to use a completion table with `completing-read'.  This also makes it
play better with alternative completion frameworks.

Note that there is still one use for `org-tags-completion-function',
which is for completing tag matches.  Completing tag matches is
different from completing lists of tags since the separators (+, -,
etc) have semantic meaning.  This commit does not address that use
case.
2021-07-09 08:44:32 +02:00
Nicolas Goaziou fdb98a436b Merge branch 'maint' 2021-07-02 16:03:19 +02:00
Nicolas Goaziou ee652a47df org-keys: Remove fancy RET keybindings
There is no such binding as "S-RET", and "ESC ..." is translated to
"M-..." in both GUI and TUI. Finally, "M-<return>" is translated to
"M-RET" so we shouldn't use the former.
2021-07-02 16:01:05 +02:00
Nico Sonack f76d4d103f ob-fortran: Use a defcustom for fortran compiler
* lisp/ob-fortran.el (org-babel-fortran-compiler): Change `defvar' to
`defcustom' so that the fortran compiler is customizable like almost
all other org-babel compilers.

TINYCHANGE

Sometimes the compiler isn't `gfortran` (but e.g. `gfortran10`
etc.). Accomodate for that like we do with all other org-babel
language integrations.
2021-07-01 23:21:15 +02:00
Eric S Fraga d1900adfbe ol-bibtex: Added url and doi as optional entries for BiBTeX export
* lisp/ol-bibtex.el: :doi and :url entries added to optional list of
entries to export to BiBTeX when present in the properties.

* etc/ORG-NEWS: added news item noting this change.
2021-07-01 23:15:22 +02:00
Jacopo De Simoi 221c8e298f ob-tangle: Parse correctly tangle options
* lisp/ob-tangle.el (org-babel-effective-tangled-filename): Check for
  the "no" parameter in this function to avoid erroneous tangling of a
  single block (e.g. with C-u C-c C-v t) even with the parameter
  :tangle no

TINYCHANGE
2021-07-01 15:42:29 +02:00
Nicolas Goaziou b913f34ec3 Merge branch 'maint' 2021-07-01 12:13:13 +02:00
Nicolas Goaziou 565361eb69 org-keys: Do not bind <tab>, ever
Fixes: `org-mode-map` binds `<tab>` which is unnecessary and harmful,
since it takes precendence over bindings of TAB even in keymaps with
higher precedence.

Reported-by: Daniel Mendler <mail@daniel-mendler.de>
2021-07-01 12:11:28 +02:00
Nicolas Goaziou c3c89d569a Merge branch 'maint' 2021-06-30 22:03:29 +02:00
Ingo Lohmar 80374642e2 agenda: Fix timestamp agenda setting global agenda name
* lisp/org.el (org-follow-timestamp-link): Do not set global agenda name.

The tmp value for the agenda buffer name is used in `org-agenda-list'
to set `org-agenda-buffer-name'.  Wrap the call in a let-binding for
this symbol (like the agenda dispatcher does), since otherwise it
inadvertently sets the global value.
2021-06-30 22:02:57 +02:00
Marco Wahl 7666d6bb99 org-keys: improve the call for speed key "g"
* lisp/org-keys.el (org-speed-commands): Use the right argument to
  call the "goto variant" of org-refile with non-confusing user promt
  for speed key "g".
2021-06-29 13:38:14 +02:00
TEC 81c4befe62
ox-html: Resolve W3C warning, improve a11y
* lisp/ox-html.el (org-html-style-default, org-html-head): Remove
unwarranted type="text/css" from <style> (W3C warning).
(org-html-html5-fancy): Remove note about IE8- from docstring.
(org-html-footnote-section, org-html-template, org-html-toc,
org-html-footnote-reference): Add some ARIA roles to improve
accessibility.
2021-06-28 17:44:26 +08:00
Kyle Meyer 35183b634b Merge branch 'km/from-emacs-master' 2021-06-27 23:33:00 -04:00
Stephen Berman bb572a3e8c Backport commit 19f2f2699 from Emacs
* lisp/org-compat.el (org--setup-calendar-bindings): Fix logic
in test of 'org-agenda-diary-file' (bug#48199).

Prevent Org mode from mistakenly changing Calendar keymap
19f2f2699499d87186c6f580e4ec79205d59c096
Stephen Berman
Fri Jun 25 11:11:43 2021 +0200
2021-06-27 23:32:23 -04:00
Nicolas Goaziou 8e3e2f667f clock: Prevent "before first headline" error on clock-out note
* lisp/org-clock.el (org-clock-out): Possibly create a note at the
very end of the process, when there's no need for point to be on the
correct headline. Also call `org-clock-remove-empty-clock-drawer'
unconditionally instead of putting it in `org-clock-out-hook'.

Reported-by: Dave Dai <wenlong.dai@gmail.com>
<https://yhetil.org/orgmode/87pmwaang6.fsf@HUE.i-did-not-set--mail-host-address--so-tickle-me/»
2021-06-27 16:21:08 +02:00
Sébastien Miquel e2550506eb src: Use `replace-buffer-contents' only for emacs >= 27
* lisp/org-src.el (org-edit-src-save):
(org-edit-src-exit): Use `replace-buffer-contents' only for emacs >=
27.

It was introduced in emacs 26.1, but earlier versions made no
guarantees of correctness.
2021-06-27 15:53:22 +02:00
Gustav Wikström aa0fa8c753 lisp/ox-publish.el: Speedup when looking for file changes
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing):
Speedup using delayed hooks and temp buffers instead of finding files.
2021-06-27 09:42:22 +02:00
Bastien 81011df71d lisp/ox-koma-letter.el: Move from the old contrib/ directory 2021-06-24 11:12:58 +02:00
Nicolas Goaziou 5e4815f816 Merge branch 'maint' 2021-06-20 18:08:35 +02:00
Nicolas Goaziou c09356548f agenda: Fix `org-get-time-of-day' on empty string
* lisp/org-agenda.el (org-get-time-of-day): Ensure S is not empty
before calling `get-text-property'.

This regression was introduced in aba1f2066.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>
2021-06-20 18:07:01 +02:00
Nicolas Goaziou ceb78e0159 Merge branch 'maint' 2021-06-18 14:13:47 +02:00
Nicolas Goaziou 15badb32b7 agenda: Fix org-duration-to-minutes error (take 4)
* lisp/org-agenda.el (org-get-time-of-day): Fix regexp.

This is a followup to aba1f20661.
2021-06-18 14:12:08 +02:00
Nicolas Goaziou 5a03ad86cd Merge branch 'maint' 2021-06-17 19:27:26 +02:00
Nicolas Goaziou aba1f20661 agenda: Fix org-duration-to-minutes error (take 3)
* lisp/org-agenda.el (org-agenda-format-item): Call
`org-get-time-of-day' twice. Once to get proper time information, and
a second time to format it.
(org-get-time-of-day): Remove an optional argument.  Extend the one
left, and document it.  Rewrite function.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<https://orgmode.org/list/87lf84408r.fsf@ucl.ac.uk/>
2021-06-17 19:23:36 +02:00
Nicolas Goaziou 9aa304f957 ox-latex: Fix defcustom keywords.
* lisp/ox-latex.el (org-latex-reference-command): Do not provide
both :version and :package-version.  Add :safe keyword.
2021-06-13 22:28:10 +02:00
TEC f092cb30d9
ox-latex: Allow reference command to be customised
* lisp/ox-latex.el (org-latex-reference-command): Create a new variable
so the user may modify the reference command used.
(org-latex-link): Make use of the new `org-latex-reference-command' when
generating references for labels without a description (previously using
\ref).
(org-latex-prefer-user-labels): Mention the new
`org-latex-reference-command' when describing the generated LaTeX
referencing labels.
2021-06-10 01:37:00 +08:00
Nicolas Goaziou f70e36252a Merge branch 'maint' 2021-06-02 17:22:41 +02:00
Nicolas Goaziou 093c94e31b texinfo: Fix off-by-one error
* lisp/ox-texinfo.el (org-texinfo--menu-entries): Fix off-by-one
error.

This is a follow-up to f99f26306c.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg01290.html>
2021-06-02 17:21:15 +02:00
Bastien a0a87d55cb Fix 108e5c7bd 2021-05-30 18:56:05 +02:00
Bastien 108e5c7bd3 lisp/ob-eshell.el: Add a Homepage header 2021-05-30 15:12:45 +02:00
Markus Huber 54863e802f ox-latex: Surround option string with braces if it includes brackets
lisp/ox-latex.el (org-latex--make-option-string): If `value' of
a `pair' from `options' contains a bracket the whole `value' is
surrounded by braces.

In case of LaTeX export using listings the dialect of
a language (e.g. [LaTeX]TeX) is surrounded by brackets. For inline
source blocks all options end as optional argument to \lstinline
between brackets which breaks the LaTeX parser.

TINYCHANGE
2021-05-29 22:24:15 +02:00
Juan Manuel Macias f4aac6090d ox-latex: add LaTeX attributes to quote block
* doc/org-manual.org (Quote blocks in LaTeX export): manual updated
* etc/ORG-NEWS (Support quote blocks in LaTeX export): news updated
* lisp/ox-latex.el (latex): add `org-latex-default-quote-environment' to `:options-alist'
(org-latex-default-quote-environment): the default quote environment
is `quote'
(org-latex-quote-block): add two attributes: `environment' and `options'
2021-05-29 22:21:59 +02:00
Bastien c5573bdf4c Merge branch 'maint' 2021-05-25 02:13:55 +02:00
Bhavin Gandhi 37f69bf86d org-refile: Fix double slashes in the refile targets
* org-refile.el (org-refile-get-location): When we generate the `tbl'
variable, we add extra slash depending on the value of
`org-refile-use-outline-path'.  This patch updates some locations which
add another extra slash assuming the target did not have it.

`org-refile--get-location' does lookup for entries with and without
slash, so it was not causing any issues before.  It works as it is now
as well.

Thanks to Gustavo Barros for a very detailed bug report.

TINYCHANGE
2021-05-25 02:13:43 +02:00
TEC f72a658bd0
org-plot: Use consistent method to find table
* lisp/org-plot.el (org-plot/gnuplot): Table information is obtained
using (org-plot/goto-nearest-table), however it was not used when
fetching data from the table.  It is more sensible to use the same
method.  This also now allows a #+plot statement to be placed before
a #+RESULTS line and a table.
2021-05-23 04:06:49 +08:00
Nicolas Goaziou 52b09799cf Merge branch 'maint' 2021-05-21 18:30:23 +02:00
Sun Lin 21eb69c413 org-agenda-files: Work with relative file paths
* lisp/org.el (org-agenda-files): Make sure org-agenda-files work with relative
file paths.

TINYCHANGE
2021-05-21 18:30:06 +02:00
Nicolas Goaziou dce8b3f254 Merge branch 'maint' 2021-05-20 15:45:45 +02:00
Nicolas Goaziou 13c78a5900 footnote: Allow new footnotes in empty cells
* lisp/org-footnote.el (org-footnote--allow-reference-p): allow
inserting new footnotes in empty cells.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add
tests.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00940.html>
2021-05-20 15:44:27 +02:00
Kyle Meyer cf30f71178 Merge branch 'km/from-emacs-master' 2021-05-19 19:24:39 -04:00
Stefan Monnier ca300ada21 Backport commit 09ed51b9c from Emacs
* lisp/org-timer.el (org-timer--run-countdown-timer): Use closures.

lisp/org/org-timer.el (org-timer--run-countdown-timer): Use closures
09ed51b9c89390059ccae30c0ae5dc39bc20523b
Stefan Monnier
Tue May 18 19:54:38 2021 -0400

[km: This was independently applied to master with 1a5a326f1.]
2021-05-19 19:22:44 -04:00
Stefan Monnier 64689d9bb7 Backport commit 5746fd57a from Emacs
* lisp/org-mouse.el: Make use of lexical scoping.
(org-mouse-todo-menu): Simplify by eta-reduction.
(org-mouse-popup-global-menu): Remove redundant `eval`.
(org-mouse-keyword-menu, org-mouse-keyword-replace-menu)
(org-mouse-tag-menu, org-mouse-match-closure): Use proper closures.

lisp/org/org-mouse.el: Make use of lexical scoping
5746fd57ab7c9d27bcc6220f2b9faaba2982deba
Stefan Monnier
Tue May 18 19:51:26 2021 -0400
2021-05-19 19:22:32 -04:00
Stefan Monnier 08d7b359b8 Backport commit 4e240bf09 from Emacs
* lisp/org-colview.el (org-columns-map): Use proper closures
(org-columns-map): Use derived-mode-p.

lisp/org/org-colview.el (org-columns-map): Use proper closures
4e240bf09678a41055e46fb16a798541d58d372e
Stefan Monnier
Tue May 18 19:36:54 2021 -0400

[km: This was independently applied to master in 71c40314f.]
2021-05-19 19:22:23 -04:00
Stefan Monnier a8134b2c58 Backport commit af68b4956 from Emacs
* lisp/org-clock.el (org-clock-get-table-data): Use proper closures.

lisp/org/org-clock.el (org-clock-get-table-data): Use proper closures
af68b49565671821361d089ae9a68af32d760e2c
Stefan Monnier
Tue May 18 19:32:35 2021 -0400

[km: This was independently applied to master in 038aff34d.]
2021-05-19 19:22:09 -04:00
Bastien ab9f2af34f lisp/org.el: Bump version number
* lisp/org.el: Bump version number.
2021-05-19 14:16:18 +02:00
Stefan Monnier 1a5a326f10 * lisp/org-timer.el (org-timer--run-countdown-timer): Use closures 2021-05-19 14:08:50 +02:00
Stefan Monnier 71c40314f5 * lisp/org-colview.el (org-columns-map): Use proper closures
Also prefer #' to quote function names.

(org-columns-map): Use derived-mode-p.
2021-05-19 14:08:21 +02:00
Stefan Monnier 038aff34db * lisp/org-clock.el (org-clock-get-table-data): Use proper closures
Also, prefer #' to quote function names
2021-05-19 14:08:18 +02:00
Jack Kamm 53fd5b774e ob-comint.el, ob-python.el: Async session evaluation
Adds functionality to ob-comint.el to implement async session eval on
a per-language basis.  Adds a reference implementation for ob-python.

* lisp/ob-comint.el (org-babel-comint-with-output): Remove comment.
(org-babel-comint-async-indicator, org-babel-comint-async-buffers,
org-babel-comint-async-file-callback,
org-babel-comint-async-chunk-callback,
org-babel-comint-async-dangling): Add buffer-local variables used for
async comint evaluation.
(org-babel-comint-use-async): Add function to determine whether block
should be evaluated asynchronously.
(org-babel-comint-async-filter): Add filter function to attach to
comint-output-filter-functions for babel async eval.
(org-babel-comint-async-register): Add function to setup buffer
variables and hooks for session eval.
(org-babel-comint-async-delete-dangling-and-eval): Add helper function
for async session eval.

* lisp/ob-python.el (org-babel-execute:python): Check for async header
argument.
(org-babel-python-evaluate): Check whether to use async evaluation.
(org-babel-python-async-indicator): Add constant for indicating the
start/end of async evaluations.
(org-babel-python-async-evaluate-session): Add function for Python
async eval.

*
testing/lisp/test-ob-python.el (test-ob-python/async-simple-session-output):
Unit test for Python async session eval.
(test-ob-python/async-named-output): Unit test that Python async eval
can replace named output.
(test-ob-python/async-output-drawer): Unit test that Python async eval
works with drawer results.
2021-05-18 09:13:28 -07:00
Nicolas Goaziou 6de34f2891 Move org-file-url-p' to "org-macs.el", rename it to org-url-p'
* lisp/org-macs.el (org-url-p): New function.
* lisp/org-compat.el (org-file-url-p): Make obsolete alias for
function above.
* lisp/org-lint.el (org-lint-non-existent-setupfile-parameter):
* lisp/org.el (org--collect-keywords-1):
(org-file-contents):
(org-edit-special): Use new function.
2021-05-18 16:31:39 +02:00
Bastien 0c85c8d7ed Merge branch 'maint' 2021-05-18 16:06:39 +02:00
Sébastien Miquel 857ae366b3 org.el (org-src--contents-for-write-back): Indent blank lines
* lisp/org.el (org-src--contents-for-write-back): Indent blank lines.
* lisp/org-src.el (org-return): Revert part of commit bfda3cc7df.
2021-05-18 16:06:27 +02:00
Bastien e80a0094bb Merge branch 'maint' 2021-05-17 07:20:32 +02:00
Bastien a34d71560b Revert "lisp/org-agenda.el: Let tags-todo searches include DONE keywords"
This reverts commit 823f9744e9.
2021-05-17 07:18:35 +02:00
Bastien 59c6e24606 Merge branch 'maint' 2021-05-17 00:54:23 +02:00
Bastien 823f9744e9 lisp/org-agenda.el: Let tags-todo searches include DONE keywords
* lisp/org-agenda.el (org-agenda, org-agenda-run-series): Don't
set the todo-only parameter to '(4) when calling `org-tags-view'.

Reported-by: Stig Brautaset <stig@brautaset.org>
Link: https://orgmode.org/list/m2ftazm3l1.fsf@brautaset.org/

This completes 2fb129b5c, as per Kyle's analysis here:
https://orgmode.org/list/87r1ufmw72.fsf@kyleam.com/
2021-05-17 00:49:32 +02:00