* lisp/org-element.el (org-element--cache-for-removal): Do not update
heading using object granularity. `org-element-at-point' parses
headings without :title objects and cache updates should not change
this.
* lisp/org-clock.el (org-clock-overlays):
* lisp/org-colview.el (org-columns-overlays):
* lisp/org-num.el (org-num--overlays):
* lisp/org-table.el (org-table-header-overlay):
(org-table-coordinate-overlays):
* lisp/org.el (org-custom-properties-overlays):
(org-occur-highlights):
(org-inline-image-overlays): Mark as permanent-local to not lose track
of the overlays when changing major modes.
Reported-by: Eli Qian <eli.q.qian@gmail.com>
Link: https://orgmode.org/list/871qgmeleu.fsf@gmail.com
* lisp/org-macs.el (org-replace-escapes): Suppress byte-compiler
warning about modifying constant string.
Unlike, 39786a8dbf, this commit does not
create merge conflicts.
* lisp/org.el (org-outline-level):
* lisp/org.el (org-current-level): change undefined symbol names
to `org-odd-levels-only' and change "Unlike to" to "Unlike".
* lisp/ob-tangle.el (org-babel-tangle-single-block): Explicitly move
to the beginning of title instead of assuming that
`org-back-to-heading' sets match data appropriately (it is not
documented to do so).
* testing/lisp/test-ob-tangle.el (ob-tangle/comment-org): Add test.
Reported-by: Nick Dokos <ndokos@redhat.com>
Link: https://orgmode.org/list/87bkh8k3at.fsf@alphaville.usersys.redhat.com
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
Clear folds from killed indirect buffers once only. Avoid calling
`remove-text-properties' when there is nothing to remove.
* lisp/org-fold-core.el (org-fold-core--fix-folded-region): Ignore
deletions more aggressively, avoiding the calls to
`org-fold-core-cycle-over-indirect-buffers'.
* lisp/org-element.el (org-element-cache-map): Fix when DATA is
obsolete after buffer modification.
* testing/lisp/test-org.el (test-org/map-entries): Add test.
Reported-by: Victor A. Stoichita <victor@svictor.net>
Link: https://orgmode.org/list/87v8fzxbfo.fsf@svictor.net
* lisp/org.el (org-display-inline-images): inline display of attached
images in link descriptions.
Previously, `org-display-inline-images' only inlined images in link
descriptions when they were explicit "file:" links. This change adds
support for "attachment:" links. E.g.:
[[https://orgmode.org][attachment:emacs-screenshot.png]]
* lisp/ob-C.el (org-babel-C-val-to-C-type): Floats should be printed
as string literals to prevent rounding introduced by %f format.
* testing/lisp/test-ob-C.el (ob-C/float-var): Test that floats are not
rounded when passed as an org :var.
Both Org bugfix's 52dc48050 (Handle compiler warnings from Emacs
master, 2023-04-27) and Emacs master's 4f0849a9e6d (Remove unused
values in effect context, 2023-04-09) comment out an unused condition
in org-babel-insert-result to silence a compiler warning that's new to
the Emacs master branch. However, the changes are slightly different,
so the next sync to emacs-29 will trigger a conflict when merged to
master.
Takes Emacs's variant to 1) avoid the conflict and 2) undo the
unrelated space change from Org's variant. (52dc48050 improved the
comment slightly, but it's not worth the conflict.)
* lisp/ob-core.el (org-babel-insert-result): Silence
ignored-return-value warnings about calls to side-effect-free
functions in the last clause of `cond` statements whose values are
unused.
Remove unused values in effect context
4f0849a9e6d29e25d23e061bd81bacce9468856d
Mattias Engdegård
Sun Apr 9 16:45:40 2023 +0200
* 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.
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
* 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
(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
* 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.
* lisp/ob-tangle.el (org-babel-tangle-default-file-mode): The docstring
states that it the default value is read-write for the user, read only
for everyone else. This is not consistent with the default value which
is actually read-*execute* for the user, read only for everyone else.
The default value is updated to be read-write for the user, as stated in
the docstring.
Reported-by: Ruijie Yu <ruijie@netyu.xyz>
Link: https://list.orgmode.org/orgmode/sdv3554xtat.fsf@fw.net.yu
* lisp/ob-tangle.el (org-babel-interpret-file-mode): When specifying a
file mode in the "rw-r--r--" style, this is interpreted by splicing the
user, group, and other compenents into a "u=rw,g=r,o=r" style string and
applying `file-modes-symbolic-to-number`. For correct interpretation,
we need to ensure the dashes are removed in this process.
* 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.
* 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/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.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/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/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.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-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/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
* 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
* 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/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-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/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/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
* 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-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/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.