Commit Graph

25329 Commits

Author SHA1 Message Date
Bob Vergauwen a753d0dd26
lisp/ox-latex: Omit empty date
* lisp/ox-latex.el: (org-latex-template): When no date is provided or
the export option date is nil, the empty '\date{}' string is no
longer included in the exported latex document.

The default behaviour for ox-latex was to include an empty date line as
'\date{}'.  This empty date line can affect more complex latex templates
when the date is for example set by the template on compilation, or when
the date command is overwritten entirely.  In this new patch, the date
line is omitted from the exported document.

TINYCHANGE
2022-07-30 13:38:33 +08:00
Max Nikulin 20274454c6
test-ol: Rename cases to match the default selector
* testing/lisp/test-ol.el (test-ol/encode): Rename to
`test-org-link/encode'.
(test-ol/decode): Rename to `test-org-link/decode'.
(test-ol/encode-url-with-escaped-char): Rename to
`test-org-link/encode-url-with-escaped-char'.
(test-ol/org-toggle-link-display): Rename to
`test-org-link/toggle-link-display'.
(test-ol/escape): Rename to `test-org-link/escape'.
(test-ol/unescape): Rename to `test-org-link/unescape'.
(test-ol/make-string): Rename to `test-org-link/make-string'.
(test-ol/store-link): Rename to `test-org-link/store-link'.
(test-ol/update-radio-target-regexp): Rename to
`test-org-link/update-radio-target-regexp'.
(test-ol/next-link): Rename to `test-org-link/next-link'.
(test-ol/previous-link): Rename to `test-org-link/previous-link'.
(test-ol/plain-link-re): Rename to `test-org-link/plain-link-re'.

