Commit Graph

27277 Commits

Author SHA1 Message Date
Ihor Radchenko fad90df535
Revert "org-table-make-reference: Disable compiler warning"
This reverts commit bdc60fb936.

Apparently, the branch of if used sometimes and that sometimes is
covered by tests.  Strange.  Leave it be for now.
2024-01-11 15:45:09 +01:00
Ihor Radchenko bdc60fb936
org-table-make-reference: Disable compiler warning
* lisp/org-table.el (org-table-make-reference): Comment out the code
that always returns nil, replacing it with explicit nil.  This line is
certainly a fault in logic, but we do not know of any associated bugs.
So, just leave a FIXME to potential future refactoring and avoid the
compiler complaining about this code every time.
2024-01-11 14:18:35 +01:00
Ihor Radchenko d8b0c23d5c
Merge branch 'bugfix' 2024-01-11 14:15:48 +01:00
Ihor Radchenko 6b60b5ac12
fixup! org-man-open: Fix shell expansion vulnerability (Emacs bug#66390) 2024-01-11 14:15:19 +01:00
Ihor Radchenko 6592c766d2
org-agenda-bulk-mark: Fix mark not being visible when column view is active
* lisp/org-agenda.el (org-agenda-bulk-mark): Use 'before-string in the
mark overlay to make sure that higher-priority Org agenda columns
overlay is not making the mark completely invisible.

Link: https://old.reddit.com/r/orgmode/comments/13jbjep/is_it_possible_to_show_a_selection_mark_in/
2024-01-11 14:12:32 +01:00
Ihor Radchenko 78c1a0f383
doc/org-manual.org (Citation handling): Add index entries
* doc/org-manual.org (Citation handling):
(Citations):
(Citation export processors):
(Bibliography printing): Add variables and keywords to variable index
and concept index.
2024-01-11 13:21:08 +01:00
Ihor Radchenko 8f7efd9d7d
Merge branch 'bugfix' 2024-01-11 13:06:31 +01:00
Ihor Radchenko bc3caa8f90
org-man-open: Fix shell expansion vulnerability (Emacs bug#66390)
* lisp/ol-man.el (org-man-open): Work around Emacs bug#66390.
Implement fix on org side before Emacs commit that fixes the bug.

Link: https://yhetil.org/emacs-bugs/CADwFkmnTMsOM+z0x8FGPGguMtoD9hLrNt9YfbaJ08KPNKW3EbQ@mail.gmail.com/
2024-01-11 13:04:23 +01:00
Ihor Radchenko f6e3b1a805
doc/org-manual.org (Org Syntax): Update reference to syntax document
Also, update information about the maintainer.  The latest version has
been rewritten by Tecosaur.
2024-01-10 16:22:05 +01:00
Ihor Radchenko f22be2878f
org-agenda: Fix hard-coded day lengths when calculating timestamp regexp
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-progress): Do not assume that all the timestamps have
length of exactly 12 (English).  Use options argument for
`org-time-stamp-format' instead to drop brackets from the timestamp.
2024-01-10 16:07:11 +01:00
Ihor Radchenko d0a917ab23
org-agenda-get-progress: Fix detecting time when todo keyword contains ]
* lisp/org-agenda.el (org-agenda-get-progress): Improve accuracy
matching time inside state note.

The old code failed to match time in
- State "[X]"        from "[ ]"        [2022-10-25 Tue 10:00]

Link: https://old.reddit.com/r/orgmode/comments/ycshlg/orgagendalogmode_does_not_display_time_for/
2024-01-10 16:07:06 +01:00
Ihor Radchenko f9702a09e7
org-fold: Fix edge case when revealing fragile folds breaks some Emacs commands
* lisp/org-fold-core.el (org-fold-core--fix-folded-region): Delay
revealing fragile regions to until the current command is executed.
(org-fold-core--region-delayed): New function to postpone folding to
the time when `post-command-hook' is executed.
(org-fold-core--region-delayed-list): New internal variable holding
delayed fold requests.
(org-fold-core--process-delayed): New function to be used to process
the delayed folds and cleanup `post-command-hook'.
*
testing/lisp/test-org-fold.el (test-org-fold/org-fold-reveal-broken-structure):
Update tests to account for the delayed unfolding.

Reported-by: Sebastian Miele <iota@whxvd.name>
Link: https://orgmode.org/list/875y04yq9s.fsf@localhost
2024-01-09 16:42:42 +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 0773f4980c
org-cycle: Throw an error when `org-cycle-max-level' is not positive
* lisp/org-cycle.el (org-cycle): Avoid cryptic regexp error when
`org-cycle-max-level' is not set to positive integer.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25496.14797.512207.593382@gargle.gargle.HOWL
2024-01-09 15:25:50 +01:00
Ihor Radchenko 97951352bb
Fix [[* completion when there is text after point
* lisp/org-pcomplete.el (org-parse-arguments): Parse text between [[*
and point as a single "argument" for pcomplete.  This avoid weird
breakage when treating every space-separated text in the line as an
argument.
(pcomplete/org-mode/searchhead): Do not alter `pcomplete-stub' - it is
no longer necessary as `org-parse-arguments' now takes care about not
including * and ] into the stub.

Warning! pcomplete code is rather tricky and it is not always clear if
Org's approach is not overusing internals of pcomplete.

Reported-by: Ignacio Casso <ignaciocasso@hotmail.com>
Link: https://orgmode.org/list/87ils0lut8.fsf@localhost
2024-01-07 16:50:40 +01:00
Ihor Radchenko 804d032685
Update version number for the 9.6.16 release 2024-01-07 12:25:20 +01:00
Kyle Meyer aab2c94531 Update copyright years for main-only files 2024-01-06 16:06:47 -05:00
Kyle Meyer 72a2db86d9 Merge branch 'bugfix' 2024-01-06 16:02:02 -05:00
Kyle Meyer 1666eeef55 Update remaining copyright years
Most copyright years were updated with the port of Emacs's 8e1c56ae4
in 9f1d6dfd7.  Update the remaining copyright years for files that
have Free Software Foundation as the copyright holder but aren't
included in the Emacs repo.
2024-01-06 15:55:18 -05:00
Kyle Meyer 54acceb971 Merge branch 'km/from-emacs-29' into bugfix 2024-01-06 15:52:07 -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 fa198cbbe4
org-agenda-search-headline-for-time: Ignore all the timestamps in headings
* lisp/org-agenda.el (org-agenda-format-item): When
`org-agenda-search-headline-for-time' is non-nil, exclude timestamps
in headings from searching the time.
(org-agenda-search-headline-for-time): Remove warning about timestamps
in headings from the docstring.
* etc/ORG-NEWS (~org-agenda-search-headline-for-time~ now ignores all
the timestamp in headings): Announce the change.

Reported-by: rameiko87@posteo.net
Link: https://orgmode.org/list/dc5c0aa3748f5d7ad8b79bea674266e7@posteo.net
2024-01-06 13:29:43 +01:00
Ihor Radchenko b6643884cb
ob-R, ob-julia: Use `ess-gen-proc-buffer-name-function' to control session buffer name
* lisp/ob-R.el (org-babel-R-initiate-session):
* lisp/ob-julia.el (org-babel-julia-initiate-session): Do not use the
hack with renaming ESS buffer and instead indicate the session buffer
name to ESS appropriately through `ess-gen-proc-buffer-name-function'.

Link: https://orgmode.org/list/871qb21bp7.fsf@gmail.com
2024-01-05 14:56:21 +01:00
Ihor Radchenko c10a079a2c
org-edit-src-code: Setup Org Src buffer context before running `org-src-mode-hook'
* lisp/org-src.el (org-edit-src-code): Make sure that
`org-coderef-label-format' and `org-src--babel-info' are set before
`org-src-mode-hook' is executed.  Earlier,
`org-src-babel-configure-edit-buffer' that is by default present in
the hook would do nothing as it relies upon `org-src--babel-info'
being set.
2024-01-05 14:33:42 +01:00
Ihor Radchenko b4687fcd69
Revert "lisp/org-src.el: Suppress compiler warnings for obsolete code"
This reverts commit 3b71939903.
2024-01-05 14:31:31 +01:00
Ihor Radchenko 99c9cae25c
Revert "Obsolete `org-src-associate-babel-session' and related functionality"
This reverts commit 7926045ff5.

`org-src-associate-babel-session' is still useful because:

1. It indicates the need to implement session association to babel
   backend (although we still need to make it more clear for backend
   authors in future).

2. It provides infrastructure for more granular control over session
   association for third-party packages.  For example, we might want
   to disabled session association when it can cause unwanted side
   effects, like starting comint process unconditionally (looking at
   ob-R and other ess-based backends).
2024-01-05 14:20:14 +01:00
Ihor Radchenko aeebac3780
lisp/org-id.el: Fix inaccuracy in the commentary
Reported-by: Stephen J. Eglen <sje30@cam.ac.uk>
Link: https://orgmode.org/list/m234vceq40.fsf@cam.ac.uk
2024-01-05 13:31:27 +01:00
Ihor Radchenko d8586fb601
Remove mentions of semi-obsolete `org-tags-match-list-sublevels' from manuals
* doc/org-guide.org (Tag searches):
* doc/org-manual.org (Tag Inheritance):
(Tag Searches):
(Property Searches):
(Matching tags and properties): Do not link
`org-tags-match-list-sublevels' customization.  We declare it
semi-obsolete, so the manual and the guide should not encourage using
it.
2024-01-04 16:50:49 +01:00
Nafiz Islam a27a1b87b5
lisp/org-agenda.el (org-todo-list): Rename variables and format
* lisp/org/org-agenda.el
(org-todo-list): Use `org-today' directly for `calendar-gregorian-from-absolute'.
(org-todo-list): Replace `date' with `today' (`date' is no longer used).
(org-todo-list): Replace `kwds' with `todo-keywords'.
(org-todo-list): Replace `rtn' with `todo-entries'.
(org-todo-list): Replace `rtnall' with `all-todo-entries'.
(org-todo-list): Replace some `and' with `when' and `cond'.
(org-todo-list): Some whitespace changes.

