Commit Graph

5867 Commits

Author SHA1 Message Date
Ihor Radchenko 8648576573
org-up-heading-safe: Return true level, ignoring org-odd-levels-only
* lisp/org.el (org-up-heading-safe): Fix return value, making sure
that the returned level is not reduced.

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
2024-02-29 14:47:31 +03:00
Ihor Radchenko 6ef0154576
org-up-heading-safe: Return true level, ignoring org-odd-levels-only
* 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
2024-02-29 14:36:26 +03:00
Ihor Radchenko 341a01a07d
Work around regexp size limitation for large number of link targets
* 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/
2024-02-29 13:54:41 +03:00
Ihor Radchenko fe9bc9efd1
Update version number for the 9.6.20 release 2024-02-28 10:53:28 +03:00
Ihor Radchenko 8651c83991
Address Emacs 27 warnings
* 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.
2024-02-27 13:34:07 +03:00
Ihor Radchenko 25a51bad2c
Address Emacs 28 warnings
* 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.
2024-02-27 13:29:00 +03:00
Ihor Radchenko 9f6894c106
org-activate-folds: Do not fontify newline after abbreviated links
* 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
2024-02-26 15:52:25 +03:00
Ihor Radchenko af9100382c
Never pass error message verbatim as the first argument for `message'/`error'
* lisp/org-capture.el (org-capture-store-last-position):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org.el (org-open-file): Avoid (error string) code pattern.
Instead use (error "%s" string).  (error string) is erroneous when
STRING contains %-specs.

Reported-by: Corwin Kerr <corwin@corwinkerr.com>
Link: https://orgmode.org/list/beceaf05-ae15-487b-864b-2e23a33a3884@app.fastmail.com
2024-02-25 13:15:04 +03:00
Ihor Radchenko 9daad41ccf
Re-introduce undocumented fontification of example blocks
* 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
2024-02-25 13:00:12 +03:00
Ihor Radchenko 5d186b499d
org-fold: Refactor fontifying newlines after folds
* 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
2024-02-25 11:42:44 +03:00
Rick Lupton 6e7e0b2cd3
lisp/org.el (org-insert-heading): Allow specifying heading level
* 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.
2024-02-24 15:56:43 +03:00
Ihor Radchenko bfe253f7eb
org-cycle: Fix "Overwriting value of ... by aliasing" warning
* 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
2024-02-23 16:24:19 +03:00
Ihor Radchenko 256caa0823
org-cycle: Fix "Overwriting value of ... by aliasing" warning
* 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
2024-02-23 16:21:13 +03:00
Ihor Radchenko 67d9372487
org-read-date-display: Fix random overlay priority when selection is at today
* lisp/org.el (org-read-date-display): Assign `org-read-date-overlay'
non-default priority.  This makes sure that the overlay is displayed
over the overlay that calendar.el puts to indicate "today".

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CALEYq0-xbCc6ayEK3v7tKnuGU7=Npgh3raEjuB13qOTN6Eu07Q@mail.gmail.com
2024-02-21 14:15:24 +03:00
Ihor Radchenko 0dd2c5ea39
Merge branch 'bugfix' 2024-02-19 13:20:47 +03:00
Ihor Radchenko d5b98bcfb5
org-dynamic-block-define: Clarify that FUNC must accept zero arguments
* lisp/org.el (org-dynamic-block-define): Update the docstring.

Reported-by: chris <inkbottle007@gmail.com>
Link: https://orgmode.org/list/5790810.DvuYhMxLoT@nixos
2024-02-19 13:19:11 +03:00
Ihor Radchenko d6c3ab08b4
org-dynamic-block-insert-dblock: Do not call non-commands interactively
* 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
2024-02-19 13:18:10 +03:00
Martin Edström a8443f2c79
org-latex-to-html-convert-command: Enhance the docstring
* 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
2024-02-19 11:28:06 +03:00
Ihor Radchenko d314882301
org-narrow-to-subtree: Fix when current narrowing intersects subtree
* 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).
2024-02-18 17:47:18 +01:00
Ihor Radchenko c2a58bbd53
org-startup-folded: Make values consistent with #+STARTUP keyword
* 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.
2024-02-11 13:40:17 +01:00
Ihor Radchenko bc0e14a1ab
Update version number for the 9.6.19 release 2024-02-11 12:50:12 +01:00
Ihor Radchenko cbfe1354b3
org-insert-subheading: Never insert sub-heading above current
* 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/
2024-02-10 16:57:59 +01:00
Ihor Radchenko 9ddfb66996
lisp/org.el (org-insert-subheading): Improve docstring 2024-02-10 16:57:42 +01:00
Ihor Radchenko 4254a54f88
org-update-parent-todo-statistics: Do not modify buffer unnecessarily
* 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.
2024-02-05 22:12:03 +01:00
Pedro A. Aranda Gutiérrez 10d2868c58
org-footnote-new: Add an option to create new anonymous labels
* 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.
2024-02-05 15:38:48 +01:00
Ihor Radchenko b2ee10545e
Merge branch 'bugfix' 2024-02-04 14:31:31 +01:00
Ihor Radchenko 1abff38597
org-fontify-extend-region: Fix edge case
* lisp/org.el (org-fontify-extend-region): Extend region for an extra
character, just as `font-lock-extend-jit-lock-region-after-change'
does.  This fixes a reported edge case.

