Commit Graph

26375 Commits

Author SHA1 Message Date
Ihor Radchenko eb6cabdee5
mk: Expand shell commands once only
* mk/targets.mk (GITVERSION):
(GITSTATUS):
(DATE):
(YEAR): Only expand the variables once, not in every make sub-process.
Previous code ran pwd/date/git in every make sub-process, slowing
things down significantly and unnecessarily.
2023-04-30 11:38:23 +02:00
Ihor Radchenko 42e95938ed
org-latex-compile: Fix erasing PDF output buffer late
* lisp/ox-latex.el (org-latex-compile): Clear the PDF output log
buffer before running compile command.

Fixes regression introduced in 0dfbf0c3.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CALEYq0_t38_gsmjE-qgPCX07-V0P8FYwYEt9R4AT0dZ_SnXRuA@mail.gmail.com
2023-04-30 10:17:09 +02:00
Ihor Radchenko 52d9961f50
org-set-tags-command: Provide more useful error when before first heading
* lisp/org.el (org-set-tags-command): Produce more useful error
message when point is before first heading.
2023-04-28 12:59:19 +02:00
Ihor Radchenko f067a4bd43
org-attach-tag: Work around error when before first heading
* lisp/org-attach.el (org-attach-tag): Avoid error thrown when trying
to set tags before first heading.  This is not a proper fix, but it
will at least allow attaching files to Org file.  The tagging will be
skipped for now, until setting FILETAGS is supported by Org API.
2023-04-28 12:52:09 +02:00
Ihor Radchenko 7e75571f02
Handle more compiler warnings from Emacs master
* lisp/org-macs.el (org-id-uuid): Use built-in `time-convert' instead
of function defined in org-compat.  `time-convert' can already be used
as it is available in Emacs 26.
2023-04-27 22:45:47 +02:00
Ihor Radchenko a8dbe8eb38
Merge branch 'bugfix' 2023-04-27 22:42:58 +02:00
Ihor Radchenko 52dc48050e
Handle compiler warnings from Emacs master
* lisp/ob-core.el (org-babel-insert-result): Comment out unused `cond'
clause.  Still leave it there for readability of the logic.
* lisp/org.el (org-agenda-restrict-begin):
(org-agenda-restrict):
(org-agenda-restrict-end): Mark variables from org-agenda.
2023-04-27 22:42:39 +02:00
Ihor Radchenko ef800e3bec
org--collect-keywords-1: Handle FIXME
* lisp/org.el (org--collect-keywords-1): Do not inhibit SETUPFILE in
read-only buffers.

It is unclear what kind of edge case the FIXME is trying to solve.
Yet, there is no reason to inhibit SETUPFILE processing in all the
read-only buffers (which may happen, for example, when refreshing Org
setup with C-c C-c).  Finally, if there is some bug in Gnus (if any)
we should better report it instead of using unexplained workaround.
2023-04-27 22:18:35 +02:00
Ihor Radchenko 2bc510217a
org-element--cache-find: Remove statistics gathering code
* lisp/org-element.el (org-element--cache-find): Do not collect
hashing statistics.  According to
https://orgmode.org/list/87sfffawfe.fsf@localhost, it is quite useful
for a fraction of users, yielding up to 30% recent cache queries being
memoized.  Add additional commentary.  Also, slight refactoring.
(org-element--cache-hash-nocache):
(org-element--cache-hash-statistics):
(org-element-cache-hash-show-statistics): Remove.
2023-04-27 15:26:56 +02:00
Ihor Radchenko 9e42842a82
org-persist: Fix :last-access being set on every write
* lisp/org-persist.el (org-persist-write:generic): Do not set
:last-access on write, unless writing first time.  Otherwise,
:last-access may never trigger expiration.
2023-04-26 23:39:49 +02:00
Ihor Radchenko eaf274909f
Consistently allow null character in block and drawer bodies
Also, do not use [^\000] as a poor-man's replacement for
(rx (or any newline)).

* lisp/ob-core.el (org-babel-src-block-regexp):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs):
* lisp/org-compat.el (org-hide-block-toggle-all):
* lisp/org-element.el:
* lisp/org-feed.el (org-feed-read-previous-status):
(org-feed-parse-rss-feed):
(org-feed-parse-rss-entry):
* lisp/ox-org.el (org-org-publish-to-org):
* testing/lisp/test-ob-tangle.el:
* lisp/org.el (org-block-regexp):
(org-clock-drawer-re): Use \(.\|\n\) regexp instead of [^\000].
(org-latex-regexps): Do not try to match \000 inside latex fragments -
we now use parser for this purpose.

Reported-by: Tommy Kelly <tommy.kelly@verilab.com>
Link: https://orgmode.org/list/875yfk9vlv.fsf@localhost
2023-04-25 21:06:50 +02:00
Zelphir Kaltstahl d97ba5ba52
org-babel-expand-body:scheme: define header arg vars using define
* ob-scheme.el (org-babel-expand-body:scheme,
org-babel-expand-header-arg-vars:scheme): Change the way header
argument :var variables are expanded for for Scheme source blocks.  Use
`define' instead of wrapping using `let'.

