* lisp/org.el (org-open-at-point): Preserve point when opening links.
When a link opened moves point in current buffer, do move the point
as needed by the link. When multiple links that are opened move point
in current buffer, move point to the last such link. Fix searching
for the links when opening _multiple_ the links is requested.
Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87r0mp2srd.fsf@localhost
* lisp/org.el (org-entry-get-with-inheritance): Do not ignore when
property has explicit "nil" value.
* testing/lisp/test-org.el (test-org/entry-get): Add test.
* org.el (org-auto-repeat-maybe): Changed org-auto-repeat-maybe, so that
switching a repeating todo with a timestamp of the form <… ++…> respects
`org-extend-today-until'.
* test-org.el (test-org/auto-repeat-maybe, org-test-with-time-locale):
Tests for interaction of `org-extend-today-until' and
`org-auto-repeat-maybe'. Added `org-test-with-time-locale' to make test
results independent of running machine. Explicitly avoid matching log
note with old timestamp in all the tests to avoid confusion.
Co-authored-by: Ihor Radchenko <yantar92@posteo.net>
TINYCHANGE
* lisp/org.el (org-modify-ts-extra): Treat INCREMENT-STEP argument as
multiplier for minutes.
(org-timestamp-change): Add commentary. Make sure that minutes are
incremented by prefix argument when incrementing time range without
rounding.
Reported-by: Jorge P. de Morais Neto <jorge+list@disroot.org>
Link: https://orgmode.org/list/87wnoezd15.fsf@disroot.org
Rename arguments and variables to be more readable. Add commentary
explaining the code. Update the docstring, documenting the important
details and describing all the function arguments.
* lisp/org.el (org--add-or-remove-tag): New helper function to toggle
tags taking into account tag groups.
(org-fast-tag-selection): Factor out the tag toggling code into a new
function and re-use it in both key selection branch and in the <TAB>
completion interface.
Reported-by: sreenivas sumadithya <sumadithya@gmail.com>
Link: https://orgmode.org/list/CAHVqzFVP9KhrC5ZG_GUHbXZRBVg+PU+tR91vSfrnirLo7_T5Ug@mail.gmail.com
* lisp/org.el (org-make-tags-matcher):
* testing/lisp/test-org.el (test-org/map-entries): Move special cased
handling of LEVEL properties. Add tests for other special cased
properties TODO and CATEGORY.
* lisp/org.el (org-make-tags-matcher):
* doc/org-manual.org (Matching tags and properties):
* testing/lisp/test-org.el (test-org/map-entries): Re-add and extend
quoting of property names in search strings.
Link: https://orgmode.org/list/87h6oq2nu1.fsf@gmail.com
The docstring was not accurate from the times when group information
was added to it. The patch uses the groups, as they appear in the
function code itself.
* lisp/org-element.el (org-element-cache-version): New constant
defining the current cache version.
(org-element-cache-reset): Use the new variable.
* lisp/org.el (org-mode): Assert loading the correct cache version.
Reported-by: Gregor Zattler <telegraph@gmx.net>
Link: https://orgmode.org/list/87350cvm3d.fsf@no.lan
* lisp/org.el (org-fast-tag-selection): Fix "no catch" error. But do
not directly set `quit-flag' as it was done in the earlier versions.
Instead, call `keyboard-quit', allowing it to perform the necessary
cleanups.
* lisp/org.el (org-insert-heading): Do not slurp blank lines after
previous heading into the contents of the newly added one. These
blank lines might be folded and we end up with point before folded
spaces * <point>...
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
(test-org/insert-todo-heading-respect-content): Do not expect trailing
newline after the newly added heading. The test did not intentionally
test this particular behavior (other tests do not expect trailing
newlines to be _always_ added).
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/ubpcoi$f7n$1@ciao.gmane.io
This reverts commit a25d00d5df.
Direct call to `org-fold-check-before-invisible-edit' is no longer
necessary on main. We use `org-fold-catch-invisible-edits-commands'.
* lisp/org.el (org-make-tags-matcher): Add starred property operators.
Recognize additional operators "==", "!=", "/=". Clean up and
document match term parsing. Remove needless and buggy unquoting of
minus characters in property and tag names.
(org-op-to-function): Recognize additional inequality operator "/=".
* doc/org-manual.org (Matching tags and properties): Add documentation
on starred and additional operators. Document allowed characters in
property names and handling of minus characters in property names.
* testing/lisp/test-org.el (test-org/map-entries): Add tests for
starred and additional operators. Add tests for property names
containing minus characters.
* etc/ORG-NEWS: (~org-tags-view~ supports more property operators):
Add announcement on starred and additional operators.
Link: https://orgmode.org/list/9132e58f-d89e-f7df-bbe4-43d53a2367d2@vodafonemail.de
* lisp/org.el (org-goto-sibling): Do not try to find inlinetask
siblings. Clarify the docstring.
* testing/lisp/test-org.el (test-org/goto-sibling): New test.
* lisp/org.el (org-insert-drawer): Leave and reveal point inside
drawer even when we insert property drawer or drawer around region, as
advertised by the docstring.
* 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.el (org-up-heading-safe): Do not assume that
`org-element-parent' is always a heading. Use `org-element-lineage'
to get parent heading specifically. Move point to current heading
even when no parent heading is available, as expected by some of the
other Org routines. Document moving point when no parent.
* testing/lisp/test-org.el (test-org/up-heading-safe): Add tests.
Reported-by: Daniel Liden <djliden91@gmail.com>
Link: https://orgmode.org/list/CAG=u__pAT9k_AsRG6cpyPPUt0__5S7o=3a8WWkAijuPPuGc7Cg@mail.gmail.com
* lisp/org.el (org-do-emphasis-faces): Mark invisible text property in
emphasis markers non-sticky. This is usually not a problem as we
manage invisible text property via font-lock. However subtle bugs may
exist with non-interactive calls to Elisp primitives that inherit text
properties (like `indent-to').
Reported-by: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Link: https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de
* lisp/org-src.el (org-src-preserve-indentation-p): New function
checking whether block should preserve indentation. This function
abstracts away the check for block type, indentation flag, and
customized `org-src-preserve-indentation' value.
(org-src--edit-element):
* lisp/ob-core.el (org-babel--normalize-body):
(org-babel-read-element):
(org-babel-update-block-body):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-element.el (org-element-example-block-interpreter):
(org-element-src-block-interpreter):
* lisp/org.el (org-fixup-indentation):
(org-indent-region):
* lisp/ox.el (org-export-unravel-code): Use the new function instead
of duplicating code.
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Add FIXME. We
do not have access to the block element here and cannot easily check
the flag.
* lisp/ob-tangle.el (org-babel-tangle-single-block):
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org.el (org-indent-line): Check block flag in addition to `org-src-preserve-indentation'.
This commit unifies logic deciding whether to preserve block
indentation into a single place to avoid confusion.
The new property is needed to reduce ambiguity when interpreting the
parsed data.
* lisp/org-element.el (org-element-timestamp-interpreter): Preserve old
behavior when :range-type is `nil'. Take into account :range-type
value when interpreting ranges. When :range-type is `timerange',
return a timerange (<YYYY-mm-DD HH:MM-HH:MM>). If :range-type is
`daterange' return a daterange (<...>--<...>). When :range-type is
nil, return a daterange (as it was before). When :range-type is
`daterange' or `timerange' and :type is `active'/`inactive', throw an
error.
(org-element-timestamp-parser): Add :range-type property.
* lisp/org.el (org-timestamp-split-range): Make sure that :range-type
is nil for a split timestamp.
* testing/lisp/test-org-element.el
(test-org-element/timestamp-interpreter): Add new tests.
(test-org-element/timestamp-parser): Add tests for :range-type
property.
* etc/ORG-NEWS (Major changes and additions to Org API): Add news about this property.
Link: https://list.orgmode.org/orgmode/87y1ot6dqz.fsf@gmail.com/
* lisp/org.el (org-indent-line): Simplify native indentation inside
src block. Ensure we add the org indentation if the line is empty.
* lisp/org-macs.el (org-do-remove-indentation): Preserve
indentation (spaces vs tabs) past the common indentation to remove.
Do not empty blank lines.
* lisp/org-src.el (org-src--contents-for-write-back): Preserve the
native indentation (spaces vs tabs). If necessary, add a common org
indentation to the block according to org's `indent-tabs-mode'.
(org-src-font-lock-fontify-block): Display the native indentation tab
characters with a fixed width, according to the native tab width
value, to preserve vertical alignement in the org buffer.
* testing/lisp/test-org-src.el (test-org-src/indented-blocks): Update
tests. Indentation no longer obeys `indent-tabs-mode' from the org
buffer, but is separated in an eventual org part, and the native part.
Link: https://list.orgmode.org/87a5wcez7e.fsf@localhost/T/#t
* lisp/org.el (org-metaleft-final-hook, org-metaright-final-hook,
org-metaup-final-hook, org-metadown-final-hook): Define final hooks
for S-cursor commands.
(org-metaleft, org-metaright, org-metaup, org-metadown): Add final
hooks to M-commands and document them in the docstring.
* lisp/org.el (org-shiftup, org-shiftdown, org-shiftright,
org-shiftleft): Document hooks for S-cursor commands in the docstring.
* lisp/org.el (org-shiftmetaleft-final-hook,
org-shiftmetaright-final-hook, org-shiftmetaup-final-hook,
org-shiftmetadown-final-hook): Define final hooks for the S-M-cursor
commands.
(org-shiftmetaleft, org-shiftmetaright, org-shiftmetaup,
org-shiftmetadown): Add final hooks to the S-M-cursor commands and
document hooks in the docstring.
* etc/ORG-NEWS (New final hooks for Modifier-Cursor keys): Document
new hooks.
TINYCHANGE
* lisp/org.el (org-make-tags-matcher): When building tag completion
table, do not attempt to call `org-get-buffer-tags' when current
buffer is not an Org buffer.
Reported-by: Colin Baxter <m43cap@yandex.com>
Link: https://orgmode.org/list/87ilb1fakk.fsf@yandex.com
* lisp/org.el (org-refresh-category-properties): Do not check if
org-element-cache is active. This function is now obsolete and can
only be called on purpose by third-party code that probably expects
the text properties to be assigned regardless whether the cache is
active.
This commit also fixes compiler warning as
`org-element--cache-active-p' is not declared anymore in lisp/org.el.
* lisp/org-element.el (org-element-drawer-re-nogroup): New constant
regexp matching drawer line without creating regexp groups.
(org-element--current-element): Use the new constant.
* lisp/org.el (org-drawer-regexp): Ensure that it is the same with
org-element version and mark for removal/alias.
(org-property-drawer-re): Simplify, removing unnecessary matching of
node property structures.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#62
* lisp/org-element.el: Add commentary explaining some regexp-related
optimizations useful for the parser.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225
(org-element--headline-deferred):
(org-element-item-parser):
(org-element-item-interpreter):
(org-element--list-struct):
(org-element-plain-list-parser):
(org-element-example-block-parser):
(org-element-fixed-width-interpreter):
(org-element-paragraph-parser):
(org-element-src-block-parser):
(org-element-table-parser):
(org-element--parse-generic-emphasis):
(org-element-export-snippet-interpreter):
(org-element-link-parser):
(org-element--current-element):
(org-element--collect-affiliated-keywords):
(org-element-parse-buffer):
(org-element-normalize-string):
(org-element-normalize-contents):
(org-element--parse-to):
(org-element--cache-before-change):
(org-element--cache-for-removal):
(org-element-context): Avoid storing match data unless strictly
necessary. Explain the necessity in places where we have to use
`save-match-data'. Prefer `looking-at-p' (does not alter match data)
to `looking-at'. Simplify regexps. Update docstrings clearly
indicating when match data might be modified.
* lisp/org.el:
(org-offer-links-in-entry):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-agenda.el: Fix places where we need to protect match data.
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties. The functions are `setf'-able.
Update all the relevant code in Org to use the new functions instead
of genetic property queries.
* lisp/org-element.el (org-element-parse-buffer): Do not force-undefer
when new optional argument is provided.
* lisp/org-lint.el (org-lint--generate-reports):
* lisp/org.el (org-unindent-buffer):
* lisp/ox.el (org-export--missing-definitions):
(org-export--annotate-info): Do not undefer when unnecessary.
Adjust all the declare forms.
* 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/org.el (org-priority-show): Do not wrongly assert that the
priority is affected by scheduled and deadline values. This was not
true in the past for Org mode buffers, and it is no longer true after
8fab6eeef renamed composite agenda rank from priority to urgency.
* etc/ORG-NEWS (~org-priority=show~ command no longer adjusts for
scheduled/deadline): Document the change, right before the NEWS item
describing changes in the agenda.
* lisp/org.el (org-indent-line): Fix when we are within blank lines
after heading. ELEMENT is then `heading' and looking at :begin - 1
does not make sense.
* testing/lisp/test-org.el (test-org/indent-region): Add test.
Reported-by: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Link: https://orgmode.org/list/d7129804-1f42-ea2b-85e8-18ea1ee32d73@vodafonemail.de
* 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/org.el (org-insert-todo-heading-respect-content): Do not force
first TODO keyword in the inserted heading. Instead, accept prefix
arguments and pass them directly to `org-insert-todo-heading'.
* etc/ORG-NEWS (~org-insert-todo-heading-respect-content~ now accepts
prefix arguments): Document the change.
*
testing/lisp/test-org.el (test-org/insert-todo-heading-respect-content):
Add tests.
Reported-by: Xuan Wang <xuan.public@gmail.com>
Link: https://orgmode.org/list/CALjN2yehOVYZuU+tURes+mJ5XyTrRY1O0UG1ijH-6TjJ=W0ibw@mail.gmail.com
* lisp/org.el (org--create-inline-image): Allow `org-image-max-width'
to be a floating point value - fraction of window width.
(org-image-max-width): Update the docstring and type specification.
* lisp/org.el (org-mode-syntax-table): New explicitly defined variable
for Org mode syntax table.
(org-mode-tags-syntax-table): Define value in advance, available even
before Org mode is loaded.
(org-mode): Use the new `org-mode-syntax-table' variable.
Reported-by: Daniel Clemente <n142857@gmail.com>
Link: https://orgmode.org/list/CAJKAhPCcMwZS6aYK9MRKsjds9uTivOdfC9nzMok70Df8vR3tPA@mail.gmail.com
* lisp/org.el (org-return): When `org-return-follows-link' is non-nil
and point is over an org-cite citation or citation reference, call `org-open-at-point'.
TINYCHANGE