Also, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68849

Reported-by: Kostas Papadakis <papadakis.k@yandex.com>
Link: https://orgmode.org/list/c5fb9f63-185c-4e36-b13f-e887a4a29aae@yandex.com
2024-02-04 14:29:23 +01:00
Ihor Radchenko 97f4ae0c2d
Update version number for the 9.6.18 release 2024-02-04 13:53:02 +01:00
Ihor Radchenko 3f4bdf80cb
Merge branch 'bugfix' 2024-02-02 21:01:30 +01:00
Ihor Radchenko 56748ea4e2
org: Fix security prompt for downloading remote resource
* 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
2024-02-02 20:59:41 +01:00
Ihor Radchenko 844bd9f1f1
lisp/org.el (org-copy-visible): Fix when using overlays for folding 2024-02-02 16:24:16 +01:00
Ihor Radchenko 14acf626fe
org: Fontify whole table rows with `org-table-row' face
* 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.
2024-02-01 15:30:18 +01:00
Ihor Radchenko da9ac6da1d
Merge branch 'bugfix' 2024-01-30 15:28:02 +01:00
Ihor Radchenko 7de8b3917c
org-todo: Fix tag alignment when title contains a folded link
* 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
2024-01-30 15:25:00 +01:00
Ihor Radchenko 22050243b8
org-update-parent-todo-statistics: Use parser to match statistics cookie
* 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.
2024-01-29 16:38:07 +01:00
Pedro A. Aranda Gutierrez a4a880d1f9
org-latex-default-packages-alist: Refine packages for font management
* 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.
2024-01-29 14:26:30 +01:00
Ihor Radchenko 78dc58508d
Obsolete org-switch-to-buffer-other-window and org-no-popups
* lisp/org-compat.el (org-switch-to-buffer-other-window):
(org-no-popups): Move from org-macs.el and mark obsolete.
* lisp/ob-lilypond.el (org-babel-lilypond-execute-tangled-ly):
(org-babel-lilypond-mark-error-line):
* lisp/ol.el (org-insert-link):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
(org-agenda-prepare-window):
(org-agenda-goto):
(org-agenda-open-link):
(org-agenda-clock-goto):
(org-agenda-diary-entry-in-org-file):
(org-agenda-add-entry-to-org-agenda-diary-file):
(org-agenda-show-the-flagging-note):
* lisp/org-attach.el (org-attach):
* lisp/org-capture.el (org-capture-place-template):
(org-capture-fill-template):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-macs.el (org-mks):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org-table.el (org-table-edit-field):
(org-table-edit-formulas):
(org-table-show-reference):
* lisp/org.el (org-fast-todo-selection):
(org-add-log-note):
(org-fast-tag-selection):
* lisp/ox.el (org-export-stack-view):
(org-export--dispatch-ui): Use `switch-to-buffer-other-window'.
* etc/ORG-NEWS (Org mode no longer disallows configuring
~display-buffer-alist~ to open Org popups in other frame): Document
the breaking change.

Reported-by: Jan Seeger
Link: https://orgmode.org/list/87pmr3mfq3.fsf@localhost
2024-01-24 15:00:26 +01:00
Ihor Radchenko dd4fd02995
Allow per-buffer setting of org-link-descriptive via #+STARTUP options
* 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
2024-01-22 13:58:30 +01:00
Ihor Radchenko ac1c72376c
org-open-at-point-global: Match multiline links
* 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
2024-01-21 13:17:12 +01:00
Ihor Radchenko 92c53f23d3
org-get-outline-path: Drop COMMENT keywords from the outline path
* 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.
2024-01-18 15:13:04 +01:00
Ihor Radchenko 4ce2ad4eb1
lisp/org.el (org-agenda-files): Avoid duplicates
Duplicate entries in agenda files cause scanning the same file
twice, producing duplicates in the agenda.