Wrapping binding definitions using `let' can lead to issues with GNU
Guile and potentially other Scheme dialects.  GNU Guile will only get
to the body of the let at evaluation time, not at macro expansion
time.  If the let form wraps any imports of libraries that define
macros, then those imported macros are seen too late and their
corresponding forms inside the body of the let are not
expanded.  Using `define' to define bindings avoids this problem, at
least in GNU Guile.

For more context see the mailing list discussion at: https://lists.gnu.org/archive/html/emacs-orgmode/2023-03/msg00087.html

TINYCHANGE
2023-04-25 14:25:30 +02:00
Ihor Radchenko e065b53a4a
Merge branch 'bugfix' 2023-04-24 14:27:42 +02:00
Eli Zaretskii 8eb209984e
Backport commit 62e4eb8fcf7 from Emacs
Fix build when Org's version changes

* lisp/org/org-macs.el (org--inhibit-version-check): Rename from
'org--built-in-p' and make it a defvar.  All users changed.
(Bug#62762)

62e4eb8fcf71a852117b372809bd4a7953f9b679
Eli Zaretskii
Mon Apr 24 14:16:05 2023 +0300
2023-04-24 14:24:27 +02:00
Ihor Radchenko 56f651e961
org-lint: Add new linter for empty header arguments
* lisp/org-lint.el (org-lint-empty-header-argument):
(empty-header-argument): New linter.
2023-04-24 14:01:12 +02:00
Ihor Radchenko 6376237779
org-babel-parse-multiple-vars: Do no err on empty :var
* lisp/ob-core.el (org-babel-parse-multiple-vars): Parse empty :var
header argument into (:var) alist element.
2023-04-24 14:00:49 +02:00
Ihor Radchenko 9030cc394d
Merge branch 'bugfix' 2023-04-23 16:48:52 +02:00
Ihor Radchenko 92f9135b3c
org-open-at-point: Fix opening multiple file links
* lisp/org.el (org-open-at-point): Keep link selection buffer current
when looping over links to be opened.  Otherwise, opening a link might
change current buffer, breaking the code logic.

Reported-by: cro cefisso <crocefisso@gmx.com>
Link: https://orgmode.org/list/trinity-3a7c01d2-99d9-4b8a-b317-d62c02d75e72-1682242700508@3c-app-mailcom-bs02
2023-04-23 16:47:02 +02:00
Ihor Radchenko 466a37d089
Merge branch 'bugfix' 2023-04-22 15:29:08 +02:00
Ruijie Yu 14dccff8b3
* lisp/org.el org-latex-packages-alist: fixed type definition 2023-04-22 15:25:04 +02:00
Ihor Radchenko f81ba451a7
Prefer "backend" over "back-end"
* doc/org-manual.org (Exporting): Add cindex entry for both "backend"
and "back-end" for better searchability.

All other changes are trivial.

Note that `org-element-export-snippet-parser' will still use :back-end
property.  So will ox.el in INFO channel.
2023-04-20 14:11:19 +02:00
Ihor Radchenko 9440a29828
Merge branch 'bugfix' 2023-04-20 11:05:12 +02:00
Ihor Radchenko 27ee55ebfd
ox-latex: Fix << and >> in verbatim and code markup
* lisp/ox-latex.el (org-latex--protect-texttt): Protect "<<" and ">>"
sequences.

Reported-by: Garid Z. <garidzorigoo@gmail.com>
Link: https://orgmode.org/list/871qkhtb4o.fsf@gmail.com
2023-04-20 11:03:17 +02:00
Ihor Radchenko 264d555e4b
org-org-publish-to-org: Handle fixme
* lisp/ox-org.el (org-org-publish-to-org): Remove setting buffer
modification status.

There is no clear reason why it should be done and none of the tests
are failing without this statement.  Can be re-added if a real problem
is encountered, with appropriate explanation in the comment.
2023-04-20 10:45:05 +02:00
Ihor Radchenko 3c449cc438
* testing/lisp/test-ob-R.el (ob-session-R-result-value): New test 2023-04-18 15:04:57 +02:00
Ihor Radchenko 83e446ea86
* testing/lisp/test-ob-R.el: Fix test failures with the newest ESS
(ob-session-async-R-simple-session-async-output):
(ob-session-async-R-named-output):
(ob-session-async-R-output-drawer): Force no truncation of output
lines in ESS.  Otherwise, the expected output may be split into
multiple lines.

Note that we do not want to override the output splitting outside
tests - this is what users may prefer for :results output.  And
:results value is not affected.

Link: https://orgmode.org/list/87ilduqrem.fsf@localhost
2023-04-18 15:04:47 +02:00
Ihor Radchenko 4929f0c55f
* lisp/ob-R.el: Fix ESS compatibility
(org-babel-R-initiate-session): Fix `require'.  Do not use obsolete
`R' function.
2023-04-17 20:20:58 +02:00
Ihor Radchenko 2ebc518675
* lisp/ob-R.el: Fix ESS compatibility
(org-babel-R-initiate-session): Fix `require'.  Do not use obsolete
`R' function.
2023-04-17 20:17:55 +02:00
Matthew Trzcinski 26ef5e3e5b org-src: Use `sh-mode' for all the shells it can handle
* lisp/org-src.el (org-src--get-known-shells): New helper function
extracting known shells from `sh-ancestor-alist'
(org-src-lang-modes): Update the value

Link: https://orgmode.org/list/CAMbmz5ntkOHMiZG4EbNAks9ob-0ahnciCfHQ9LQmJoci0+i7fg@mail.gmail.com
2023-04-17 10:57:35 -04:00
Ihor Radchenko cfe5e01e14
org-lint: Add checker for $...$ LaTeX fragments
* lisp/org-lint.el (org-lint-LaTeX-$): New checker warning about
semi-obsolete $...$ LaTeX fragment syntax.

Link: https://orgmode.org/list/86ileukojk.fsf@lan
2023-04-17 16:00:41 +02:00
Ihor Radchenko ab85c1b958
org-fold: Allow customizing commands where invisible edits are checked
* lisp/org-fold.el (org-fold-catch-invisible-edits-commands): New
custom option.
(org-fold-catch-invisible-edits): Mention the new custom option in the
docstring.
(org-fold-check-before-invisible-edit-maybe): New function checking
if edits are safe for `this-command'.
(org-fold--advice-edit-commands): New function advising the functions
with `org-fold-check-before-invisible-edit-maybe'.
* lisp/org.el (org-mode): Advice functions on Org startup.
(org-self-insert-command):
(org-delete-backward-char):
(org-delete-char):
(org-meta-return): Do not call `org-fold-check-before-invisible-edit'
and rely on the new advise mechanism instead.
* etc/ORG-NEWS (Commands affected by ~org-fold-catch-invisible-edits~
can now be customized): Announce the change.
* doc/org-manual.org (Catching invisible edits): Mention new
customization.
2023-04-17 15:32:20 +02:00
Ihor Radchenko d4b66e99fd
Merge branch 'bugfix' 2023-04-17 13:12:22 +02:00
Ihor Radchenko 7d8a9324f8
org-babel-js-function-wrapper: Fix when the last line is a comment
* lisp/ob-js.el (org-babel-js-function-wrapper): Ensure that last line
of the body being comment does not shadow the closing parenthesis.

Reported-by: sgherdao@tuta.io
Link: https://orgmode.org/list/NT8rSmu--F-9@tutanota.com
2023-04-17 13:10:10 +02:00
Ihor Radchenko 425f379458
Merge branch 'bugfix' 2023-04-17 12:48:10 +02:00
Ihor Radchenko c827341dfb
org-cite-activate: Ensure that we keep the correct match-data
* lisp/oc.el (org-cite-activate): Discard match data set by activate
function.  We already move the point after citation by force, so can
as well ensure that match-data remain accurate for later font-lock
use.

Reported-by: Lin Jian <me@linj.tech>
Link: https://orgmode.org/list/87sfczztg6.fsf@linj.tech
2023-04-17 12:45:07 +02:00
Ihor Radchenko 62996300ef
org-manual.org: Clarify the ox-md uses the original markdown spec
* doc/org-manual.org (Markdown Export): Make it more clear that we are
using the original Markdown spec.  Link to Wikipedia article
describing different Markdown favours.
2023-04-16 17:35:15 +02:00
Ihor Radchenko d57d90964f
Merge branch 'bugfix' 2023-04-16 13:55:39 +02:00
Ihor Radchenko 0f6ae7296e
org-agenda-dim-blocked-tasks: Fix when the value is 'invisible
* lisp/org.el (org-blocked-by-checkboxes): Declare as dynamically
scoped variable.

Reported-by: Gautier Ponsinet <gautier@gautierponsinet.xyz>
Link: https://orgmode.org/list/875y9wrvv1.fsf@gautierponsinet.xyz
2023-04-16 13:53:56 +02:00
Ihor Radchenko 81acba727a
Merge branch 'bugfix' 2023-04-16 13:21:07 +02:00
Ihor Radchenko a8a95b6c2c
* lisp/org-agenda.el: Do not modify string constant " "
(org-agenda-highlight-todo): Use `propertize' that copies the argument
string instead of `org-add-props'.  Otherwise, if the compiler
optimizes string constants into a single object, the properties may
populate in unexpected places.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/CAM9ALR95F_ZHV2_WsqAz0-35-S2rwxbHqsA5VGftvq51Yz3ZAQ@mail.gmail.com
2023-04-16 13:18:42 +02:00
Jack Kamm f4446ce795 ox-icalendar: Apply folding to whole VCALENDAR
Moves the calls to `org-icalendar-fold-string' out of
`org-icalendar--vevent' and `org-icalendar--vtodo', instead calling it
from `org-icalendar--vcalendar'.  This way, the string folding applies
to the entire VCALENDAR rather than just the VEVENT or VTODO, as
required by the iCalendar spec.

See also:
https://list.orgmode.org/m2pm85jyw1.fsf@eglen.org.uk/T/#md08cfd0209f6332a1a0c6a54f08544006ff93aed

* lisp/ox-icalendar.el (org-icalendar--vevent, org-icalendar--vtodo):
Remove call to `org-icalendar-fold-string'.
(org-icalendar--vcalendar): Add call to `org-icalendar-fold-string'.
2023-04-15 21:47:58 -07:00
Ihor Radchenko f1fd1f22f4
Update version number for the 9.6.4 release 2023-04-15 13:53:24 +02:00
Ihor Radchenko 07508fb097
org-assert-version: Skip version check when Org is a part of Emacs
* lisp/org-macs.el (org--built-in-p): New constant indicating if Org
source is a part of Emacs source tree.
(org-assert-version): Skip check when Org is built-in.
2023-04-15 13:50:42 +02:00
Ihor Radchenko 7c8623be96
fixup! * doc/org-manual.org: Clarify "++" explanation for habits 2023-04-14 15:48:52 +02:00
Ihor Radchenko 8f058060ce
* doc/org-manual.org: Clarify "++" explanation for habits
(Tracking your habits): Do not create a confusion that one can use
"++" to make a habit repeat on weekdays/weekends.  Instead, make it
explicit that "++" can only keep certain day of week.  Also, link to
the repeater intervals section.
2023-04-14 15:46:37 +02:00
Ihor Radchenko 9607226610
org-export--prune-tree: Ensure spaces when removing objects
* lisp/ox.el (org-export--prune-tree): If the removed object has
trailing spaces and previous object does not have, keep the trailing
spaces.
* etc/ORG-NEWS (Blank lines after removed objects are not retained
during export): Document the change.

Reported-by: Andrea Lazzarini <andrea.lazzarini1@gmail.com>
Link: https://orgmode.org/list/87o7p7z9k3.fsf@localhost
2023-04-14 13:46:22 +02:00
TEC 5b300edf2e
etc/ORG-NEWS: Mention the new \P entity 2023-04-13 09:09:05 +02:00
TEC 00abdca361
oc-csl: Recognise ¶/§ entity locators
* lisp/oc-csl.el: Recognise org-entity based paragraph and section
locators "\P" and "\S".
2023-04-13 09:02:58 +02:00
TEC 0f62e9771b
org-entities: Treat ¶ similarly to §
* lisp/org-entities.el: Treat pilcrows / paragraph symbols similarly to
section symbols (§), move them next to each other and add a \P entity.
2023-04-13 09:02:58 +02:00
TEC cd53816c3a
org-entities: § is a section sign, not paragraph
* lisp/org-entities.el: Correct the ASCII version of § to be "section",
not "paragraph".
2023-04-13 09:02:57 +02:00