Commit Graph

16995 Commits

Author SHA1 Message Date
Bastien 179ae6b232 Merge branch 'bugfix' 2021-09-25 17:16:49 +02:00
Ihor Radchenko 6a2c48704b Avoid infinite loop in org-agenda-dim-blocked-tasks
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): When the blocked
task is the last line in agenda buffer and no trailing newline is
present, (move-beginning-of-line 2) would not move the point causing
infinite loop.  Now, such case is handled correctly.
2021-09-25 17:16:38 +02:00
David Lukes b967a05fbc org-indent: Allow indentation per level to be 0
* lisp/org-indent.el (org-indent--compute-prefixes): Prefixes should
only be computed when `org-indent-indentation-per-level' is greater than
0.  For one thing, the current algorithm leads to an error otherwise,
and for another, this makes it possible to use org-indent just to
preserve indentation on continuation lines, without adding any
additional indentation per level (by setting the option to 0).

TINYCHANGE
2021-09-25 16:40:28 +02:00
Utkarsh Singh e626185081 org-table.el: Fix usage of user-error
* lisp/org-table.el (org-table-convert-region): Don't use `if' because
  Elisp has no concept of continuable errors.
2021-09-25 16:23:54 +02:00
Pedro Bruel bf1c4c7575 Include support for evaluating julia code
* lisp/ob-julia.el: included from org-contrib
* testing/lisp/test-ob-julia.el: start adapting from testing/lisp/test-ob-python.el
2021-09-25 16:00:02 +02:00
Bastien 26b0297f65 Merge branch 'bugfix' 2021-09-25 15:53:16 +02:00
Maxim Nikulin 3f5605e66c org-agenda.el: Avoid dependency on subr-x
* lisp/org-agenda.el (org-agenda-highlight-todo): Do not use `string-empty-p'.

Restore compatibility with Emacs-24.3.
2021-09-25 15:53:07 +02:00
Ihor Radchenko c9dc6603a4
Fix org-babel-header-args:haskell not being an alist
* lisp/ob-haskell.el (org-babel-header-args:haskell): The old value of
the variable was not argument alist, as expected by Org babel code.

Fixes https://orgmode.org/list/87fsty7750.fsf@gmail.com
2021-09-21 16:51:54 +08:00
Bastien fb7574178c lisp/ob-gnuplot.el: Add Ihor Radchenko as maintainer 2021-09-20 09:27:50 +02:00
Kyle Meyer f5392c4f2b Merge branch 'km/from-emacs-master' 2021-09-19 22:39:03 -04:00
Marco Wahl d3d2e56bd6 oc: Replace an obsolete alias
* lisp/oc.el (org-cite--allowed-p): The replace removes the respective
  warning at compilation.
2021-09-20 00:38:28 +02:00
Marco Wahl 4063d4c2d7 org: Rename for more consistency
* lisp/org.el (org-get-previous-sibling): Rename from
  org-get-last-sibling to be more consistent with the rest of Emacs.
  org-get-last-sibling stays as obsolete alias.
2021-09-20 00:27:02 +02:00
Morgan Willcock 3a77e59fc9
ox-ascii: Justify correctly with indent-tabs-mode
* lisp/ox-ascii.el (org-ascii--justify-lines): Ensure that
`indent-tabs-mode' is nil when applying indentation to justify lines.
As other parts of ox-ascii use spaces for adjustments, if
`indent-tabs-mode' is respected, ox-ascii will produce an an
inconsistently formatted export.  It's preferable to just force spaces
by binding `indent-tabs-mode' to nil.

