* lisp/org.el (org--speed-command-p): New helper function checking
whether current command is a speed command.
(org-self-insert-command): Use the new helper.
* lisp/org.el: In `delete-selection' property of
`org-self-insert-command' symbol, signal that selection must not be
deleted when current command is a speed command.
Reported-by: Joe Gilder <joe@homestudiocorner.com>
Link: https://orgmode.org/list/87il0voeok.fsf@localhost
* lisp/ol.el (org-insert-link):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
* lisp/org-attach.el (org-attach):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-goto.el (org-goto-location):
* lisp/org-macs.el (org-mks):
* lisp/org-table.el (org-table-fedit-finish):
* lisp/org.el (org-offer-links-in-entry):
* lisp/ox.el (org-export-dispatch): Arrange the dialogue window to be
killed when it is displayed in a new frame.
`save-window-configuration' is not enough in such scenarios. Use
`quit-window' instead.
* lisp/org-table.el (org-table-edit-formulas): Prohibit popping up
table editor in a new frame. This is because the major mode for
formula editing makes assumptions about where the editor window is
located and does not work reliably in a separate frame.
Reported-by: Björn Bidar <bjorn.bidar@thaodan.de>
Link: https://orgmode.org/list/87jzlcoxuq.fsf@
* lisp/org.el (org-offer-links-in-entry): When selection is aborted
via C-g, kill *Select Link* buffer. This is useful when the location
of the buffer is customized via `display-buffer-alist' to be not in
the same frame - then, `save-window-configuration' is not enough get
rid of the temporary window.
* lisp/org-macs.el (org-display-buffer-split): New function to display
just the new buffer and current buffer visible in the frame. To be
used as `display-buffer' ACTION parameter.
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
(org-agenda-fit-window-to-buffer):
(org-agenda-prepare-window):
(org-agenda-switch-to):
* lisp/org-capture.el (org-capture-place-template):
* lisp/org-goto.el (org-goto-location):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org.el (org-tree-to-indirect-buffer):
(org-fast-todo-selection):
(org-add-log-note):
(org-fast-tag-selection):
(org-submit-bug-report):
* lisp/ox.el (org-export--dispatch-ui): Get rid of calling
`delete-other-windows' manually. Instead, make use of
`org-display-buffer-slip' + `pop-to-buffer'/`display-buffer'. This
way, user overrides in `display-buffer-alist' are honored.
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org.el (org-offer-links-in-entry): When `delete-other-windows'
cannot be avoided, make it ignore errors in the frames where
displaying a lone window is forbidden.
* lisp/org-clock.el (org-clock-find-position):
* lisp/org-compat.el (org-flag-drawer):
* lisp/org-src.el (org-edit-src-exit):
* lisp/org.el (org-log-beginning): Do not force 'outline folds when
`org-fold-core-style' is 'overlays. The erroneous logic dates back to
the time when all the folding was done via 'outline folds to save up
on the number of overlays in buffer. This is not longer the case -
newer Emacs no longer struggle with number of overlays and we fall
back to using text properties in older Emacs.
Reported-by: Bruno Cardoso <cardoso.bc@gmail.com>
Link: https://orgmode.org/list/87sezzmd1m.fsf@gmail.com
* lisp/org.el (org-create-math-formula):
(org-format-latex-as-html): Shell-quote LaTeX fragment text when
replacing %i placeholder. This prevents shell expansion of
$... and similar constructs inside the code.
(org-latex-to-mathml-convert-command):
(org-latex-to-html-convert-command): Update the docstring.
* etc/ORG-NEWS (~org-latex-to-mathml-convert-command~ and
~org-latex-to-html-convert-command~ shell-escape LaTeX code): Announce
the breaking change.
* doc/org-manual.org (LaTeX math snippets): Update example.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/735645dd-1ddf-4579-a6dd-2700f3e83c94@gmail.com
* lisp/org.el (org--collect-keywords-1): When `expand-file-name'
handler errs on #+SETUPFILE, ignore it. An error may be thrown when
by custom file handler (for example, by TRAMP handler on GVFS path
when `tramp-gvfs-enabled' is nil; which is the default).
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/uue18j$j42$1@ciao.gmane.io
* lisp/org.el (org-set-font-lock-defaults): Apply 'org-special-keyword
face to commented headings last, so that every markup inside look dim,
as per 'org-special-keyword face.
* lisp/org-src.el (org-fontify-inline-src-blocks-1):
* lisp/org.el (org-fontify-macros):
* lisp/org.el (org-activate-footnote-links):
(org-set-font-lock-defaults): Prepend faces during
activation instead of overriding. Add a comment explaining the
general rule how we combine faces.
* etc/ORG-NEWS (Org mode faces are now consistently combined, with
markup faces taking precedence over the containing element faces):
Document the breaking change.
Reported-by: StrawberryTea <look@strawberrytea.xyz>
Link: https://orgmode.org/list/875xy21e49.fsf@localhost
Create commands for `org-read-date-minibuffer-local-map' for use in
place of the inline lambda commands in order to aid user discoverability.
* org.el (org-calendar-goto-today-or-insert-dot)
(org-calendar-goto-today, org-calendar-backward-month)
(org-calendar-forward-month, org-calendar-backward-year)
(org-calendar-forward-year, org-calendar-backward-week)
(org-calendar-forward-week, org-calendar-backward-day)
(org-calendar-forward-day, org-calendar-view-entries)
(org-calendar-scroll-month-left, org-calendar-scroll-month-right)
(org-calendar-scroll-three-months-left)
(org-calendar-scroll-three-months-right): New functions.
* org-keys.el (org-read-date-minibuffer-local-map): Use the new
functions for keybindings instead of inline functions.
TINYCHANGE
* lisp/org.el (org--latex-preview-when-risky): New variable
controlling how to handle LaTeX previews in Org files from untrusted
origin.
(org-latex-preview): Consult `org--latex-preview-when-risky' before
generating previews.
This patch adds a layer of protection when LaTeX preview is requested
for an email attachment, where `untrusted-content' is set to non-nil.
* lisp/org.el (org-create-math-formula): Avoid using
`find-file-noselect' to check contents of the generated mathml
formula. `find-file-noselect' runs a number of hooks, which are not
necessary and may sometimes throw errors.
Link: https://orgmode.org/list/ut96a7$i6d$1@ciao.gmane.io
* lisp/org.el (org-insert-property-drawer): When folding style is
overlays, do not use outline folds to fold the property drawer.
Reported-by: Bruno Cardoso <cardoso.bc@gmail.com>
Link: https://orgmode.org/list/87wmq5btzn.fsf@gmail.com
* lisp/org.el (org--warnings): New variable storing Org mode warnings
to be submitted together with bug reports.
(org-submit-bug-report): Add `org--warnings' to bug report template.
* lisp/org-element.el (org-element--cache-warn): Store cache warnings
for submission.
* lisp/org.el (org-update-parent-todo-statistics): Make sure that we
move to the end of updated cookie at the end of search loop, even when
the cookie has not been updated.
Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/87le6pucnv.fsf@gmail.com
* lisp/org.el (org-up-heading-safe): Fix return value, making sure
that the returned level is not reduced. This is what other code
expects and what used to be the case before refactoring, in previous
version of the function.
* testing/lisp/test-org.el (test-org/up-heading-safe): Add test.
Reported-by: E.L.K. <some.any.key@gmail.com>
Link: https://orgmode.org/list/CAF+cOoPuh8rzVRoV9-pGSP3SVRm-M8ZQrM=xGB+o4TqJat_O-A@mail.gmail.com
* lisp/ol.el (org-target-link-regexp-limit): New constant defining
maximum regexp limit where `org-target-link-regexp' is still safe to
use without triggering "Regexp too long" error.
(org-target-link-regexps): New variable holding a series of shorter
regexps to be used instead of too long single
`org-target-link-regexp'.
(org--re-list-search-forward): New function like `re-search-forward',
but accepting a list of regexps.
(org--re-list-looking-at): New function like `looking-at', but
accepting a list of regexps.
(org-update-radio-target-regexp): When `org-target-link-regexp' is too
long, set `org-target-link-regexps', partitioning the link target list
into smaller regexps.
* lisp/org-element.el (org-element-link-parser):
(org-element--object-lex):
* lisp/org.el (org-activate-target-links): Use
`org--re-list-search-forward' and `org--re-list-looking-at' when
`org-target-link-regexps' is non-nil.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
tests.
Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/orgmode/m2lenax5m6.fsf@me.com/
* lisp/org-entities.el (seq): Require seq.el - it is not preloaded in
Emacs <28.
* lisp/org.el (org--image-yank-media-handler): Suppress warning and
throw an error about `file-name-with-extension'. This function is not
supposed to be called in older Emacs.
* lisp/oc-basic.el (org-cite-basic--shorten-names): Provide third
argument for `mapconcat'. It is mandatory in Emacs <29.
* lisp/org.el (org--image-yank-media-handler): Suppress warning and
throw and error in Emacs <29.
(org--dnd-rmc): Do not try to call `use-dialog-box-p' in Emacs <29.
* lisp/org.el (org-activate-folds): When a fold is created by link
abbreviation, and a link ends at eol, do not force the newline after
the ]] to have the same face as the link.
Reported-by: Rohit Patnaik <quanticle@quanticle.net>
Link: https://orgmode.org/list/6d440976-6747-4ce6-8913-b63931dd017f@app.fastmail.com
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Do not assert
that `org-src-fontify-natively' only applies to code blocks. Allow
other blocks with language specifier to be fontified, but keep this
behavior undocumented.
Reported-by: Rudi C <rudiwillalwaysloveyou@gmail.com>
Link: https://orgmode.org/list/CAE9z9A3ko27NeN0oYFs_aBWV_cUbNm5YQTLrRux16dHsixsMBA@mail.gmail.com
* lisp/org.el (org-activate-folds): New fontification function to
arrange faces at newlines after folds to be the same as face before
the fold.
(org-set-font-lock-defaults): Add the new fontification function.
* lisp/org-fold-core.el (org-fold-core-region): Refresh fontification
of newlines after folds when folding/unfolding.
Reported-by: StrawberryTea <look@strawberrytea.xyz>
Link: https://orgmode.org/list/87plwoqrfv.fsf@strawberrytea.xyz
* lisp/org.el (org-insert-heading): Change optional argument TOP to
LEVEL, accepting a number to force a specific heading level.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
* etc/ORG-NEWS: Document changes.
* lisp/org-cycle.el:
* lisp/org.el (org-cycle): Move variable aliases right before new
variable name definitions in org-cycle.el. Otherwise, if users set
the aliased variable values before loading Org-mode, they might get
overwritten by the default value.
Reported-by: Ruiyang Wu <ywwry66@gmail.com>
Link: https://orgmode.org/list/F3A95086-B4BF-4C08-AF7A-8D7DE6FE30CF@gmail.com
* lisp/org-cycle.el:
* lisp/org.el (org-cycle): Move variable aliases right before new
variable name definitions in org-cycle.el. Otherwise, if users set
the aliased variable values before loading Org-mode, they might get
overwritten by the default value.
Reported-by: Ruiyang Wu <ywwry66@gmail.com>
Link: https://orgmode.org/list/F3A95086-B4BF-4C08-AF7A-8D7DE6FE30CF@gmail.com
* lisp/org.el (org-dynamic-block-insert-dblock): When insert command
for a dynamic block is not interactive, do not try to call it
interactively.
Reported-by: chris <inkbottle007@gmail.com>
Link: https://orgmode.org/list/5790810.DvuYhMxLoT@nixos
* org.el (org-latex-to-html-convert-command): Add a note in the
docstring about proper shell-quoting.
It can trip you up because wrongly quoted input still works with some
math snippets, so the command may work during testing but not later
when you have different math snippets in play.
TINYCHANGE
* lisp/org.el (org-narrow-to-subtree): Fix error when current
narrowing intersects the current subtree. When intersection happens,
behave historically, like the previous version of the command (that
did not use org-element).
* lisp/org.el (org-startup-folded): Document all the allowed values in
the docstring. Allow symbols named the same as #+STARTUP option.
(org-startup-options): Allow `org-startup-folded' to have values
corresponding to the corresponding #+STARTUP options.
* lisp/org.el (org-insert-subheading): When at bol, do not insert
heading above (default behavior of `org-insert-heading'). Instead,
force `org-insert-heading' to insert below. Improve docstring,
explaining how the prefix arguments are used and the new different
with `org-insert-heading'.
* etc/ORG-NEWS (~org-insert-subheading~ no longer inserts a
sub-heading above current when point is at the beginning of line):
Document the breaking change.
Reported-by: Michael Dauer <mick.dauer@gmail.com>
Link: https://list.orgmode.org/CAP7OBx+whiB8Jo_hEcfL6MajDU1EH=E5j0ZOvHB3dPRK+Aj4mQ@mail.gmail.com/
* lisp/org.el (org-update-parent-todo-statistics): When the updated
statistics cookie is unchanged, do not modify buffer. This prevents
unnecessary queries to element cache.
* lisp/org-footnote.el (org-footnote-new, org-footnote-auto-label):
Add symbol `anonymous' to `org-footnote-auto-label'. With this,
anonymous footnotes will be created. This is sometimes useful in long
texts. Mimics \footnote{} in LaTeX. Modify `org-footnote-new' to
generate anonymous footnotes directly.
* lisp/org.el (org-startup-options): Add `fnanon' to startup options.
* testing/lisp/test-org-footnote.el (test-org-footnote/new-anon): Add
a test for creation of anonymous footnotes.
* etc/ORG-NEWS:
(~org-footnote-new~ can be configured to create anonymous footnotes):
Announce new anonymous footnote support.
* doc/org-manual.org (Summary of In-Buffer Settings): Document
"fnanon" startup option.
* lisp/org.el (org--confirm-resource-safe): Do not assume that
resource is safe when user replies "n" (do not download).
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/upj6uk$b7o$1@ciao.gmane.io
* lisp/org-faces.el (org-table-row): New face.
* lisp/org.el (org-set-font-lock-defaults): Use ~org-table-row~ face
to fontify the whole table rows, including indentation and newlines.
* etc/ORG-NEWS (Org mode now fontifies whole table lines (including
newline) according to ~org-table~ face): Announce the change.
* lisp/org.el (org-todo): When title contains link, we cannot use
`org-fold-region' to unfold everything - this may cause unexpected tag
alignment when the link is revealed and font-locking is not yet
triggered. Instead of unfolding everything, just remove outline folds.
Reported-by: Peter Solodov <solodov@gmail.com>
Link: https://orgmode.org/list/413C89C3-25DB-425B-A367-FA683E7ADD05@gmail.com
* lisp/org.el (org-update-parent-todo-statistics): Ignore text
matching statistics cookie that is inside verbatim environments or
otherwise not detected by parser. Leave a single exception for
headline properties for backwards compatibility.
* lisp/org.el (org-latex-default-packages-alist): Change to refine
font management depending on the latex compiler.
Differentiate between pdflatex and lualatex/xetex
packages for font management. lualatex/xetex should use
fontspec instead of fontenc/inputenc. When using
fontspec, you need to load amsmath before fontspec
and you don't need amssymb.
* lisp/org.el (org-startup-options): Add new startup options to set
`org-link-descriptive'.
(org-mode): Move #+startup keyword parsing before setting up link
visibility.
* doc/org-manual.org (Link Format):
(Summary of In-Buffer Settings): Document the new startup option.
* etc/ORG-NEWS (~org-link-descriptive~ can now be set per-buffer via
=#+STARTUP= options): Announce the new feature.
Link: https://orgmode.org/list/87bkst1nfl.fsf@ucl.ac.uk
* lisp/org.el (org-open-at-point-global): Match multiline links
spanning up to a paragraph.
Reported-by: Omar Antolín Camarena <omar@matem.unam.mx>
Link: https://orgmode.org/list/87o7df7psx.fsf@localhost
* lisp/org.el (org--get-outline-path-1): Remove comment keyword from
title when current heading is commented.
* testing/lisp/test-org.el (test-org/get-outline-path): Add test.
* lisp/org.el (org-next-visible-heading): Really test for visibility;
not folding. Some folds may not be invisible - when
`org-link-descriptive' is nil, links are folded yet visible.
* testing/lisp/test-org.el (test-org/next-visible-heading): Add new
test case.
Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2bk9q7adw.fsf@me.com
* lisp/org.el (org-fast-tag-selection): Do not print tags without
explicit bindings and tags outside groups when the number of displayed
tags exceeds new customization.
* lisp/org.el (org-fast-tag-selection-maximum-tags): Add new custom
option to set maximum tags number for fast tag selection.
(org--fast-tag-selection-keys): New internal variable holding keys
available for auto-assigning tag bindings.
* doc/org-manual.org (org-fast-tag-selection-maximum-tags): Add new
custom option documentation.
* etc/ORG-NEWS: Declare this new custom option.
Co-Authored-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://list.orgmode.org/orgmode/CAL1eYuK7GUx_=47e8+N5Jh+ZJnDexY+CDMUjPjJHNmcMiVVRrQ@mail.gmail.com/
* lisp/org-fold-core.el (org-fold-core--suppress-folding-fix):
(org-fold-core-suppress-folding-fix): New macro suppressing re-folding
checks.
(org-fold-core--fix-folded-region): Skip re-folding checks when
`org-fold-core--suppress-folding-fix' is non-nil.
* lisp/org.el (org-self-insert-command): Use
`org-fold-core-suppress-folding-fix' to bypass re-folding checks, but
not fragility checks.
*
testing/lisp/test-org-fold.el (test-org-fold/org-fold-reveal-broken-structure):
New test.
* lisp/org.el (org-image--align, org-image-align,
org-toggle-inline-images): Add the ability to left-align, center
or right-align inline image previews in the Emacs window. This is
controlled globally using the new user option `org-image-align'.
Alignment can be specified per image using the `#+ATTR.*'
affiliated keywords. The function `org-image--align' determines
the kind of alignment for its argument link.
* lisp/org-lint.el (org-lint-invalid-image-alignment): Add an
org-lint checker to catch invalid ":align" and ":center"
attributes in `#+attr_org' keywords.
* doc/org-manual.org: Document the new feature under the Images
section.
* lisp/org.el (org-sort-entries): Make sure that we extend sorted
region to the full subtree if it spans beyond end of region.
* testing/lisp/test-org.el (test-org/sort-entries): Add test.
* lisp/org.el (org-mode): Call the setup function for yank-media and
DND.
(org-setup-yank-dnd-handlers): Register yank-media-handler and DND
handler.
(org-yank-image-save-method, org-yank-image-file-name-function)
(org-yank-dnd-method, org-yank-dnd-default-attach-method): New
defcustoms.
(org--image-yank-media-handler, org--copied-files-yank-media-handler)
(org--dnd-rmc, org--dnd-multi-local-file-handler)
(org--dnd-local-file-handler, org--dnd-attach-file, org--dnd-xds-method)
(org--dnd-xds-function): Add yank-media and DND handlers.
* doc/org-manual.org: (Drag and Drop & ~yank-media~): Describe the new
feature in the manual.
* etc/ORG-NEWS: Advertise the new features.