Only `test-ol/org-toggle-link-display' was executed during
"make test" since it is the only name matched by the "org|ob" default
selector.  Reported in: Ihor Radchenko to emacs-orgmode.
Re [PATCH v7] ol.el: add description format parameter
to org-link-parameters.  Sun, 24 Jul 2022 21:15:31 +0800.
https://list.orgmode.org/87v8rmd53g.fsf@localhost/
2022-07-29 21:02:23 +08:00
Juan Manuel Macias d37c0ee5fa
lisp/ox-latex.el: Remove obsolete Babel and Polyglossia alists
* (org-latex--format-spec): The new variable is now `org-latex-language-alist'.
2022-07-28 20:29:22 +08:00
Ihor Radchenko bc875e5ccf
Fix feature regexp used to detect Org library names
* lisp/org.el (org-reload):
* mk/org-fixup.el (org-make-org-loaddefs): Distinguish ol-*.el and
oc-*.el libraries as parts of Org-related libraries.
2022-07-28 20:26:14 +08:00
Ihor Radchenko 5be0c709b3
* lisp/org.el (org-reload): Do not quote t symbol 2022-07-26 22:17:04 +08:00
TEC 6ad53fa22e
org: Correct regexp escaping to use regexp-quote
* lisp/org.el (org--confirm-resource-safe): `regexp-opt' was
accidentally used instead of `regexp-quote'.
2022-07-26 12:49:51 +08:00
Paul Eggert 6013cb161d Fix doc string quoting problems with '
The Emacs doc string convention is to document values as-is when that
is clear, and surrounded by `single quotes' otherwise. For example, a
doc string "(a b c)" stands for a list of symbols, and the doc string
"`a'" stands for a single symbol. The doc string "\\=`a" is typically
not correct for that single symbol, because that is equivalent to
"(quote a)" and the typical intent is to talk about the symbol, not
about the Lisp quoting construct.  One needs "\\=`X" only when talking
about something intended to be equivalent to "(quote X)", as in the
doc string "(provide \\='org-xyz)".
2022-07-25 13:10:29 -07:00
TEC 4504473779
ox-latex: Support svg images with unicode paths
* lisp/ox-latex.el (org-latex--inline-image): Testing with TeXLive 2022
finds that while \includegraphics is fine with unicode characters in the
file path, \includesvg needs \detokenize{...} to prevent errors.
2022-07-25 22:02:25 +08:00
Ihor Radchenko eb5622b7ad
* doc/org-manual.org (Footnotes): Fix typo
Reported in https://orgmode.org/list/4F9E0E55-38BD-4210-8294-5A7E1DCACB01@easesoftware.com
2022-07-25 21:46:53 +08:00
TEC 394f494935
org-macro: Require vc in vc-modified-time
* lisp/org-macro.el (org-macro--vc-modified-time): Not all the vc
components needed are autoloaded, allowing for the error:
"vc-call-backend: Symbol’s value as variable is void: vc-log-view-type".
To prevent this issue from cropping up, vc is now required at the start
of `org-macro--vc-modified-time'.
2022-07-25 18:36:12 +08:00
Kyle Meyer 5a64429b27 Merge branch 'bugfix'
As mentioned in 2e36ac2ac (Merge single quote fixes from Emacs's
master, 2022-07-24), this merge is keeping Org main's side of
org-babel-lua-read-string and org-agenda-sorting-strategy rather than
the variant introduced in the Emacs repo that's now in bugfix.

Note that for org-agenda-sorting-strategy docstring I think it'd
probably be preferable to change main's

    \\='(time-up category-keep priority-down)

to a bare

    (time-up category-keep priority-down)

but, at least for this merge, I'm sticking to choosing between the
variables that are in one of the sides.
2022-07-24 16:53:32 -04:00
Stefan Kangas 6e991f4bb9 Backport commit 10b691987 from Emacs
; Fix typos
10b69198708105655c49b62ac7d6185abb7e02a7
Stefan Kangas
Sat Jul 16 10:07:38 2022 +0200
2022-07-24 16:22:34 -04:00
Stefan Kangas 745bdebe73 Backport commit ba0871bef from Emacs
; Fix typos: prefer American spelling
ba0871bef1e7d321f1124a6ad20e9be158a976dd
Stefan Kangas
Wed Jul 13 13:04:22 2022 +0200
2022-07-24 16:22:33 -04:00
Kyle Meyer 2e36ac2ac1 Merge single quote fixes from Emacs's master
This brings in ports of bbf389ea6de (Audit quoting the quote character
in doc strings, 2022-04-22), 2d71fd3b041 (Further doc string quoting
fixes, 2022-04-22), and b2bce107b15 (Further audits of single quotes
in Lisp doc strings, 2022-05-24) from Emacs's master branch, resolving
conflicts with 01b0fb14b (Backport from main: Escape single left
quotes in docstrings, 2022-07-24).

In all cases, take Emacs's side.  There are two cases where I think
Org's version is preferable, org-babel-lua-read-string and
org-agenda-sorting-strategy.  Don't keep those _on bugfix_ to avoid
conflicts when Emacs's emacs-28 branch is merged to its master branch.
When I merge bugfix to main, I'll keep Org's variant, so they'll
eventually make it to Emacs's tree, just not as part of the Org 9.5.x
to emacs-28 syncing.
2022-07-24 16:18:15 -04:00
Lars Ingebrigtsen 9d29de23cf Backport commit b2bce107b from Emacs
* lisp/org.el (org-latex-to-html-convert-command):
* lisp/org-agenda.el (org-agenda-sorting-strategy): Audit use of
various single quotes in Lisp doc strings.

Further audits of single quotes in Lisp doc strings
b2bce107b15d6e0c2b773704179c6bf463525459
Lars Ingebrigtsen
Tue May 24 13:17:53 2022 +0200

[km] Org's bugfix branch is currently receiving commits from emacs-28,
     but this commit comes from Emacs's master branch.  I'm porting it
     because it has conflicts with bugfix's 01b0fb14b (Backport from
     main: Escape single left quotes in docstrings, 2022-07-24) and
     only touches docstrings.
2022-07-24 16:17:23 -04:00
Lars Ingebrigtsen 5fdbf159f2 Backport commit 2d71fd3b0 from Emacs
* lisp/ob-table.el (org-sbe): Further quoting fixes in doc strings.

Further doc string quoting fixes
2d71fd3b041506c68b5f1cd1e409e09e25778c34
Lars Ingebrigtsen
Fri Apr 22 17:16:42 2022 +0200

[km] Org's bugfix branch is currently receiving commits from emacs-28,
     but this commit comes from Emacs's master branch.  I'm porting it
     because it has conflicts with bugfix's 01b0fb14b (Backport from
     main: Escape single left quotes in docstrings, 2022-07-24) and
     only touches docstrings.
2022-07-24 16:17:23 -04:00
Lars Ingebrigtsen cea0263784 Backport commit bbf389ea6 from Emacs
* lisp/ox-publish.el (org-publish-find-property):
* lisp/ox-html.el (org-html--unlabel-latex-environment):
* lisp/org-table.el (org-table-collapse-header):
* lisp/org-plot.el (org--plot/prime-factors):
* lisp/org-agenda.el (org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/ob-lua.el (org-babel-lua-read-string):
* lisp/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/ob-core.el (org-babel-default-header-args): Fix
quoting in doc strings.  In code examples, the ' character is
quoted with \\=, and regularize 'foo to `foo', and quote strings
like "foo" instead of 'foo'.

