Commit Graph

17102 Commits

Author SHA1 Message Date
Nicolas Goaziou 957feb2df4 oc: Fix typo in docstring
* lisp/oc.el (org-cite-make-insert-processor): Fix typo.
2021-12-11 14:21:10 +01:00
Nicolas Goaziou a957a4c19d keys: Don't bind illegal C-TAB
* lisp/org-keys.el (org-mode-map): Bind `org-force-cycle-archived' to
C-c C-<tab> instead of C-c C-TAB.

Reported-by: Ingo Lohmar <ingo.lohmar@posteo.net>
<http://lists.gnu.org/r/emacs-orgmode/2021-10/msg00048.html>
2021-12-10 10:33:01 +01:00
Nicolas Goaziou f0d8041f0c ox: Clarify `org-export-to-(buffer|file)' docstrings
* lisp/ox.el (org-export-to-buffer):
(org-export-to-file): Fix example and add precision about the need for
quoting lambda sexps.
2021-12-10 10:28:58 +01:00
Sébastien Miquel 8d189720b2 ox: Fix async export with native compilation
* lisp/ox-beamer.el (org-beamer-export-to-pdf):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-koma-letter.el (org-koma-letter-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-pdf):
* lisp/ox-texinfo.el (org-texinfo-export-to-info): Quote lambda.

