Commit Graph

5786 Commits

Author SHA1 Message Date
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