TINYCHANGE
2024-01-04 16:00:07 +01:00
Ihor Radchenko 6d1c1721e3
Merge branch 'bugfix' 2024-01-04 15:15:18 +01:00
Ihor Radchenko 4279b84a1f
org-lint-invalid-cite-export-declaration: Do not warn about not-yet-loaded processors
* lisp/org-lint.el (org-lint-invalid-cite-export-declaration): Fix
false-positive warning when cite processor is not yet loaded.

Reported-by: gerard.vermeulen@posteo.net
Link: https://orgmode.org/list/a142147a781384402547d49859fa3287@posteo.net
2024-01-04 15:14:19 +01:00
Ihor Radchenko d6117f895c
org-element-cache: Provide Elisp API to store user data inside the cache
* lisp/org-element.el (org-element-cache-store-key):
(org-element-cache-get-key): New functions to store and retrieve data
associated with cached nodes.  The data is stored inside
:fragile-cache and :robust-cache node properties.
(org-element--cache-shift-positions): Clear :fragile-cache when the
contents boundaries are changed.  Optimize when OFFSET is 0.
* lisp/org-element.el (org-element--cache-process-request): Call
`org-element--cache-shift-positions' even for 0 offset to account for
:fragile-cache.
* etc/ORG-NEWS (New API functions to store data within
~org-element-cache~): Announce the new API.
* testing/lisp/test-org-element.el (test-org-element/cache-get-key):
New test.
2024-01-04 14:23:08 +01:00
Alexandre Avanian 3aac00e45d
lisp/org-indent.el: Add hook to run after it initializes a buffer
* lisp/org-indent.el (org-indent-initialize-buffer): Define and call
hook after it initializes a buffer.
* etc/ORG-NEWS: Announce new custom option.

This will allow to enrich org-indent properties without requiring
hacks to detect initialization.
See https://list.orgmode.org/orgmode/5f4cdb77-8f43-4f2d-91a7-bc4ce57df8ad@app.fastmail.com/#r

TINYCHANGE
2024-01-03 16:34:59 +01:00
Ihor Radchenko dfeff03c5a
lisp/org-element-ast.el (org-element-copy): Fix altering source element
* testing/lisp/test-org-element.el (test-org-element/copy): Add new
test case.

Reported-by: gerard.vermeulen@posteo.net
Link: https://orgmode.org/list/e0252d664af25728243734d67432ad64@posteo.net
2024-01-03 15:57:01 +01:00
Jack Kamm d57d3bd9bb ob-python: Remove :version from variables with :package-version 2023-12-31 10:32:55 -08:00
Jack Kamm 9239b0e8d1 ob-python: Changed options for default Python command
ob-python will now use the same settings as `run-python' when starting
interactive sessions, by default.