Audit quoting the quote character in doc strings
bbf389ea6deab229ba18dc519fe712ec982609d1
Lars Ingebrigtsen
Fri Apr 22 16:17:22 2022 +0200

[km] Org's bugfix branch is currently receiving commits from emacs-28,
     but this commit comes from Emacs's master branch.  I'm porting it
     because it has conflicts with bugfix's 01b0fb14b (Backport from
     main: Escape single left quotes in docstrings, 2022-07-24) and
     only touches docstrings.
2022-07-24 15:58:18 -04:00
Paul Eggert 540fcd0193 ox-publish: fix typo in function name
* lisp/org-compat.el (org-publish-cache-ctime-of-src):
New backward-compatibility alias.
* lisp/ox-publish.el (org-publish-cache-mtime-of-src):
Rename from org-publish-cache-ctime-of-src, since it
has always cached mtime not ctime.  All uses changed.
2022-07-24 09:39:25 -07:00
TEC 6de5431acc
org: Refactor rx to concat + regexp-opt
* lisp/org.el (org--confirm-resource-safe): Since Emacs 26 doesn't
support rx's (literal S) construct, use (concat (regexp-opt ...) ...)
instead.
2022-07-24 22:07:46 +08:00
Ihor Radchenko 22de2e26e7
Fix Emacs 26 compatibility
* lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Do not use
`seq-first'.
* lisp/org-persist.el (org-persist-collection-let): Suppress warnings.
* lisp/ox-latex.el (org-latex-src--engrave-mathescape-p): Do not use
`if-let'.
(org-latex-src--engrave-code): Do not use `string-trim-right'.
* lisp/ox.el (org-export-link-localise): Add require for subr-x for
`thread-first'.
2022-07-24 20:57:07 +08:00
Ihor Radchenko d8133e80d8
Merge branch 'bugfix' 2022-07-24 20:29:20 +08:00
Ihor Radchenko 1c3a46268f
Backport from main: Fix compatibility with Emacs 26
* lisp/org-compat.el (org-replace-buffer-contents): Add compatibility
function for `replace-buffer-contents'.

* lisp/org-src.el (org-edit-src-save, org-edit-src-exit): Use
`org-replace-buffer-contents'.
2022-07-24 20:23:48 +08:00
Ihor Radchenko a0a078049b
Fix compiler warnings
* lisp/oc-basic.el (org-open-file): Declare function.
2022-07-24 20:19:47 +08:00
Robert Pluim 01b0fb14bc
Backport from main: Escape single left quotes in docstrings
* lisp/ob-core.el (org-babel-default-header-args):
* lisp/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/ob-lua.el (org-babel-lua-read-string):
* lisp/ob-table.el (org-sbe):
* lisp/oc-basic.el (org-cite-basic--shorten-names):
* lisp/org-agenda.el (org-agenda-sorting-strategy):
(org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org-fold-core.el (org-fold-core--specs):
(org-fold-core-remove-folding-spec):
(org-fold-core-get-folding-spec):
(org-fold-core--isearch-overlays):
* lisp/org-plot.el (org--plot/prime-factors):
* lisp/org-table.el (org-table-collapse-header):
* lisp/org.el (org-special-ctrl-o):
(org-latex-to-html-convert-command):
* lisp/ox-html.el (org-html--unlabel-latex-environment):
* lisp/ox-publish.el (org-publish-find-property):
Use \\=' when there's a need for a single left quote in a docstring.

The emacs-29 byte compiler complains about such usage.
2022-07-24 20:19:11 +08:00
Ihor Radchenko afe50b7132
Fix Emacs 26 compatibility
* lisp/org-plot.el (org-plot/gnuplot): Do not use `if-let'.
* lisp/ox-ascii.el (org-ascii--describe-links):
* lisp/ox-md.el (org-md--headline-referred-p): Do not use
`ignore-error'.
* testing/org-test.el (org-test-at-time): Fallback to older definition
of `decode-time' when it cannot accept 3 arguments.
2022-07-24 20:11:03 +08:00
Ihor Radchenko 127e7fee49
ox-latex: Keep obsolete variable values removed in 97cfb959d
* lisp/org-compat.el (org-latex-babel-language-alist):
(org-latex-polyglossia-language-alist): Resurrect the variable values.
2022-07-23 22:16:54 +08:00
Ihor Radchenko abaee57ce6
Merge branch 'bugfix' 2022-07-23 14:17:37 +08:00
Ihor Radchenko e5cf0bc840
org-export: Do not use broken link handler on non-link elements
* lisp/ox.el (org-export-data): Only catch 'org-link-broken on link
objects.  Signaling 'org-link-broken for other element types, should
not happen and we should _not_ export such elements as "" or "[BROKEN
LINK...]".
2022-07-23 14:10:45 +08:00
Ihor Radchenko 14532ec6a5
ox-md: Fix export with broken links
* lisp/ox-md.el (org-md--headline-referred-p): Allow exporting
headlines when the document contains broken links and
`org-export-with-broken-links' is non-nil.  For broken links,
`org-export-resolve-link' throws an error - catch it and do not match
the headline against such broken link.
2022-07-23 14:10:19 +08:00
Ihor Radchenko 4631790fb9
ox-ascii: Fix export with broken links
* lisp/ox-ascii.el (org-ascii--describe-links): Skip broken links.
2022-07-23 14:10:13 +08:00
Juan Manuel Macias 97cfb959d1
* lisp/ox-latex.el: New variable `org-latex-language-alist'
(org-latex-language-alist): Unify in a single list
`org-latex-polyglossia-language-alist' and
`org-latex-babel-language-alist', and make the two variables
obsolete. However, it may be convenient in the future to replace this
list with a more robust one.  (See:
https://list.orgmode.org/taeb0a$r62$1@ciao.gmane.io)

(org-latex-guess-babel-language): This function has been modified so
that the new Babel command `babelprovide' is also recognized.  This
command is necessary to load the languages served by Babel exclusively
through an ini file.  Therefore, the new Babel syntax is supported
alongside the old one.  Note that languages that are served
exclusively via an ini file are not added to the Babel argument.
2022-07-23 12:57:11 +08:00
Ihor Radchenko 6c1e3dfa28
Merge branch 'bugfix' 2022-07-23 10:14:01 +08:00
Ihor Radchenko c779b7aa0e
org-babel-detangle: Fix :comments link for src blocks before first heading
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Allow fuzzy
matching when following the backlink to src block from tangles
source.  The current default value of
`org-link-search-must-match-exact-headline` makes
`org-link-open-from-string` treat fuzzy links as headlines without
falling back to fuzzy text search.  Bind it to nil to force fuzzy text
matching while detangling.

Fixes https://orgmode.org/list/87zgh1qxfk.fsf@posteo.net
2022-07-23 10:10:24 +08:00
Ihor Radchenko b6098500ae
org-keys: Bind ESC <left> by default
* lisp/org-keys.el (org-mode-map): Bind `org-metaleft' to ESC <left>
by default, not just in terminals.  This completes the ESC <arrow>
binding group.  ESC <right>, <up>, and <down> are already bound and
missing ESC <left> can be confusing.

Reported in https://orgmode.org/list/Yf6lsTR3JSNSXRDX@x.local
2022-07-22 21:35:38 +08:00
Ihor Radchenko b713b9afa1
mk: Add make target "repro" for easy bug testing
* mk/default.mk (REPRO_DEBUG): New custom variable enabling extra
debugging facilities in Emacs instance open by make repro.
(REPRO_ARGS): Extra arguments passed to Emacs by make repro.
(REPRO_INIT):
(REPRO): Define Emacs cmd for testing.
* mk/targets.mk (.PHONY):
(repro): Add new target.
* doc/org-manual.org (Feedback): Describe the new make target.
2022-07-22 21:35:37 +08:00
TEC 99681ce389
org: Support completion of cite-related keywords
* lisp/org.el (org-get-export-keywords): Add BIBLIOGRAPHY, CITE_EXPORT,
and PRINT_BIBLIOGRAPHY to `org-options-keywords'.

It's worth noting that while based on the variable name
PRINT_BIBLIOGRAPHY may not seem to fit, it is in good company with
INCLUDE, and this variable is (exclusively) used as a list of
non-affiliated, non-block, non-export-backend-specific keywords for
pcomplete.  It may be a good idea to rename this for clarity, or split
it up in future.
2022-07-21 22:09:24 +08:00
Ihor Radchenko d2a110ffe2
org-attach-attach: Allow attaching directories using 'cp method
* lisp/org-attach.el (org-attach-attach): Use `copy-directory' when
FILE is a directory.  Remove trailing slash before processing.
2022-07-21 19:23:18 +08:00
TEC db6c229786
testing/lisp: Update to handle new download policy
* testing/lisp/test-ox.el: Bind `org-resource-download-policy' to t when
testing downloading.

* testing/lisp/test-org.el: Bind `org-resource-download-policy' to t
when testing downloading.
2022-07-20 23:37:26 +08:00
Ihor Radchenko df1814b83e
org-html-format-latex: Preserve buffer-local settings
* lisp/ox-html.el (org-html-format-latex): Carry over buffer-local
variables when create LaTeX images.  Use `org-export-with-buffer-copy'
instead of `with-temp-buffer'.

Fixes https://orgmode.org/list/m2fsqr75md.fsf@ego.team
2022-07-20 15:11:41 +08:00
Ihor Radchenko 39005dc098
org-fold: Do not fold text inserted right after outline fold
* lisp/org-fold.el (org-fold-initialize): Do not extend the fold when
text is inserted right after it.  This resembles folding overlay
behavior used in previous Org versions and in the 'overlays
`org-fold-core-style'.

Fixes https://orgmode.org/list/871quprrra.fsf@gmail.com
2022-07-19 21:15:38 +08:00
Ihor Radchenko 3b7523acd0
ob-gnuplot: Fix stable file collision when converting data
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): Use cons cell
of all the code block parameters and the actual assigned variable
value to generate filename for storing the data.  This fixes a
scenario when code block has two or more variable assignments that
were wrongly saved into the same file.  Before the commit, only the
last assigned variable value has been used by gnuplot for _all_ the
variables.
2022-07-19 18:02:56 +08:00
Ihor Radchenko 03543e17dd
org-src-font-lock-fontify-block: Transfer 'font-lock-face property
* lisp/org-src.el (org-src-font-lock-fontify-block): Copy
'font-lock-face text property in addition to 'face.  This is required
because Emacs does not enable `font-lock-mode' inside buffers with
names starting from space character (Org fontification buffers are
such).  Without `font-lock-mode' 'font-lock-face is not being remapped
to 'face text property and we may sometimes lose the information in
the major modes that do fontification by directly setting
'font-lock-face.

Reported in https://teddit.net/r/orgmode/comments/w2b0tw/syntax_highlighting_in_orgsource_blocks/igqdx18/
2022-07-19 12:19:57 +08:00
Ihor Radchenko 9917d69543
org-indent-region: Fix when `org-adapt-indentation' is 'headline-data
* lisp/org.el (org--get-expected-indentation): Remove the extra
condition added in e3b79ad2b in the cond branch for first line in an
element.  Checking `org-adapt-indentation' t value here trigger the
last default cond branch that assumes that we are _not_ at the first
line.

The new logic explicitly avoids inheriting indentation from previous
sibling when `org-adapt-indentation' is set to 'headline-data and the
previous sibling is satisfying "headline data" condition as in
`org-indent-line'.  The case when `org-adapt-indentation' is set to t
is already handled correctly when calculating the CONTENTSP
indentation for parent headline.

Fixes https://orgmode.org/list/c13cab60-bbc9-e69e-6d0d-7fe75c5908d6@kalysto.org
2022-07-18 21:00:13 +08:00
Ihor Radchenko 057df6cce2
org-open-at-point: Do not list links under headline that cannot be opened
* lisp/org-element.el (org-element-context): Do not alter match-data.
* lisp/org.el (org-open-at-point): Update docstring listing that
`org-open-at-point' opens src-blocks and citations.
(org-offer-links-in-entry): Do not display links within invalid contexts.

Reported in https://list.orgmode.org/PAXPR06MB77609E8C8E769CD7D769FA4BC6199@PAXPR06MB7760.eurprd06.prod.outlook.com/
2022-07-17 20:14:44 +08:00
Ihor Radchenko df0e96ba42
org-agenda-remove-restriction-lock: Remove 'file restriction
* lisp/org-agenda.el (org-agenda-remove-restriction-lock): Remove
agenda restriction set by `org-agenda-set-restriction-lock' called
with prefix argument.  `org-agenda-restrict' may be nil while
`org-agenda-overriding-restriction' is non-nil.

Fixes https://list.orgmode.org/87v8w2qdgp.fsf@gmail.com
2022-07-17 20:07:13 +08:00
Ihor Radchenko 702b0a81e1
org-agenda-clock-report-header: Update docstring
See https://orgmode.org/list/87o808j6si.fsf@yandex.com
2022-07-17 17:07:52 +08:00
Ihor Radchenko b4a72ddf98
org-agenda-show-current-time-in-grid: Use more common Unicode arrow
* lisp/org-agenda.el (org-agenda-current-time-string): Use more
commonly available "←" char indicator instead of "⭠".  Suggested in
https://orgmode.org/list/875yk1e3h1.fsf@posteo.net.  This patch does
not fully solve the problem with `char-displayable-p' returning
non-nil when the char cannot be actually displayed in agenda, but it
should at least make the issue less severe until we find a more
accurate test.  In any case, the Unicode version of the agenda grid
will be available for more users with this patch.
2022-07-17 16:54:34 +08:00
Ihor Radchenko 064afa0c01
org-indent: Fix edge case when edited region ends at headline leading stars
* lisp/org-indent.el (org-indent-refresh-maybe): Extend affected
region to the whole line after END.

Fixes https://orgmode.org/list/t4lpos$l3p$1@ciao.gmane.io
2022-07-17 16:51:54 +08:00
Ihor Radchenko 79f0969ccc
* doc/org-manual.org (Using CDLaTeX to enter math): Clarify ' binding
See https://orgmode.org/list/CAJczNmB95tdWgYcb6gP-B4LH5+W0sBMyA+Z38Fh7Sy+ksfpmbw@mail.gmail.com
2022-07-17 16:50:43 +08:00
Max Nikulin e08ce5b27d
test-org.el: Add some tests for `org-test-with-timezone'
* testing/lisp/test-org.el (test-org/org-time-string-to-time):
Check that no daylight saving time value is forced for
`org-parse-time-string' and `org-encode-time' calls.
2022-07-17 16:40:19 +08:00