Reported-by: Christopher M. Miles <numbchild@gmail.com>
Link: https://orgmode.org/list/65a75fd3.170a0220.be4f3.67c9@mx.google.com
2024-01-17 12:52:37 +01:00
Ihor Radchenko 25c786f0fb
Update version number for the 9.6.17 release 2024-01-14 12:50:34 +01:00
Ihor Radchenko c41a89676e
org-next-visible-heading: Fix when moving over non-descriptive link
* 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
2024-01-13 13:35:52 +01:00
Ihor Radchenko 1aa4552e5c
org-indent-drawer, org-indent-block: Update docstring
* lisp/org.el (org-indent-drawer):
(org-indent-block): Document that an error is signaled when not at a
drawer/block.

Reported-by: gerard.vermeulen@posteo.net
Link: https://list.orgmode.org/orgmode/abc9e25cebcba21d941435e5f39e72d9@posteo.net/
2024-01-12 20:17:12 +01:00
stardiviner dea7780d6d
org-fast-tag-selection: Limit the number of displayed tags
* 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/
2024-01-12 12:58:46 +01:00
Ihor Radchenko c9e5270bf1
lisp/org.el (org-self-insert-command): Do not skip fragility checks
* 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.
2024-01-09 16:40:22 +01:00
Ihor Radchenko 804d032685
Update version number for the 9.6.16 release 2024-01-07 12:25:20 +01:00
Kyle Meyer 72a2db86d9 Merge branch 'bugfix' 2024-01-06 16:02:02 -05:00
Po Lu 9f1d6dfd73 Backport commit 8e1c56ae4 from Emacs
; Add 2024 to copyright years
8e1c56ae46754dd7baedff49a464f078f0e9912d
Po Lu
Tue Jan 2 09:47:10 2024 +0800
2024-01-06 15:48:23 -05:00
Ihor Radchenko 478b40d99e
Update version number for the 9.6.15 release 2023-12-31 12:59:12 +01:00
Ihor Radchenko 58c91cbf9f
Update version number for the 9.6.14 release
* lisp/org.el:
2023-12-24 11:57:35 +01:00
Karthik Chikmagalur 6011e7a489
org: Add image alignment
* 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.
2023-12-21 14:38:06 +01:00
Ihor Radchenko 92fec81e2e
lisp/org.el (org-sort-entries): Fix sorting partially selected subtree
* 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.
2023-12-17 14:58:44 +01:00
Ihor Radchenko 67ce9386ad
lisp/org.el (org-sort-entries): Fix when end of region is not a bol
* lisp/org.el (org-sort-entries): Avoid putting a heading not at bol
when end of selected region is not at bol.

Reported-by: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Link: https://orgmode.org/list/8d637a8a-6cbc-4158-bded-f9182716a1fc@posteo.de
2023-12-17 14:57:11 +01:00
Ihor Radchenko 420ed4e033
lisp/org.el (org-skip-over-state-notes): Improve docstring 2023-12-11 14:47:02 +01:00
Visuwesh b77f991c02
Add support for yank-media and DND
* 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.
2023-12-10 16:04:02 +01:00
Ihor Radchenko b1cb3b724a
Revert "org-element: Simplify drawer and property drawer regexps"
This reverts commit 2b96501070.

The regexp was actually incorrect and correcting it is not trivial.
2023-12-10 16:03:53 +01:00
Ihor Radchenko 1e8081aeec
Revert "lisp/org.el (org-property-drawer-re): Fix regexp"
This reverts commit 6003637a4d.

The new accurate regexp is making the parser horribly slow.  The
regexp should be fix some other way.
2023-12-10 15:59:23 +01:00
Ihor Radchenko 74006c7ab2
Update version number for the 9.6.13 release 2023-12-10 12:13:40 +01:00
Ihor Radchenko 6003637a4d
lisp/org.el (org-property-drawer-re): Fix regexp
`org-property-re' demands whitespace after property name when the
value is present.  Do the same for property drawer detection.
2023-12-07 15:11:41 +01:00
Ihor Radchenko 315417582f
lisp/org.el (org-mode): Force `tab-width' to be 8
* lisp/org-macs.el (org-current-text-column): Assert `tab-width' to be
8 to ensure consistency of the parser across user configurations.
* etc/ORG-NEWS (~tab-width~ value is now assumed to be 8): Document
the breaking change.

This breaking change is made to standardize Org mode format for list
items.  With variable `tab-width', indentation in lists may depend on
user settings leading to inconsistent Org documents when open by
different users.