* lisp/ob-python.el (org-babel-python-command): Changed to have
additional `auto' option, which is the new default value.
(org-babel-python-command-session): New option to control default
session Python command.
(org-babel-python-command-nonsession): New option to control default
nonsession Python command.
(org-babel-python--command): New function to determine the command to
run Python.
(org-babel-python-initiate-session-by-key): Call `run-python' without
CMD arg.  Instead, set `python-shell-interpreter' and
`python-shell-interpreter-args' from `org-babel-python--command' when
needed.
(org-babel-python-evaluate-external-process): Use
`org-babel-python--command' to start Python.
2023-12-31 08:29:20 -08:00
Ihor Radchenko 478b40d99e
Update version number for the 9.6.15 release 2023-12-31 12:59:12 +01:00
Kyle Meyer f348adce0d Merge branch 'km/from-emacs-29' into bugfix 2023-12-30 22:34:57 -05:00
Stefan Kangas 38ccb77196 Backport commit 55555a6a0 from Emacs
* lisp/org-protocol.el: Minor copy-edits to Commentary.

org-protocol: Minor copy-edits to Commentary
55555a6a0d1d76468f8327972b3cb067b9e35f24
Stefan Kangas
Sat Dec 30 17:53:53 2023 +0100
2023-12-30 22:33:14 -05:00
Jack Kamm d526ab5388 fixup! ob-python: Test and improve robustness for externally started python
*
lisp/ob-python.el (org-babel-python--python-util-comint-end-of-output-p):
Backport python-util-comint-end-of-output-p for emacs28.
(org-babel-python-initiate-session-by-key): Use backported version of
python-util-comint-end-of-output-p.
2023-12-29 08:44:17 -08:00
Jack Kamm d0d838b02e ob-python: Test and improve robustness for externally started python
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Wait
for first prompt for pre-existing python processes.  Document behavior
for pre-existing python processes.
(org-babel-python-initiate-session): Document behavior for
pre-existing python processes.
*
testing/lisp/test-ob-python.el (test-ob-python/session-with-existing-inferior-python):
New test for working with existing python processes.
2023-12-29 07:46:49 -08:00
Ihor Radchenko 996441fd56
lisp/ox-odt.el: Do not alter `auto-mode-alist'
Reported-by: Peter Prevos <peter@prevos.net>
Link: https://orgmode.org/list/87wmtoosru.fsf@prevos.net
2023-12-29 16:33:54 +01:00
Ihor Radchenko 69e746c1e4
lisp/ox-odt.el: Do not open the generated exported file in the background
* lisp/ox-odt.el (org-odt--export-wrap): Do not open the exported file
in the background.  Such behavior is not consistent with the other
export backends and is not documented (users don't know about it).
* etc/ORG-NEWS (ODT export no longer opens the exported file in the
background): Document the breaking change.
2023-12-29 16:33:54 +01:00
Ihor Radchenko d15e52fef4
org-element: Distinguish between [[/path/to]] and [[file:/path/to]] links
* lisp/org-element.el (org-element-link-parser): Record information
whether link type: is implicit or explicitly provided in the input
text.  The information is saved into new link object property
`:type-explicit-p'.
(org-element-link-interpreter): Take into account `:type-explicit-p'
when interpreting link object.
(org-element-cache-version): Bump AST version.
* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
Add new test.

Reported-by: Joseph Turner <joseph@ushin.org>
Link: https://orgmode.org/list/87o7e9ei3p.fsf@ushin.org
2023-12-29 15:44:10 +01:00
Justin Vallon 684aff8eeb
org-persist--gc-orphan-p: Fix Emacs 26.1 compatibility
* lisp/org-compat: Add org-assoc-delete-all from compat/compat-27.el.
* lisp/org-persist.el (org-persist--gc-orphan-p): Use
org-assoc-delete-all.

TINYCHANGE
2023-12-28 23:57:02 +01:00
Ihor Radchenko 80ce6152ba
lisp/org-table.el: Improve cell alignment accuracy
* lisp/org-macs.el (org-string-width): Add new optional argument
providing reference face to be used for relative width calculation.
Use `ceiling' when the total string width is a fraction of "a" width.
* lisp/org-table.el (org-table-blank-field):
(org-table-clean-line):
(org-table--shrink-field):
(org-table--align-field):
(org-table-align):
(org-table-justify-field-maybe): Use org-table face as reference for
width calculation.

When org-table face is not default, `org-string-width' may not return
correct width as " " and "-" in the table may not have the same width
as "a" with default face used as reference in `org-string-width'.
With this patch, the width calculation becomes more accurate, although
may still be off if the table faces are customized to be more
piece-mill.

Reported-by: ltmsyvag
Link: https://emacs-china.org/t/org-9-6-5-org/24484
2023-12-28 16:17:03 +01:00
Pedro A. Aranda 5092ecd46a
Reword biblatex documentation 2023-12-27 14:49:05 +01:00
Ihor Radchenko 60f357e8bf
doc/org-manual.org: Clarify that inline code blocks cannot be named
* doc/org-manual.org (Structure of Code Blocks):
2023-12-26 16:36:51 +01:00
Ihor Radchenko 5185339fe6
Merge branch 'bugfix' 2023-12-25 19:57:41 +01:00
Ihor Radchenko 4ad7ae2520
lisp/org-element-ast.el: Add a comment why no `org-element-properties' 2023-12-25 15:56:03 +01:00