* lisp/org-element.el (org-element--cache-self-verify): Switch to nil
by default, disabling costly cache self-verification. This is
relatively safe as no relevant bug reports have been submitted for a
while. Also, the most critical cache failures are still monitored.
* lisp/org.el (org-image-max-width): New custom variable controlling
max inline image width.
(org--create-inline-image): Use the new variable.
* doc/org-manual.org (Images):
* etc/ORG-NEWS (New customization ~org-image-max-width~ limiting the
displayed inline image width): Document the new variable.
* org-table.el (org-self-insert-command): Use `last-command-event'
instead of `last-input-event'. Using `last-input-event' causes
problems in the presence of `evil-escape'. Consider a buffer that has
`orgtbl-mode' enabled while evil-escape is in use. Assume the
evil-escape sequence is "fd". Typing "f RET" will instead insert "RET
RET" into the buffer, since `last-input-event' is "RET", but
`last-command-event' is "f".
TINYCHANGE
* lisp/org-habit.el (org-habit-get-priority): Rename to
`org-habit-get-urgency'.
* lisp/org-compat.el (org-habit-get-priority): Obsolete the old name.
* lisp/org-agenda.el (org-agenda-sorting-strategy):
* lisp/org-agenda.el (org-search-view):
(org-agenda-get-todos):
(org-agenda-get-timestamps):
(org-agenda-get-progress):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks):
(org-entries-lessp): Alter priority-up and priority-down sorting
strategies to only sort by actual priority. Rename the previous
composite sorting rank to urgency, corresponding to the new urgency-up
and urgency-down sorting strategies. Store the new rank in 'urgency
text property. Update the docstrings accordingly. Use `urgency-down'
in place of `priority-down' in the default sorting strategy.
(org-set-sorting-strategy): Use `urgency-down' in place of
`priority-down'.
* etc/ORG-NEWS ("Priority" used to sort items in agenda is renamed to
"urgency"): Document the change.
* doc/org-manual.org (Sorting of agenda items): Update manual using
"urgency" term in place of confusing "priority".
Thanks to Samuel Wales for the idea how to fix the inconsistency.
Reported-by: Jonas Olofsson <jonas.olofsson@apple.com>
Link: https://orgmode.org/list/26396316-1201-4D88-9D81-C87DDDA8885A@apple.com
* lisp/ox-html.el (org-html--id-attr-prefix):
* lisp/ox-odt.el (org-odt--id-attr-prefix): Refactor hardcoded "ID-"
as a new private variable.
* org/ox-html.el (org-html--reference): Add support for the ID
property (previously only supported CUSTOM_ID).
These changes make crossfile ID links work in the exported HTML when
`org-html-prefer-user-labels' is not-nil.
Fixes issue where the ox-icalendar export uses an inconsistent mix of
dos and unix style line endings.
* lisp/ox-icalendar.el (org-icalendar-fold-string): No longer converts
to CRLF, instead delegating that to `org-icalendar--post-process-file'.
(org-icalendar--post-process-file): New function to handle exported
file post-processing. Converts EOL to CRLF, and then runs
`org-icalendar-after-save-hook'.
(org-icalendar-export-to-ics, org-icalendar-export-current-agenda,
org-icalendar--combine-files): Call `org-icalendar--post-process-file'
instead of running `org-icalendar-after-save-hook' directly.
* testing/lisp/test-ox-icalendar.el: New file for unit tests of
ox-icalendar. Add an initial test for CRLF line endings.
See also:
https://list.orgmode.org/87o7oetneo.fsf@localhost/T/#m3e3eb80f9fc51ba75854b33ebfe9ecdefa2ded24https://list.orgmode.org/orgmode/87ilgljv6i.fsf@localhost/
* lisp/ob-exp.el (org-babel-exp-results): Display warning when babel
does not know how to execute exported code block and :results
demands results to be exported.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Do not use
`save-window-excursion'.
* lisp/ox.el (org-export-dispatch):
(org-export--dispatch-ui): Use `save-window-excursion' only when
displaying the dispatch interface.
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Allow fontifying
src blocks with language specification missing.
* lisp/org-src.el (org-src-block-faces): Clarify in the docstring that
"" language name referes to src blocks with no language. Remove
redundant :version tag.
* etc/ORG-NEWS (~org-src-block-faces~ now accepts empty string ~""~ as
language name): Announce the change.
Link: https://orgmode.org/list/99388ff3711696091f0312a5c3f0bcbd@kragelund.me
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use
non-interactive `insert-file-contents' + `write-region' to avoid
triggering various interactive hooks. Ensure that temp files are
always deleted.
* lisp/org-agenda.el (org-agenda-write):
* lisp/org-table.el: Simplify code using `write-region'.
* lisp/ox-odt.el (org-odt-template): Use `insert-file-contents' +
`write-region' instead of `find-file-noselect' that may trigger
various hooks. The new approach makes `revert-buffer' not
necessary (and do not trigger `revert-buffer' hooks). Also, the
problem with backups will no longer exists.
Original idea: https://list.orgmode.org/orgmode/20221002035931.12191-1-dafydd.lukes@gmail.com/
* lisp/ob-comint.el (org-babel-comint-with-output): Do not try to
filter out prompts in `comint-output-filter-functions'. The prompts
may arrive there arbitrarily - multiple prompts together, partial
prompts, full prompts, etc. For example "ghci> " prompt may arrive as
"gh" + "ci> " with second part still matching `comint-prompt-regexp'.
As a result, if we keep using `comint-output-filter-functions', the
split prompts may sometimes retain their initial part, littering the
results. Now, we postpone filtering to after receiving the output,
still making sure that agglomerated prompts gets filtered using a
custom regexp derived from `comint-prompt-regexp'.
* lisp/ob-comint.el (org-babel-comint-with-output): Consider that
comint can sometimes agglomerate multiple prompts together even within
a single output increment as passed to
`comint-output-filter-functions'.
Example in GHC comint buffer:
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> ghci> :{
main :: IO ()
main = putStrLn "Hello World!"
:}
main
"org-babel-haskell-eoe"
ghci| ghci| ghci| ghci> ghci> Hello World!
ghci> "org-babel-haskell-eoe"
ghci>
* lisp/ob-python.el (python-shell-buffer-name): Remove unneeded
defvar.
(org-babel-python-initiate-session-by-key): Check if session already
existed before run-python. Only wait for initialization if it's a
newly started session. Also simplify the code a bit by combining
multiple setq and let statements into a single let statement. Also
add a comment about why adding to `python-shell-first-prompt-hook'
after `run-python' should be safe from race conditions.
* lisp/org.el (org-remove-timestamp-with-keyword): Use `delete-char'
instead of for-interactive-use-only `backward-delete-char'.
(org-fast-tag-selection): Remove unnecessary `condition-case'.
(org-delete-backward-char): Make it explicit that we fall back to
normal interactive call.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62518
* lisp/org-macs.el (org-sxhash-safe): New function to calculate object
hashes. Unlike `sxhash', the new function ensures that
if (= (org-sxhash-safe A) (org-sxhash-safe b)) then (equal A B)
Not just the opposite.
* lisp/ob-core.el (org-babel-temp-stable-file): Use the new function.
Reported-by: Thomas Worthington <thomas.worthington@cosector.com>
Link: https://orgmode.org/list/877cwrcdh2.fsf@localhost
* lisp/org-fold.el (org-fold-show-children): Clarify the docstring
emphasizing that direct children are always displayed. Fix
grandchildren being displayed when the first child has deeper level
than the next children.
* lisp/ob-comint.el (org-babel-comint-with-output): Do not try to
filter out prompts in `comint-output-filter-functions'. The prompts
may arrive there arbitrarily - multiple prompts together, partial
prompts, full prompts, etc. For example "ghci> " prompt may arrive as
"gh" + "ci> " with second part still matching `comint-prompt-regexp'.
As a result, if we keep using `comint-output-filter-functions', the
split prompts may sometimes retain their initial part, littering the
results. Now, we postpone filtering to after receiving the output,
still making sure that agglomerated prompts gets filtered using a
custom regexp derived from `comint-prompt-regexp'.
* lisp/ob-comint.el (org-babel-comint-with-output): Consider that
comint can sometimes agglomerate multiple prompts together even within
a single output increment as passed to
`comint-output-filter-functions'.
Example in GHC comint buffer:
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> ghci> :{
main :: IO ()
main = putStrLn "Hello World!"
:}
main
"org-babel-haskell-eoe"
ghci| ghci| ghci| ghci> ghci> Hello World!
ghci> "org-babel-haskell-eoe"
ghci>
* lisp/org-clock.el (org-logind-dbus-session-path): Do not try to use
dbus when `dbus-call-method' errs.
`dbus-call-method' may throw
Debugger entered--Lisp error: (dbus-error "org.freedesktop.login1.NoSessionForPID" "PID 7361 does not belong to any known session")
Do not try to use dbus method in such scenario.
Link: https://builds.sr.ht/~bzg/job/961763
* lisp/org.el (org-at-date-range-p):
(org--math-p):
(org-first-sibling-p): Remove interactive spec.
Predicates like `org-first-sibling-p' are no use when called
interactively, and should not appear in the M-x prompt.
TINYCHANGE
* lisp/org-timer.el (org-logind-dbus-session-path): New variable.
(org-logind-user-idle-seconds): New function.
(org-user-idle-seconds): Use them.
* etc/ORG-NEWS (Add support for ~logind~ idle time in
~org-user-idle-seconds~): Document the new feature.
* ob-shell.el (org-babel-sh-evaluate): Add condition for async within
session. Allow :async header argument to be either t or blank.
* test-ob-shell.el:
(test-ob-shell/session-async-valid-header-arg-values): Check that
:async header works for both t and blank values.
(test-ob-shell/session-async-inserts-uuid-before-results-are-returned):
Check that UUID is used as placeholder until results return.
(test-ob-shell/session-async-evaluation): Check that asynchronously
evaluated results are eventually placed in the buffer.
Link: https://list.orgmode.org/186283d230a.129f5feb61660123.3289004102603503414@excalamus.com/
* ob-R.el (ob-session-async-org-babel-R-evaluate-session): Use
`org-id-uuid' instead of `md5' as results placeholder.
* ob-python.el (org-babel-python-async-evaluate-session): Use
`org-id-uuid' instead of `md5' as results placeholder.
* org-id.el (org-id-uuid): Move to org-macs.el.
* org.el (org-uuidgen-p): Move to org-macs.el. Expose regexp used to
match UUID.
* org-macs.el (org-uuid-regexp): Refactor `org-uuidgen-p' to expose
regexp used to match UUID.
* lisp/org-element.el (org-element-headline-parser): Allow empty title
with tags. Do not consider space after COMMENT to be a part of title.
*
testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
Add tests.
Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/87zg8t4zgo.fsf@localhost
* lisp/org-element.el (org-element-headline-parser): Allow end of line
instead of space after todo keyword.
*
testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
Add new test.
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Consider
compilation error as indication that math is not supported. texinfo
compiler throws "unknown command `displaymath'" error in such case,
causing `org-texinfo-compile' to err as well.
Fixes CI tests failures when testing with Texinfo versions with no
math support.
https://builds.sr.ht/~bzg/job/959487
* lisp/org-agenda.el (org-agenda-run-series): Fix arguments in the
call. "agenda*" should include appointments and thus HOURS argument
should be non-nil. See `org-agenda' for analogous call.
* lisp/ob-clojure.el (org-babel-clojure-backend): Add support for
clojure-cli.
* lisp/ob-clojure.el (org-babel-clojurescript-backend): Move nbb to
clojurescript.
* lisp/ob-clojure.el (org-babel-expand-body:clojure)
* lisp/ob-clojure.el (ob-clojure-eval-with-cider): Return only the
last expression when :results is not set or value, and return only
stdout when :results is set to output.
* lisp/ob-clojure.el (ob-clojure-eval-with-cmd): Rename function as
it is not only for babashka.
* lisp/ob-clojure.el (org-babel-execute:clojure): Differentiate
between Clojure and ClojureScript source blocks.
The problem was that the ob-clojure results where not correctly
taking the results parameter into account.
E.g. with the cider backend, you would get all printed or returned
values for each line in your block:
(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)
| #'user/small-map |
| {:some :map} |
| 4 |
or for babashka you would only get the printed values but not the
last return value:
(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)
: :xx
Now when you specify :results value, the result is only the last
returned value, and with :results output you get all values
printed to stdout.
So the examples above would all result in the same:
(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)
: 4
* lisp/ox-latex.el (org-latex-paragraph): If export creates single
paragraph contents with empty lines, remove the empty lines to ensure
that we retain a single paragraph.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tufdb6$11h2$1@ciao.gmane.io
* org-agenda.el (org-prepare-agenda): Don't reset
`org-todo-keywords-for-agenda' when org-agenda-multi.
Fixes a bug with TODO keywords that came to light in org-modern,
see https://github.com/minad/org-modern/issues/26.
This is very similar to cd2d138883,
which fixed the same for `org-done-keywords-for-agenda` (to fix
a similar styling issue).
TINYCHANGE
* lisp/org.el (org-read-date): When DEFAULT-TIME time provided, prefer
it even when `org-extend-today-until' dictates -1 day shift. We
should only consider `org-extend-today-until' for actual today times,
not for future dates, where is becomes confusing.
Reported-by: Tim Ruffing <crypto@timruffing.de>
Link: https://orgmode.org/list/3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de
* lisp/org-clock.el (org-clock-get-clock-string): End the mode line
element in a space, instead of beginning with space, to make it play
well with other mode line strings, which typically end a space. For
reference, see the mode line string of the Display Time mode.
* lisp/org-element.el (org-element-set-contents): Do alter anonymous
elements (el1 el2 ...). Such elements are used, for example, when
parsing keyword values during export, like :title.
* testing/lisp/test-org-element.el (test-org-element/set-contents):
Add test.
The patch fixed bug during export when exporting a subtree with
option stat:nil. The :title during subtree export is taken from the
heading title and parsed. However, the parsed value is stored outside
the parse tree, in :title property of the INFO channel. The parsed
value does get filtered through `org-export--prune-tree', but before
this commit, `org-element-set-contents' did not actually alter the
out-of-AST-tree parent lists of elements.
Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/87mt4w8epo.fsf@t14.reltub.ca
* lisp/org.el (org-babel-load-languages): Sync with Babel files
(org-babel-load-languages): Synchronize the defcustom with the rest of
the code base, group languages by Org Babel file, and spell languages
using camel case (the current fashion).
Link: https://list.orgmode.org/712f2ef5b4edb2d9b565f6467e582030@posteo.net/
* lisp/org.el (org-file-contents): Wrap the
`url-retrieve-synchronously' call into a `condition-case' block to
avoid throwing an error when NOERROR is non-nil.
TINYCHANGE
* lisp/ob-table.el (org-sbe): Allow quoting string values of variables
with "$". Update the docstring.
* testing/lisp/test-ob-table.el (test-ob-table/sbe): Add test. Do not
use `org-test-at-id' in favor of more illustrative
`org-test-with-temp-text'. The latter does not force users to search
the ID in reference Org file.
* testing/examples/babel.org (calling code blocks from inside table):
Remove unused example.
Reported-by: 赵一宇 <zhyznd@163.com>
Link: https://orgmode.org/list/40651be0.3e3b.1867971e644.Coremail.zhyznd@163.com
* lisp/oc-natbib.el (org-cite-natbib-bibliography-style): New custom
option for default bibliography style.
(org-cite-natbib-export-bibliography): Use the new custom option.
* etc/ORG-NEWS (New ~org-cite-natbib-export-bibliography~ option
defining fallback bibliography style): Document the new option.
If we do not specify a bibliography style, LaTeX export will fail.
After the patch, the following simple-minded Org document will export
without errors:
#+title: Testing org-cite \LaTeX export
#+latex_header: \usepackage{natbib}
#+bibliography: bibliography.bib
#+options: toc:nil
#+cite_export: natbib
Hello World! This is a citation: [cite:@citationkey2023]
#+print_bibliography:
* lisp/org-cycle.el (org-cycle-set-startup-visibility): Recognize
`org-startup-folded' set to symbols `fold', `nofold', and `showall'.
They are used as #+STARTUP: option and often tried blindly by users.
* lisp/org-fold-core.el (org-fold-core-next-visibility-change): Take
into account that `previous-single-char-property-change' move the
point to the first position where the property is still unchanged.
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Ignore invisibility when skipping subtree.
Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
Link: https://orgmode.org/list/96becf12-9a5a-2fc2-0105-a41528be1f66@gmail.com
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/org-agenda.el (org-agenda-format-item):
* lisp/org-element.el (org-element-cache-map): Do not use `eq' when
matching for equality by contents.
* lisp/ox.el (org-export--annotate-info, org-export-as): Separate out
the info-collection phase of `org-export-as' into a new function,
`org-export--annotate-info'.
* lisp/org-compat.el (version<): Use stub version of
`combine-change-calls' when it does not exist yet in Emacs or when it
is known to have a critical bug. Use `org-combine-change-calls'
instead of overwriting the macro system-wide.
* lisp/org-footnote.el (org-footnote-sort):
* lisp/org.el:
(org-demote-subtree):
(org-paste-subtree): Use the new macro name.
Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/87ilhq74j8.fsf@localhost
* ox-beamer.el (org-beamer-environments-default): add label escape to
some environments
(org-beamer--format-block): generate label string for label escape
(org-beamer-environments-extra): document label escape
A new escape %l is available to be used in `org-beamer-environments-*'
to insert the label of the current block, obtained using
`org-babel--get-label'
* org-agenda.el (org--batch-store-agenda-views): Fix treatment of
lambda functions used as custom agenda commands.
`org-agenda-custom-commands' entries may specify a custom function
instead of a symbol like `tags-todo'. `org--batch-store-agenda-views'
behaved differently from `org-agenda' when that custom function was
defined as a lambda rather than a symbol, incorrectly treating the
lambda form as a list of agenda commands. Instead, use the same test
as `org-agenda' does to determine whether the command is a series.
TINYCHANGE
* lisp/org-list.el (org-list-indent-item-generic):
* lisp/org.el (org-do-promote):
(org-do-demote): Do not deactivate mark after edits.
(org-metadown):
(org-metaup): Do not deactivate mark and do not exchange point and
mark in region.
* etc/ORG-NEWS (Datetree structure headlines can now be complex):
Announce the change.
* lisp/org.el (org-metaup):
(org-metadown): When active region contains headings, move the
containing subtrees according to the selection. Do not deactive
region.
* testing/lisp/test-org.el (test-org/move-subtree): Add test.
* etc/ORG-NEWS (~org-metaup~ and ~org-metadown~ now act on headings in
region): Announce the new features.
* ob-sql.el (org-babel-find-db-connection-param): read
sql-connection-alist like sql.el/sql-connect and allow strings.
Signed-off-by: Andreas Gerler <baron@bundesbrandschatzamt.de>
* lisp/org-element.el: Query cache variables from the base buffer.
They are only kept up-to-date there.
* testing/lisp/test-org.el (test-org/map-entries): Add test.
Reported-by: Hanno Perrey <hanno@hoowl.se>
Link: https://orgmode.org/list/87pmau4fi3.fsf@hoowl.se
* org-attach.el (org-attach): Move cursor to the top of the
UI-description buffer.
This matters when the buffer does not fit completely in the window for
display. Without the change the user would see the bottom part.
* ob-sql.el (org-babel-find-db-connection-param): read
sql-connection-alist like sql.el/sql-connect and allow strings.
Signed-off-by: Andreas Gerler <baron@bundesbrandschatzamt.de>
* lisp/org-element.el (org-element-cache-map): Never map over element
starting before the point manually moved (or set via
`org-element-cache-map-continue-from') by FUNC.
* testing/lisp/test-org.el (test-org/map-entries): Add tests.
Reported-by: Matthieu Caneill <matt@brokenwa.re>
Link: https://orgmode.org/list/Y9MKUzWWbErLFhmq@brokenwa.re
* lisp/ob-python.el (org-babel-python-mode): Moved to ob-compat.el,
and changed to a constant.
(org-babel-python-initiate-session-by-key): Remove code to support
python-mode.el.
(org-babel-python-send-string): Renamed from
`org-babel-python--send-string', turning it into a public function to
accommodate ob-python-mode-mode which advises this function. Also,
remove some code for python-mode.el.
(org-babel-python-evaluate-session): Update calls to renamed function
`org-babel-python-send-string'.
* lisp/ob-compat.el (org-babel-python-mode): Moved from ob-python.el,
and changed to a constant.
* lisp/org-clock.el (org-clock-x11idle-program-name): Change the
default value to "xprintidle" when its executable is available.
Fallback to previous default otherwise. Update :package-version and
remove :version tags.
* etc/ORG-NEWS (New and changed options):
(~org-clock-x11idle-program-name~ now defaults to =xprintidle=, when available):
Document the change.
Link: https://orgmode.org/list/874jvkn1po.fsf@localhost
* lisp/org-macs.el (org-assert-version): Explicitly state that Org
loading is aborted. Some users otherwise assume that the warning can
be ignored. Also, remove sentence about `load-path' as it is
explained later in the warning text.
* lisp/org.el (org-update-dblock): Clarify that `org-update-dblock' is
called for side effects.
Reported-by: Marcin Borkowski <mbork@mbork.pl>
Link: https://orgmode.org/list/87sfg1nfii.fsf@mbork.pl
* lisp/org-agenda.el (org-fix-agenda-info): Do not use `string-pad'
that is only available since Emacs 28. Instead, use the expression
used as default value of `calendar-iso-date-display-form'.
Reported-by: Aaron L. Zeng <me@bcc32.com>
Link: https://orgmode.org/list/20230124025259.1301063-1-me@bcc32.com
* lisp/ox.el (org-export-parse-include-value): The current indentation
is used for expansion in `org-export--blindly-expand-include' (and
handled there). It is not used during #+include keyword parsing.
* lisp/ox-html.el (org-html-src-block): Do not treat src blocks
without LANG as example blocks. Instead, export them using "nil"
language. This way, such src blocks will get captions, unlike example
blocks.
The new behavior is consistent with ox-latex and ox-ascii.
Reported-by: Johan Bolmsjö <org-mode@johan.bitmaster.se>
Link: https://orgmode.org/list/87zgb90win.fsf@localhost
* lisp/org-persist.el: Bind pp-use-max-width to silence byte-compiler
warning about unused lexical variable.
Note that loading pp.el upfront rather than relying on the pp function
being autoloaded would also eliminate the warning, but that would only
work on Emacs 29 or later because earlier versions do not have the
pp-use-max-width option.
; Fix typos
920a7d38e96134289393b7bfcc3a7b88be73925b
Stefan Kangas
Sun Jan 15 02:14:19 2023 +0100
[km] These were likely not typos but intended as an abbreviation for
"if and only if". However, using "if" works fine in these spots,
so let's just go along with the change. (These may end up being
reverted on Emacs's side; see emacs-devel
<83a62k72lx.fsf@gnu.org>, 01-15.)
* lisp/ox.el (org-export-parse-include-value): Since the example
environment regexp does not contain a capture group, we can not assume
we can call `replace-match' on the first capture group. Before doing
so, check that the capture group indeed exists.
* lisp/org.el (org-place-formula-image, org-format-latex): Extract the
overlay placement component of `org-format-latex' into a new function
`org-place-formula-image`.
* lisp/org-macs.el (org-compile-file, org-compile-file-commands):
Pull out the logic transforming process descriptions to commands to be
executed into a new function, `org-compile-file-commands'.
`org-compile-file' is now solely concerned with running the commands and
reporting the result.
* lisp/org-persist.el (org-persist--write-elisp-file,
org-persist--read-elisp-file): Instead of letting `find-auto-coding' be
invoked to determine the coding for org-persist cache files (which can
be surprisingly expensive), we simply set utf-8 coding when
reading/writing.
* lisp/org-persist.el (org-persist--write-elisp-file): For the reasons
mentioned in the large code comment, it simply does not make much sense
to use fsync when writing cache files.
The value of fsync in general on modern hardware seems questionable,
particularly with CoW filesystems which take care of the problem better
than it seems fsync ever could.
* lisp/ox.el (org-export-parse-include-value): Adjust the block matches
not to match keywords (i.e. ":\S-+"), and both block and env to consume
their matches in value. Now value only contains the unmatched content,
which is given in as the results plist as :unmatched.
* lisp/ox.el (org-export-expand-include-keyword): Split the parsing and
inclusion logic of the ~150 line `org-export-expand-include-keyword'
into two new functions: `org-export-parse-include-value' and
`org-export--blindly-expand-include'.
* lisp/org-element.el (org-element--cache-sync): Add new optional
argument FORCE to force cache synchronization even when
`org-element--cache-active-p' returns non-nil. Update commentary
explaining why `org-element--cache-active-p' needs to be checked.
(org-element--cache-submit-request): Force cache synchronization. We
are safe to force it as all the callers of
`org-element--cache-submit-request' do check that cache is active.
This fixes an edge case when Org buffer has transient indirect buffers
with `after-change-functions' not being setup. If a change happens in
the main Org buffer, `org-element--cache-after-change' gets called and
cache request is processed even though (org-element--cache-active-p),
but not (org-element--cache-active-p t), returns nil (due to the
indirect buffer).
Before this commit, `org-element--cache-submit-request' called by
`org-element--cache-after-change' missed cache synchronization, as
`org-element--cache-sync' did nothing. As a result, if the indirect
buffer would get deleted, we would end up with incorrect cache state.
Reported-by: Gregor Zattler <telegraph@gmx.net>
* lisp/org-capture.el (org-capture-finalize): Do not save the newly
created file buffer when the capture is aborted and org-capture is not
asked to save upon capture.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
* org-datetree.el (org-datetree--find-create): Add optional argument
MATCH-TITLE that controls whether to match REGEX-TEMPLATE against
heading title inside complex heading or to match REGEX-TEMPLATE
against the whole heading line.
* org-datetree.el (org-datetree--find-create-group,
org-datetree-find-iso-week-create): Allow finding a datetree with TODO
state, priority, tags, statistics cookies, or COMMENT keyword.
* testing/lisp/test-org-datetree.el
(test-org-datetree/find-date-create,
test-org-datetree/find-iso-week-create): Add tests for a datetree with
tags, TODO or priority keywords.
* etc/ORG-NEWS (Datetree structure headlines can now be complex):
Document the change.
* doc/org-manual.org: Update datetree definition.
* etc/ORG-NEWS: Announce the introduction of the new face
`org-agenda-calendar-daterange'.
* lisp/org-faces.el: Define the face `org-agenda-calendar-daterange'.
* lisp/org-agenda.el (org-agenda-get-blocks): Apply the face
`org-agenda-calendar-daterange' to entries with a date range.
* lisp/org.el (org-notes-order-reversed-p): Return value is
org-reverse-note-order if it is neither nil or a list.
E.g. before nil has been returned when org-reverse-note-order was a
symbol. And this did not meet the documentation of
org-reverse-note-order.
* lisp/org.el (org-paste-subtree): Remove the whole line when level
indicator is provided. Improve check for level indicator.
* testing/lisp/test-org.el (test-org/paste-subtree): Add test.
Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
Link: https://orgmode.org/list/a2cc49d3-7f65-5f6a-8f05-21e5056335b3@gmail.com
* lisp/org-table.el (org-table-blank-field):
(org-table-clean-line): Avoid `org-string-width' modifying match data.
As long as `org-string-width' creates a new window buffer, third-party
modes and Emacs distributions might modify the match data in buffer
hooks. Hence, we cannot assume that match data is not modified even
though `org-string-width' code itself does not alter the match data.
Note: Adding `save-match-data' around function calls is generally a
good practice when the surrounding code relies on the match data being
intact. Elisp conventions don't prohibit functions to modify match
data without notice in their docstring.
Reported-by: Thomas Schneider <qsx@chaotikum.eu>
Link: https://orgmode.org/list/wwufsc7edzu.fsf@chaotikum.eu
* lisp/ob-core.el (org-babel-temporary-stable-directory): Use
`temporary-file-directory' variable instead of function. The function
returns value depending on the `default-directory' at Org startup time
thus creating unpredictable temporary babel locations that may
sometimes litter current directory.
Reported-by: bhrgunatha <bhrgunatha@gmail.com>
Link: https://orgmode.org/list/93b040e1-6dc6-487f-de89-a4cea9a560ff@gmail.com
Load org-element for agenda instead of relying on org-element being
loaded when agenda is ran.
Reported-by: zimoun <zimon.toutoune@gmail.com>
Link: https://orgmode.org/list/86r0vszn3w.fsf@gmail.com
* lisp/ox.el (org-export-expand-include-keyword): Add new optional
argument INCLUDER-FILE to explicitly pass the includer file path when
expanding inside a temporary buffer. Pass the INCLUDER-FILE later
during recursive expansion.
Reported-by: Gabriel Petrini da Silveira <gpetrinidasilveira@gmail.com>
Link: https://orgmode.org/list/CAHCA-UvaqnegPYfpPcJCqiY8+dDoj0pfX0vDckUui-MCj3wq5A@mail.gmail.com
* doc/org-manual.org (Weekly/daily agenda):
* lisp/org-agenda.el (org-agenda-start-on-weekday):
(org-agenda-start-day): Document that `org-agenda-start-on-weekday'
takes precedence over `org-agenda-start-day' when agenda span is 7 or
14 days.
Reported-by: Eppo Math <eppolito.math@gmail.com>
Link: https://orgmode.org/list/878ri67plt.fsf@localhost
* lisp/org-fold-core.el (org-fold-core--isearch-show): Make sure that
the actual isearch match is revealed. This relies on undocumented
behavior of isearch that point is at the match when
'isearch-open-invisible is called.
(org-fold-core-region): Disable 'isearch-open-invisible-temporary
features when `org-fold-core-style' is 'overlays. This is to work
around the undocumented requirement of isearch to _not_ delete the
overlay passed to 'isearch-open-invisible-temporary function. Since
`org-fold-show-set-visibility' may destroy overlays arbitrarily, we
cannot currently support isearch `org-fold-show-context-detail' in
full.
Reported-by: Matt Lundin <mdl@imapmail.org>
Link: https://orgmode.org/list/87zgb6tk6h.fsf@localhost
* lisp/org.el (org-timestamp-change): Add FIXME comment to
re-implement the logic in future to avoid `save-excursion' markers
being moved to the end of timestamp.
* lisp/ob-shell.el (org-babel-shell-initialize): Refactor avoiding
`eval' runtime calls and assigning 'definition-name function symbol
property to assist Emacs help system with finding the definition.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60568#71
> One of the discussed features was displaying function source code right
> in *Help* buffers. This feature usefulness have been objected at that
> time, on the grounds that showing function code may be too long and
> cause large *Help* buffers.
FWIW, I find myself regularly jumping to `M-x ielm` to look at the
`symbol-function`, so I would actually appreciate a button in the *Help*
buffer to display the actual value in the `symbol-function` slot.
This would also bring `describe-function` a bit closer to
`describe-variable`, which I think is good.
> 1. emacs -Q
> 2. M-: (require 'ob-shell)
> 3. <F1> f org-babel-execute:sh <RET>
> 4. Click on the source code link in *Help* buffer
> 5. Observe point jumping to (point-min) with no obvious way to find the
> function definition.
We have `definition-name` for that.
I.e. `org-babel-shell-initialize` should arguably do
(put 'org-babel-execute:sh 'definition-name 'org-babel-shell-initialize)
so that step 4 above jumps to `org-babel-shell-initialize`.
The patch below does that, along with saving some kittens.
Stefan
* lisp/org-refile.el (org-refile): Use dedicated marker (move after
insertion) to store position of the heading being refiled. Otherwise,
if refiled heading is inserted at the same point, `save-excursion'
would restore point before the inserted heading instead of keeping it
at the original heading.
* testing/lisp/test-org.el (test-org/refile): At test.
Reported-by: /u/madclassix
* lisp/org-element.el (org-element-fixed-width-interpreter): Interpret
fixed-width element with :value "" as ":\n", not as empty string.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-interpreter):
Fixed the test.
The previous test, albeit intentionally asserting "" result, breaks
reversibility of parse-interpret sequence.
* lisp/org.el (org--math-always-on): Rename to `org--math-p' and only
override `texmathp' when current command is `cdlatex-math-symbol' or
when we are inside Org LaTeX math fragment. Only these two scenarios
are the places where `texmathp' may not work properly in Org files.
We must not return t outside latex fragments as initially suggested by
the docstring because it would break, for example, `cdlatex-dollar'
command.
(org-cdlatex-mode): Use the new function name for advice.
* lisp/org-compat.el (org--math-always-on): Declare obsolete.
Reported-by: Daniel Fleischer <danflscr@gmail.com>
Link: https://orgmode.org/list/m2cz7sj5zt.fsf@gmail.com
* lisp/ob-shell.el (org-babel-shell-initialize): Do not search shell
name string by `eq' in `org-babel-shell-set-prompt-commands' alist.
Use `assoc' that is comparing by `equal' instead.
Reported-by: Matt <matt@excalamus.com>
Link: https://orgmode.org/list/87h6x8kluc.fsf@localhost
* lisp/org-persist.el (org-persist-unregister): Do not try to
normalize 'all ASSOCIATED. It is not a valid association that should
be handled specially. Previously, an error was thrown.
* lisp/org-persist.el (org-persist-unregister): Add new optional key
:remove-related to remove all the containers stored alongside with
CONTAINER in addition to CONTAINER itself. Update to docstring.
This reverts commit 10e857d428.
* lisp/ob-core.el:
(org-babel-merge-params):
(org-babel-process-params):
(org-babel-read):
* lisp/org-table.el: Add FIXME comments to places where arbitrary code
execution may happen.
The extra query is reverted until we develop a better code execution
safety system for Org. The commit introduced too many user queries,
making the whole idea of asking users to execute code from Org files
not useful.
Link: https://orgmode.org/list/878rinadlq.fsf@localhost
* lisp/org.el (org-mode): Do not suppress modification hooks when
aligning tables. Otherwise, cache state may become invalid.
Reported-by: Stefan <org@stefan.failing.systems>
Link: https://orgmode.org/list/87tu1wse45.fsf@localhost
* lisp/org-macs.el (org-assert-version): Make quoting "'" in the
message more readable.
Thanks to Stefan Monnier <monnier@iro.umontreal.ca> for the
suggestion.
* lisp/org-persist.el (org-persist-register): Document that MISC must
be a plist.
(org-persist--get-collection): Throw an error when MISC is not a
plist. Fix arglist - MISC is now passed explicitly as a single
object.
(org-persist--storage-version): Bump version to avoid obsolete
malformed containers with improperly included MISC.
* lisp/oc-csl.el (org-cite-csl--output-format): Use the dedicated
'org-latex' citeproc formatter to export references in LaTeX.
(org-cite-csl-latex-preamble, org-cite-csl--generate-latex-preamble,
org-cite-csl-finalizer): Insert a preamble fragment compatible with
the 'org-latex' citeproc formatter.
(org-cite-csl-latex-label-separator,
org-cite-csl-latex-label-width-per-char): Introduce additional
variables to control bibliography formatting.
* etc/ORG-NEWS: Describe the introduced new options.
* lisp/org-keys.el (or): Add alternative terminal binding for
`org-insert-structure-template'. The default binding may not be
available in some terminals.
* doc/org-manual.org (Using Org on a TTY): List the new binding in the
manual.
Reported-by: Anthony Carrico <acarrico@memebeam.org>
Link: https://orgmode.org/list/d9222967-5747-bf54-8041-4a8453fe81fc@memebeam.org
* lisp/oc-basic.el (org-cite-basic--format-author-year):
(org-cite-basic-export-citation): Display "????" for missing year and
"??" for missing other fields.
Reported-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://orgmode.org/list/871qr6kiuv.fsf@localhost
* lisp/org-persist.el (org-persist--normalize-container): Recognize
new `elisp-data' container. Treat raw strings, keywords, and quoted
expressions as `elisp-data' container options.
(org-persist-read:elisp-data):
(org-persist-load:elisp-data):
(org-persist-write:elisp-data):
(org-persist-gc:elisp-data):
(org-persist-associated-files:elisp-data): New functions.
(org-persist-read): Simplify docstring example using `elisp-data'
container.
Also, update examples in top comment.
* lisp/org-persist.el (org-persist-version): Bump version.
(org-persist-index-file): Use .eld extension by default.
(org-persist--index): Set mode in buffer-local variable line.
* lisp/org-persist.el (org-persist-read): Only return the requested
containers. Add new optional keyword argument :read-related to read
the containers stored together with requested. Update the docstring
accordingly.
(org-persist-load): Update definition according to `org-persist-read'.
* lisp/org.el (org-mode): Explicitly load all the associated
cache variables.
* lisp/org-persist.el (org-persist-read:index): Allow setting where
the elisp container value is taken from: locally, from buffer, or from
a global variable.