TINYCHANGE
2021-09-20 00:57:43 +08:00
Mark Dawson ef31364bc8
ob-tangle: Fix incorrect buff name in org-src edit
* lisp/ob-tangle.el (org-babel-tangle): Fix stringp error which happens
when confirming successful tangle when `org-babel-tangle' is called from
an org-src edit buffer.

TINYCHANGE
2021-09-19 20:58:49 +08:00
Marco Wahl 069bcba529 org: Fix functionality of org-insert-heading
* lisp/org.el (org-insert-heading): Fix insertion of headings when
  point is before any heading in the case of "respect content" insertion.

Kudos to Victor Stoichita. https://orgmode.org/list/87lf4594t3.fsf@svictor.net/
2021-09-18 14:54:09 +02:00
TEC b02f1eae19
oc: Allow citations following an item bullet
* lisp/oc.el (org-cite--allowed-p): Expand the allowed cases to include
"item", which lets one insert a citation following a bullet, e.g. "- ".
We just have to check to make sure the citation actually is at least one
character away from the bullet, or five if a checkbox is present.
2021-09-18 13:41:21 +08:00
Stefan Kangas 7aeadf2504 Backport commit 3f9f3ba43 from Emacs
* lisp/org-timer.el (org-timer-set-timer):
* lisp/ox.el (org-export-dispatch-last-position): Use command
substitution for 'universal-argument' instead of raw "C-u".

Docfix: use command substitution for 'universal-argument'
3f9f3ba4370bd4d0f33392befb35328327d73b1e
Stefan Kangas
Thu Sep 16 20:05:48 2021 +0200
2021-09-18 01:40:56 -04:00
Stefan Kangas b4ce4d6d82 Backport commit 25ebb9374 from Emacs
; More minor docfixes found by checkdoc
25ebb9374bdadf66153727831fc7ff131c8cf299
Stefan Kangas
Tue Sep 14 07:57:14 2021 +0200
2021-09-18 01:39:24 -04:00
Stefan Kangas 215d80d02b
Fix a small number of typos 2021-09-17 17:01:57 +08:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Marco Wahl a7a69b954c org: Simplify doc
* lisp/org.el (org-end-of-meta-data): Drop unnecessary part around
"regular drawer".

Issue reported by Tom Davey.  https://orgmode.org/list/014801d7aa5c$c9057450$5b105cf0$@tomdavey.com
2021-09-16 10:41:47 +02:00
Kyle Meyer a246a13187 Merge branch 'km/from-emacs-master' 2021-09-12 23:35:16 -04:00
Eli Zaretskii d2deb188a6 Backport commit ff4de1bd8 from Emacs
* lisp/org.el:
* lisp/org-list.el (org-list-to-generic):
* lisp/org-compat.el: In comments, quote 'like this'.

Fix quoting style in Lisp comments
ff4de1bd88b8be4a7071884910ff601eb10fbad5
Eli Zaretskii
Sun Sep 12 19:51:06 2021 +0300
2021-09-12 23:34:08 -04:00
Stefan Kangas 9961abf75a Backport commit fc4b956c7 from Emacs
; Fix symbol quoting typos
fc4b956c7cb2fba8ed2a18865a7686c6cfa5d030
Stefan Kangas
Sun Sep 12 18:36:49 2021 +0200
2021-09-12 23:34:07 -04:00
TEC d70f280678
org-macs: Allow for nil ffap-url-regexp
* lisp/org-macs.el (org-url-p): `ffap-url-regexp' is allowed to be nil,
which is taken to mean urls should not be matched.  When this is set,
`string-match-p' errors.  To consider this case correctly, we check that
`ffap-url-regexp' is non-nil before calling `string-match-p'.

Reported-by: "Peder Stray" <peder.stray@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2021-09/msg00004.html>
2021-09-01 22:43:07 +08:00
Nick Dokos 1690fbd88f
org-colview: Fix dynblock match/maxlevel conflict
* lisp/org-coplview.el (org-columns--capture-view): Combine the match
and maxlevel arguments properly to construct the MATCH argument of
`org-map-entries'.

Specifying both `maxlevel' and `match' in a columnview dynamic block
does not work: the `match' argument is ignored in that case.  See the
link below for a (not so minimal) ECM.

Reported-by: Pablo A Perez-Fernandez
Link: https://emacs.stackexchange.com/questions/66658/filter-columnview-dblock-on-properties-or-tags
2021-08-31 22:40:34 +08:00
Yasushi SHOJI 18bc3a65b2
ob-core: Document the option 'none' for :results handling
The commit d4b739fbf2 added the "none" header argument but didn't
add it to the `org-babel-insert-result' documentation string.  Put it
in the doc string so that users can discover it.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-08-31 21:40:51 +08:00
Marco Wahl b1a74d4c7a agenda: Fix whitespace 2021-08-31 00:07:59 +02:00
TEC a3ba79cd3a
oc-csl: Prevent ' from being a LaTeX active char
* lisp/oc-csl.el (org-cite-csl-finalizer): The hanging LaTeX package
we're using also affects punctuation and makes `,.'"`?!:;' active
characters throughout the entire document.  That means a LaTeX snippet
like \(f'(x)\) will now make the document fail to compile.
See <https://tex.stackexchange.com/questions/61732/hanging-package-chokes-on-apostrophes>
for more information.  Adding the [notquote] option stops \(f'(x)\) from
being an issue.

In time it could be worth looking into replacing the hanging package
with some use of \parshape.
2021-08-23 18:34:30 +08:00
TEC 818bec57eb
oc-csl: Define \citeprocitem for LaTeX export
* lisp/oc-csl.el (org-cite-csl-finalizer): In order for
citeproc-generated references to be treated the same as bib(la)tex
references by hyperref, we need to make use of \hyper@linkstart.
However, this requires \makeatletter and \makeatother, which can only be
used in the preamble.  To allow citeproc-el to use \hyper@linkstart, we
add a command definition in the preamble, \citeprocitem.
2021-08-23 18:34:30 +08:00
Marco Wahl 3664447eb2 org-compat: Silence byte compiler for Emacsversion < 28
Check availablility of function directory-empty-p directly instead of
relying on Emacs version.

Thanks Maxim and Kyle for the help.  See
https://orgmode.org/list/87pmun8t2o.fsf@kyleam.com/ .
2021-08-15 11:01:39 +02:00
DPDmancul f51bf65f0f ox: Italian smart quotes
* ox.el (org-export-smart-quotes-alist): Added support for italian smart quotes.
2021-08-11 22:44:32 +02:00
Nicolas Goaziou e7454ceb79 oc: Call select-style function with a citation argument
* lisp/oc.el (org-cite--keys-to-citation): New function.
(org-cite-make-insert-processor): Use new function.  Change signature
of SELECT-STYLE.

Reported-by: "Bruce D'Arcus" <bdarcus@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00638.html>
2021-08-11 12:11:34 +02:00
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