Link: https://orgmode.org/list/2c9a6cbd-21c0-45bf-8fbb-4f7eccac4ae7@app.fastmail.com
2023-12-05 14:11:23 +01:00
Kyle Meyer 1e353648ef Merge branch 'bugfix' 2023-12-04 23:33:47 -05:00
Kyle Meyer 3cdb637fcf Merge branch 'km/from-emacs-29' into bugfix 2023-12-04 23:27:04 -05:00
Stefan Kangas dc1230a3b5 Backport commit 5f923ff1a from Emacs
; Fix typos
5f923ff1a6a8a9ff6f06dc49c8e0e2ceee111567
Stefan Kangas
Sun Dec 3 23:31:30 2023 +0100
2023-12-04 23:23:45 -05:00
Ihor Radchenko 57b94f3447
lisp/org.el (org-in-src-block-p): Fix when post-blank has spaces
Reported-by: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Link: https://orgmode.org/list/c286709d-5981-41ba-ac3f-f628f2b0ce34@vodafonemail.de
2023-11-29 11:05:41 +01:00
Ihor Radchenko 6d7c7917a0
lisp/org.el (org-in-src-block-p): Fix when on affiliated or post-blank
* lisp/org.el (org-in-src-block-p): When INSIDE is non-nil, do not
return t for affiliated keywords and post-blank.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/87msuzdkcu.fsf@gmail.com
2023-11-27 21:26:28 +01:00
Ihor Radchenko bd7fab2129
lisp/org.el (org-in-src-block-p): Improve docstring
* lisp/org.el (org-in-src-block-p):

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/87il5n9owq.fsf@gmail.com
2023-11-27 21:25:56 +01:00
Ihor Radchenko b55e388631
Update version number for the 9.6.12 release 2023-11-13 10:23:02 +02:00
Ihor Radchenko 6feef2a279
Merge branch 'bugfix' 2023-11-07 12:52:46 +02:00
Tomohisa Kuranari 93ebd64de1
org-beginning/end-of-line: Fix when moving to different line
* lisp/org.el (org-beginning-of-line, org-end-of-line): Fix issue with
`org-special-ctrl-a/e' not working correctly when moving to different
line.
* testing/lisp/test-org.el (test-org/beginning-of-line,
test-org/end-of-line): Add new tests.
2023-11-07 12:50:40 +02:00
Ihor Radchenko 1014296344
* lisp/org.el (org-comment-dwim): Rely on `org-comment-or-uncomment-region'
Remove special case for src block and instead use the Org's
`org-comment-or-uncomment-region' used as `comment-region-function'.
`org-comment-or-uncomment-region' already supports commenting inside
src blocks.

Fixes https://orgmode.org/list/d8dc0cca-00d9-4349-a123-6ea6776b00cc@vodafonemail.de
2023-11-06 11:14:29 +02:00
Ihor Radchenko cdd73bc955
Update version number for the 9.6.11 release 2023-10-30 12:07:11 +02:00
Ihor Radchenko 098f081591
org-open-at-point: Preserve point unless opening link moves the point
* 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
2023-10-23 14:28:04 +03:00
Ihor Radchenko 8320e4794e
org-entry-get-with-inheritance: Fix inherited explicit nil value
* 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.
2023-10-18 11:37:13 +03:00
Valentin Herrmann 23f751910e
org.el: Respect org-extend-today-until in timestamps with ++
* 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
2023-10-16 11:35:36 +03:00
Ihor Radchenko e54c7e604b
Update version number for the 9.6.10 release 2023-10-08 10:54:43 +03:00
Ihor Radchenko 6c917e8904
org-timestamp-change: Fix increasing range with prefix arg
* 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
2023-09-19 15:31:43 +03:00
Ihor Radchenko a098c07973
* lisp/org.el (org-modify-ts-extra): Refactor the code
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.
2023-09-19 14:57:20 +03:00
Ihor Radchenko edcb8eca5f
(org-fast-tag-selection): Honour tag groups when using <TAB> input
* 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
2023-09-19 12:43:00 +03:00
Ihor Radchenko aee3f2227f
* lisp/org.el (org-mode): Initialize cache before parsing buffer keywords
If we load cache after `org-set-regexp-and-options', we may do double
job as `org-set-regexp-and-options' by itself queries cache.
2023-09-16 11:40:56 +03:00
Ihor Radchenko df0539d678
* lisp/org.el (org-cdlatex-mode): Try to load texmathp
Attempt to load texmathp before setting advice.  `texmathp' is
optional and must be loaded before `cdlatex'.
2023-09-14 12:37:12 +03:00
Ihor Radchenko 515e4ed49b
* lisp/org.el (org--get-expected-indentation): Remove redundant cond clause
Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/87wmwzdwx8.fsf@gmail.com
2023-09-10 10:38:19 +03:00
Jens Schmidt 234650af2e
org-make-tags-matcher: Re-add quoting of property names
* 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
2023-09-03 09:48:41 +03:00
Ihor Radchenko 806abc5a2b
Update version number for the 9.6.9 release 2023-09-03 09:35:50 +03:00
Ihor Radchenko 1665283f25
Merge branch 'bugfix' 2023-08-24 10:18:02 +03:00
Liu Hui 973e50c839
* lisp/org.el (org-at-timestamp-p): Fix match groups in docstring
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.
2023-08-24 10:16:22 +03:00
Ihor Radchenko 19a1a5024b
Update version number for the 9.6.8 release 2023-08-22 10:35:22 +03:00
Ihor Radchenko 7219b006bd
org-element: Fix loading obsolete persistent caches
* 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
2023-08-21 13:24:41 +03:00
Ihor Radchenko 299193bf09
org-display-remote-inline-images: Add new allowed value t
* lisp/org.el (org-display-remote-inline-images): Allow value t as
alias to cache.
(org--create-inline-image): Handle t value.
2023-08-20 14:15:49 +03:00
Ihor Radchenko 7a4784b122
org-fast-tag-selection: Fix when C-g is pressed
* 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.
2023-08-20 09:36:40 +03:00
Ihor Radchenko e17ca87994
Merge branch 'bugfix' 2023-08-20 09:30:59 +03:00
Ihor Radchenko 7b38670e69
fixup! org-insert-heading: Fix when folded text is kept right at the new heading
* lisp/org.el (org-insert-heading): Fix missing newline when inserting
before existing heading.
* testing/lisp/test-org.el (test-org/insert-heading): Add test
checking for the fixed failure.  Update tests.
(test-org/insert-todo-heading-respect-content): Update tests.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/ubrugh$be1$1@ciao.gmane.io
2023-08-20 09:28:15 +03:00
Ihor Radchenko 54f8b0bfd0
Merge branch 'bugfix' 2023-08-19 10:55:08 +03:00
Ihor Radchenko 52bc95676c
org-insert-heading: Fix when folded text is kept right at the new heading
* 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
2023-08-19 10:52:25 +03:00
Ihor Radchenko 928f2d7fb0
Revert "org-return: Do not insert inside folded region"
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'.
2023-08-19 10:27:09 +03:00
Ihor Radchenko 73e332a307
Merge branch 'bugfix' 2023-08-19 10:27:00 +03:00
Ihor Radchenko a25d00d5df
org-return: Do not insert inside folded region
* lisp/org.el (org--newline): When called interactively, check for
invisible edits.

Reported-by: Kaiyu Zheng <kaiyu_zheng@alumni.brown.edu>
Link: https://orgmode.org/list/87wmxs8hxt.fsf@localhost
2023-08-19 10:23:40 +03:00
Ihor Radchenko d1e4b93519
org-copy-subtree: Do not consider inlinetask to be a subtree of its own
* lisp/org.el (org-copy-subtree): Go up to parent heading when we are
at or inside inlinetask.
2023-08-17 14:25:43 +03:00
Jens Schmidt f689eb44f1
org-make-tags-matcher: Add starred property operators, fix quoting
* 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
2023-08-08 10:01:00 +03:00
Ihor Radchenko da8fabf464
org-delete-indentation: Fix Emacs 26 compatibility
* lisp/org.el (org-delete-indentation): `delete-indentation' in Emacs
26 does not yet accept region boundaries.  Provide compatibility
fallback.
2023-08-06 10:22:18 +03:00