Quote or name lambdas to prevent their compilation into anonymous
functions which cannot be passed to the external async emacs process.
2021-12-10 10:22:53 +01:00
Kyle Meyer 4aca51fcbe org-priority: Fix SPC handling for numeric priorities (bug#52341)
* lisp/org.el (org-priority): When reading numeric priorities, provide
special handling of SPC so that it clears the priority, as advertised.

If the user has configured numeric priorities and tries to clear a
priority by inputting SPC at the prompt, org-priority feeds " " to
string-to-number and ends up with 0 instead of the ?\s (32) that's
used downstream to signal "remove".  Explicitly check for " " and
translate it to ?\s.

Reported-by: "Bruce E. Robertson" <brucer42@gmail.com>
Link: https://list.orgmode.org/877dch89s1.fsf@kyleam.com/
2021-12-09 22:42:56 -05:00
Nicolas Goaziou a62da701b4 oc-csl: Fix location of \citeprocitem definition
* lisp/oc-csl.el (org-cite-csl-finalizer): Insert \citeprocitem before
"\begin{document}".
2021-12-08 12:09:15 +01:00
Nicolas Goaziou 18d77ac253 oc-basic: Fix completion cache
* lisp/oc-basic.el (org-cite-basic--key-completion-table): Cache
completions per document.  Return nil when no completion is available
so insertion mechanism can properly report the problem.
2021-12-07 22:51:46 +01:00
Nicolas Goaziou a83465add3 oc-basic: Clarify prompt during key completion
* lisp/oc-basic.el (org-cite-basic--complete-key): Clarify prompt
during completion.  Format docstring.
2021-12-07 22:10:39 +01:00
Stefan Kangas db4805c2d7 Backport commit 50b40e1d4 from Emacs
; * lisp/org/ob-julia.el: Fix Author header for authors.el.
50b40e1d4f0063ac78a53673736a2eaa3ba3287b
Stefan Kangas
Wed Dec 1 17:03:52 2021 +0100
2021-12-04 15:29:43 -05:00
Rasmus c91271297d ox-latex: Fix asynchronous export
* lisp/ox-latex.el (org-latex-export-to-pdf): Fix "invalid-read-syntax
'#'" when exporting asynchronously with ox-latex.

See also previous bug report: https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00422.html
2021-11-28 20:44:22 +01:00
Stefan Kangas 36086a4f49 Backport commit 1fffe9a21 from Emacs
; * lisp/org/org.el: Fix version header.
1fffe9a210d328559da2af8facbb75286a31c74e
Stefan Kangas
Sun Nov 28 14:54:24 2021 +0100
2021-11-28 10:46:50 -05:00
Nicolas Goaziou afc5ec2187 oc-csl: "Barf" functions should actually barf
* lisp/oc-csl.el (org-cite-csl--barf-without-citeproc): Actually raise
an error, as expected from the docstring.
2021-11-26 12:20:36 +01:00
Nicolas Goaziou 2b0007a808 ox: Add autoload cookies
* lisp/ox.el (org-export-derived-backend-p):
(org-export-data):
(org-export-raw-string): Autoload function.

These functions are required at runtime by some other libraries (e.g.,
"oc-basic.el"), which cannot require `ox' because of circular
dependencies.

In particular, this fixes
<http://lists.gnu.org/r/emacs-orgmode/2021-11/msg00594.html>.
2021-11-26 11:40:28 +01:00
Nicolas Goaziou 30a6126bb9 oc: Fix `org-cite-fontify-default' docstring and simplify code
* lisp/oc.el (org-cite-fontify-default): We don't need to assume
activate processor may be used on a citation reference: that will not
happen.
2021-11-24 22:50:09 +01:00
Nicolas Goaziou 308f4cb570 oc: Ensure activation returns a non-nil value
* lisp/oc.el (org-cite-activate): Return a non-nil value when
successful, even if citation processor doesn't.
2021-11-24 22:39:50 +01:00
Ihor Radchenko 4b1def3c5c
org-table.el: Do not create new field when at EOL after table line
* lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$"
as unclosed table field.

Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06
2021-11-23 21:40:58 +08:00
Nicolas Goaziou a51e4dc710 ox-icalendar: Fix error dangling footnotes
* lisp/ox-icalendar.el (icalendar): Add an inner-template function so
as to not use "ox-ascii"'s.
(org-icalendar-inner-template): New function.

This fixes <https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg01478.html>
and <http://lists.gnu.org/r/emacs-orgmode/2021-11/msg00395.html>.

Footnote definition is lost, but references are already removed from
the description anyway, so the problem is not worse.
2021-11-19 09:53:13 +01:00
Marco Wahl 35e21b6161
org-goto: Fix UI
* lisp/org-goto.el (org-goto-location): Drop the wrap by
`org-no-popups'.  This restores the expected functionality of org-goto
with interface type 'outline.

See ml: https://list.orgmode.org/87mtnovv7f.fsf@alphapapa.net/.
2021-11-09 00:14:10 +08:00
Nicolas Goaziou 4e185becbf oc-basic: Use `org-cite-main-affixes' when appropriate
* lisp/oc-basic.el (org-cite-basic-export-citation): Use
`org-cite-main-affixes' when appropriate.
2021-11-03 17:49:41 +01:00
Nicolas Goaziou d0201d5801 oc-csl: Fix global affixes
* lisp/oc-csl.el (org-cite-csl--create-structure): Properly
concatenate global affixes to the first or last cite, as intended.
2021-11-03 16:50:07 +01:00
Nicolas Goaziou ad40282860 oc: Refactor affixes extraction
* lisp/oc.el (org-cite-main-affixes): New function.
* lisp/oc-natbib.el (org-cite-natbib--build-optional-arguments): Use
new function.
* testing/lisp/test-oc.el (test-org-cite/main-affixes): New test.
2021-11-03 16:27:53 +01:00
Nicolas Goaziou 37c99e0874 oc-basic: Also extract year from "date" field
* lisp/oc-basic.el (org-cite-basic--get-year): Try extracting year
from "date" field when "year" field is empty.  Add optional argument
to prevent disambiguation mechanism.
(org-cite-basic--print-entry):
(org-cite-basic--key-completion-table): Use `org-cite-basic--get-year'
instead of `org-cite-basic--get-field'.
2021-11-03 16:12:42 +01:00
Nicolas Goaziou 95ad5a954b oc-csl: Small refactoring
* lisp/oc.el (org-cite-wrap-citation): Mention return value.
* lisp/oc-csl.el (org-cite-csl--create-structure): Use return value
from `org-cite-wrap-citation' instead of using `org-element-lineage'.
2021-11-02 18:39:09 +01:00
András Simonyi 16dcfdfa80 oc-csl: Fix footnote status reporting for wrapped citations
* lisp/oc-csl.el (org-cite-csl--create-structure): Update footnote information
when citation is wrapped in a footnote.
2021-11-02 18:34:28 +01:00
Vinicius f135889ca1 macro: Fix keyword macro with multiple keywords
* lisp/org-macro.el (org-macro-initialize-templates): Properly collect
multiple keywords' values with "keyword" macro.
2021-11-02 15:07:53 +01:00
Nicolas Goaziou 52e6f1cf57 macro: Properly collect multiple authors
* lisp/org-macro.el (org-macro--collect-macros): Multiple lines are
allowed for AUTHOR keyword (per `org-export-options-alist') so make
sure we collect all of them.
* testing/lisp/test-org-macro.el (test-org-macro/author): Add test.

Reported-by: Vinicius Vinicius <vinicius.vin@yandex.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-10/msg00727.html>
2021-10-23 14:32:00 +02:00
Nicolas Goaziou 745f0913fc oc-basic: Load unconditionally
oc-basic is used for opening links and for fontifying them out of the
box.
2021-10-15 19:41:11 +02:00
Nicolas Goaziou 009900d7fa oc: Add autoload cookie for `org-cite-insert'
* lisp/oc.el (org-cite-insert): Autoload function.
2021-10-13 22:22:22 +02:00
Nicolas Goaziou c83fe001c7 oc: Fix error message
* lisp/oc.el (org-cite-insert): Fix copy-pasta in error message.
2021-10-13 22:20:11 +02:00
Nicolas Goaziou 17e25c3f14 oc-csl: Map § and §§ o section locators
* lisp/oc-csl.el (org-cite-csl--label-alist): Map § and §§ o section
locators.
2021-10-11 23:58:17 +02:00
Nicolas Goaziou 18dca3478a oc: Upon inserting citations, add a space between keys
* lisp/oc.el (org-cite-make-insert-processor): Add a space in addition
to the semicolon.
2021-10-11 11:38:18 +02:00
Nicolas Goaziou eb40091929 oc-csl: Improve an error message
* lisp/oc-csl.el (org-cite-csl--style-file): Add missing placeholder
for format string.
2021-10-11 11:21:00 +02:00
Nicolas Goaziou 3bb0cb9398 oc: Fix § locator name
* lisp/oc-csl.el (org-cite-csl--label-regexp): § is not a word start,
so adjust regexp accordingly.  Also fix mistake introduced in
c4a357f192.
(org-cite-csl--parse-reference): Ignore any space after locator name.
2021-10-11 11:18:40 +02:00
Nicolas Goaziou 596ec7a167 oc-biblatex: Fix docstring
* lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Fix docstring.
2021-10-10 23:11:05 +02:00
Nicolas Goaziou c4a357f192 oc-csl: Allow nbsp after locator label
* lisp/oc-csl.el (org-cite-csl--label-regexp): Allow nbsp between
locator label and value.

Reported-by: M. ‘quintus’ Gülker <post+orgmodeml@guelker.eu>
<http://lists.gnu.org/r/emacs-orgmode/2021-10/msg00423.html>
2021-10-10 12:11:26 +02:00
Nicolas Goaziou 8dfc056fcc oc: Fix failing test about `org-cite-list-citations'
* lisp/oc.el (org-cite-list-citations): Properly implement
a simplified version of `org-export-get-footnote-definition'.
2021-10-09 23:01:35 +02:00
Nicholas Vollmer b71474ff7f lisp/org.el: (org-save-all-org-buffers): Prevent `org-mode' reload
* lisp/org.el: (org-save-all-org-buffers): Ensure `save-some-buffers' PRED returns boolean.

As of this upstream commit:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a9ad3d477441feefa3bf6107d58281cb64e0e78a

`save-some-buffers' will call its PRED argument if it returns a function.
Since (derived-mode-p 'org-mode) returns the symbol org-mode,
and org-mode is a function, org-mode is reloaded in modified Org
buffers when calling `org-save-all-org-buffers'. Among other
undesirable behavior, this will cause the buffer's visibility to be
reset to its initial visibility.
2021-10-09 15:23:33 -04:00
Nicolas Goaziou 11f450da80 oc-biblatex: Declare missing "nocite" style
* lisp/oc-biblatex.el (biblatex): Declare the processor provides
a "nocite" citation style.
2021-10-09 16:09:33 +02:00
Bastien 89968077cf lisp/ol-man.el: Add copyright header 2021-10-08 15:38:01 +02:00
Bastien 2a4dfa7e51 lisp/ol-man.el: Add lexical-binding cookie 2021-10-07 19:36:55 +02:00
Bastien 98b34ea640 lisp/ol-man.el: Restore file
This file was mistakenly removed by db67c7e92.
2021-10-07 17:47:14 +02:00
Nicolas Goaziou 7d22dca54e oc: Fix citations in footnotes when using biblatex back-end
* lisp/oc.el (org-cite-list-citations): Do not use
`org-export-get-footnote-definition' so as to not cache footnote
definitions too early, i.e., when citations are still present in the
parse tree.
* lisp/oc-biblatex.el (org-cite-biblatex--multi-arguments): Append
"\relax" unconditionally to avoid calling `org-export-data' on next
object, when citations are still present in the parse tree.

Reported-by: Elias Bounatirou <elias.bounatirou@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-09/msg00067.html>
2021-10-06 16:07:19 +02:00
Nicolas Goaziou 94b410b32c footnote: Improve last commit
* lisp/org-footnote.el (org-footnote--allow-reference-p): Improve last
commit.
2021-10-06 14:41:50 +02:00
Nicolas Goaziou 5f6e199143 footnote: Allow footnotes at footnote definition start
* lisp/org-footnote.el (org-footnote--allow-reference-p): Allow
footnotes at footnote definition start, right after label.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add
tests.
2021-10-06 14:34:14 +02:00
Nicolas Goaziou b07c312f28 oc: Allow citations at footnote definition start
* lisp/oc.el (org-cite--allowed-p): Allow citations at footnote
definition start.
* testing/lisp/test-oc.el (test-org-cite/insert-capability): Add tests.
2021-10-06 14:29:40 +02:00
Ihor Radchenko bd0493eda1
org-lint: Do not require space after : in keywords
* lisp/org-lint.el (org-lint-duplicate-name): Update regexp to conform
with org-element parsers.

Fixes https://list.orgmode.org/orgmode/87h7ee5q8u.fsf@gmail.com/
2021-10-04 14:14:16 +08:00
Nicolas Goaziou d68d8bc1f8 oc: Pacify checkdoc
* lisp/oc.el (org-cite-export-processors):
(org-cite--move-punct-before):
(org-cite-adjust-note):
(org-cite--allowed-p): Add missing argument.
2021-10-04 00:00:33 +02:00
Nicolas Goaziou d6f0e9e105 oc: Be stricter when introducing spaces before citations
* lisp/oc.el (org-cite-process-citations): Add a space before citation
only if it is preceded by a quotation mark.
* testing/lisp/test-oc.el (test-org-cite/export-capability): Add
tests.

Reported-by: Denis Maier <denismaier@mailbox.org>
<http://lists.gnu.org/r/emacs-orgmode/2021-09/msg00085.html>
2021-10-03 23:51:43 +02:00
Nicolas Goaziou 4b346e5157 oc: Fix typo in docstring
* lisp/oc.el (org-cite-adjust-note): Fix typo.
2021-10-03 23:23:37 +02:00
Kyle Meyer 10dc9debb9 Merge branch 'km/from-emacs-28' into bugfix 2021-10-02 14:22:37 -04:00