Commit Graph

5654 Commits

Author SHA1 Message Date
Ihor Radchenko ba8c468634
org-insert-todo-heading-respect-content: Fix regression in b4e41b
* 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
2023-06-07 15:18:16 +03:00
Ihor Radchenko 661a98f891
org-insert-todo-heading: Update docstring
* lisp/org.el (org-insert-todo-heading): Use docstring construct when
talking about prefix argument.
2023-06-07 15:12:04 +03:00
Ihor Radchenko 07521331c3
org-image-max-width: Allow floating point value as fraction of window width
* 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.
2023-06-02 14:55:36 +03:00
Ihor Radchenko 5b4eebfabd
Prefer `condition-case-unless-debug' where possible
* lisp/org-clock.el (org-clock-play-sound):
* lisp/org-element.el (org-element-at-point):
* lisp/org-src.el (org-src--edit-element):
(org-fontify-inline-src-blocks):
* lisp/org.el (ox):
(org-fontify-meta-lines-and-blocks):
(org-map-dblocks):
* lisp/ox-odt.el (org-odt--export-wrap): Use
`condition-case-unless-debug' to allow more descriptive backtraces
when `debug-on-error' is non-nil.

Link: https://orgmode.org/list/878rdnq1iy.fsf@web.de
2023-06-01 15:05:22 +03:00
Ihor Radchenko 3123caa8e9
org-display-inline-images: Expand environment variables in image path
* lisp/org.el (org-display-inline-images): Expand environment
variables in the link path, just like `org-open-file' does.

Reported-by: Pan Xie <xiepan@skyguard.com.cn>
Link: https://orgmode.org/list/7a012430-6084-e693-1a86-f14d0512bebc@skyguard.com.cn
2023-05-31 11:20:02 +03:00
Ihor Radchenko 24ed8b204e
org-mode-tags-syntax-table: Make the value available outside Org buffers
* 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
2023-05-29 11:30:58 +03:00
Ihor Radchenko 513534f2a7
lisp/org.el: allow org-return to call org-open-at-point on citations
* 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
2023-05-25 14:21:20 +02:00
Ihor Radchenko 9d304d371e
org-indent-line: Remove unnecessary call to `org-element-at-point'
* lisp/org.el (org-indent-line): Do not re-calculate already known
element.
2023-05-18 14:14:58 +02:00
Ihor Radchenko c0cdc5f77c
* lisp/org.el (org-at-heading-p): Do not call redundant `bolp' 2023-05-14 14:08:18 +02:00
Ihor Radchenko 546f2d86d1
org-add-prop-inherited: Avoid modifying S
* lisp/org.el (org-add-prop-inherited): Do not modify argument by side
effect.  Modifying strings may cause unexpected issues when working
with constant strings.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62847
2023-05-14 14:05:27 +02:00
Ihor Radchenko 6e6354c074
org-tags-expand: Do no modify buffer's syntax table by side effect
* lisp/org.el (org-mode-tags-syntax-table): New variable holding
syntax table for tags.
(org-mode): Initialize tag syntax table.
(org-make-tags-matcher): Match tags using appropriate syntax table.
(org-tags-expand): Do no modify syntax table by side effect.

Reported-by: Mattias Engdegård <mattias.engdegard@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#68
2023-05-08 13:23:15 +02:00
Ihor Radchenko 9ea50ca211
Use `calendar-buffer' constant to refer to calendar buffers
* lisp/org-agenda.el (org-agenda-diary-entry-in-org-file):
* lisp/org.el (org-read-date):
(org-eval-in-calendar):
(org-timestamp-change):
(org-recenter-calendar):
(org-get-date-from-calendar): Use `calendar-buffer' instead of
hard-coded "*Calendar*".

Reported-by: Thuna <thuna.cing@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61546
2023-05-02 13:35:12 +02:00
Ihor Radchenko 09cf89f712
org-delete-indentation: Support region selection
* lisp/org.el (org-delete-indentation): Support active region when the
first line in region is a heading.  Clarify in the docstring that
region is ignored with prefix argument.

Reported-by: Spencer Baugh <sbaugh@janestreet.com>
Link: https://orgmode.org/list/ier3552edfr.fsf@janestreet.com
2023-04-30 17:02:58 +02:00
Ihor Radchenko 989cc51499
Prefer "timestamp" over "time-stamp"
* lisp/org.el (org-time-stamp-formats):
(org-timestamp-formats):
(org-time-stamp-rounding-minutes):
(org-timestamp-rounding-minutes):
(org-time-stamp-custom-formats):
(org-timestamp-custom-formats):
(org-time-stamp):
(org-timestamp):
(org-time-stamp-inactive):
(org-timestamp-inactive):
(org-insert-time-stamp):
(org-insert-timestamp):
(org-toggle-time-stamp-overlays):
(org-toggle-timestamp-overlays):
(org-time-stamp-to-now):
(org-timestamp-to-now):
* lisp/ox.el (org-export-time-stamp-file):
(org-export-timestamp-file): Rename using "timestamp" term, keeping
the old name as alias.
* doc/org-manual.org: Update all the uses, adding #+findex and
 #+vindex entries.  Keep the alias names for searchability.

Adjust all the callers.

The following "time-stamp" uses are unchanged:
1. `org-time-stamp-format' where obsolete and _different_ function
   `org-timestamp-format' still exists.
2. :time-stamp-file property in export INFO plist.  Changing this
   would be breaking.
3. ORG-NEWS remains unchanged.
2023-04-30 13:48:52 +02:00
Ihor Radchenko 52d9961f50
org-set-tags-command: Provide more useful error when before first heading
* lisp/org.el (org-set-tags-command): Produce more useful error
message when point is before first heading.
2023-04-28 12:59:19 +02:00
Ihor Radchenko a8dbe8eb38
Merge branch 'bugfix' 2023-04-27 22:42:58 +02:00
Ihor Radchenko 52dc48050e
Handle compiler warnings from Emacs master
* lisp/ob-core.el (org-babel-insert-result): Comment out unused `cond'
clause.  Still leave it there for readability of the logic.
* lisp/org.el (org-agenda-restrict-begin):
(org-agenda-restrict):
(org-agenda-restrict-end): Mark variables from org-agenda.
2023-04-27 22:42:39 +02:00
Ihor Radchenko ef800e3bec
org--collect-keywords-1: Handle FIXME
* lisp/org.el (org--collect-keywords-1): Do not inhibit SETUPFILE in
read-only buffers.

It is unclear what kind of edge case the FIXME is trying to solve.
Yet, there is no reason to inhibit SETUPFILE processing in all the
read-only buffers (which may happen, for example, when refreshing Org
setup with C-c C-c).  Finally, if there is some bug in Gnus (if any)
we should better report it instead of using unexplained workaround.
2023-04-27 22:18:35 +02:00
Ihor Radchenko eaf274909f
Consistently allow null character in block and drawer bodies
Also, do not use [^\000] as a poor-man's replacement for
(rx (or any newline)).

* lisp/ob-core.el (org-babel-src-block-regexp):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs):
* lisp/org-compat.el (org-hide-block-toggle-all):
* lisp/org-element.el:
* lisp/org-feed.el (org-feed-read-previous-status):
(org-feed-parse-rss-feed):
(org-feed-parse-rss-entry):
* lisp/ox-org.el (org-org-publish-to-org):
* testing/lisp/test-ob-tangle.el:
* lisp/org.el (org-block-regexp):
(org-clock-drawer-re): Use \(.\|\n\) regexp instead of [^\000].
(org-latex-regexps): Do not try to match \000 inside latex fragments -
we now use parser for this purpose.

Reported-by: Tommy Kelly <tommy.kelly@verilab.com>
Link: https://orgmode.org/list/875yfk9vlv.fsf@localhost
2023-04-25 21:06:50 +02:00
Ihor Radchenko 9030cc394d
Merge branch 'bugfix' 2023-04-23 16:48:52 +02:00
Ihor Radchenko 92f9135b3c
org-open-at-point: Fix opening multiple file links
* lisp/org.el (org-open-at-point): Keep link selection buffer current
when looping over links to be opened.  Otherwise, opening a link might
change current buffer, breaking the code logic.

Reported-by: cro cefisso <crocefisso@gmx.com>
Link: https://orgmode.org/list/trinity-3a7c01d2-99d9-4b8a-b317-d62c02d75e72-1682242700508@3c-app-mailcom-bs02
2023-04-23 16:47:02 +02:00
Ihor Radchenko 466a37d089
Merge branch 'bugfix' 2023-04-22 15:29:08 +02:00
Ruijie Yu 14dccff8b3
* lisp/org.el org-latex-packages-alist: fixed type definition 2023-04-22 15:25:04 +02:00
Ihor Radchenko f81ba451a7
Prefer "backend" over "back-end"
* doc/org-manual.org (Exporting): Add cindex entry for both "backend"
and "back-end" for better searchability.

All other changes are trivial.

Note that `org-element-export-snippet-parser' will still use :back-end
property.  So will ox.el in INFO channel.
2023-04-20 14:11:19 +02:00
Ihor Radchenko ab85c1b958
org-fold: Allow customizing commands where invisible edits are checked
* lisp/org-fold.el (org-fold-catch-invisible-edits-commands): New
custom option.
(org-fold-catch-invisible-edits): Mention the new custom option in the
docstring.
(org-fold-check-before-invisible-edit-maybe): New function checking
if edits are safe for `this-command'.
(org-fold--advice-edit-commands): New function advising the functions
with `org-fold-check-before-invisible-edit-maybe'.
* lisp/org.el (org-mode): Advice functions on Org startup.
(org-self-insert-command):
(org-delete-backward-char):
(org-delete-char):
(org-meta-return): Do not call `org-fold-check-before-invisible-edit'
and rely on the new advise mechanism instead.
* etc/ORG-NEWS (Commands affected by ~org-fold-catch-invisible-edits~
can now be customized): Announce the change.
* doc/org-manual.org (Catching invisible edits): Mention new
customization.
2023-04-17 15:32:20 +02:00
Ihor Radchenko d57d90964f
Merge branch 'bugfix' 2023-04-16 13:55:39 +02:00
Ihor Radchenko 0f6ae7296e
org-agenda-dim-blocked-tasks: Fix when the value is 'invisible
* lisp/org.el (org-blocked-by-checkboxes): Declare as dynamically
scoped variable.

Reported-by: Gautier Ponsinet <gautier@gautierponsinet.xyz>
Link: https://orgmode.org/list/875y9wrvv1.fsf@gautierponsinet.xyz
2023-04-16 13:53:56 +02:00
Ihor Radchenko f1fd1f22f4
Update version number for the 9.6.4 release 2023-04-15 13:53:24 +02:00
Ihor Radchenko ddd8281e62
lisp/org.el: Allow limiting inline image width
* lisp/org.el (org-image-max-width): New custom variable controlling
max inline image width.
(org--create-inline-image): Use the new variable.
* doc/org-manual.org (Images):
* etc/ORG-NEWS (New customization ~org-image-max-width~ limiting the
displayed inline image width): Document the new variable.
2023-04-09 10:55:50 +02:00
Nathaniel Nicandro 616e80a9f1
Handle block-type when checking `org-src-fontify-natively`
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Only fontify
  natively for blocks of src type.
2023-04-07 12:12:10 +02:00
Ihor Radchenko c2ffc6b602
org-fontify-meta-lines-and-blocks-1: Fontify src blocks without lang
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Allow fontifying
src blocks with language specification missing.
* lisp/org-src.el (org-src-block-faces): Clarify in the docstring that
"" language name referes to src blocks with no language.  Remove
redundant :version tag.
* etc/ORG-NEWS (~org-src-block-faces~ now accepts empty string ~""~ as
language name): Announce the change.

Link: https://orgmode.org/list/99388ff3711696091f0312a5c3f0bcbd@kragelund.me
2023-04-02 16:32:00 +02:00
Ihor Radchenko 6f742685d7
org-metaup: Fix edge case when the upper subtree is moved further below
* lisp/org.el (org-metaup): Work around `org-move-subtree-down'
inserting before end marker.

Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
Link: https://orgmode.org/list/2248cb94-e400-08c7-b76b-bbae2d877ca7@gmail.com
2023-04-02 16:16:06 +02:00
Ihor Radchenko f9bbc79d62
Update version number for the 9.6.3 release
This release is mostly a bugfix for 9.6.2 release tag, which was not
signed and was not annotated.  See
https://orgmode.org/worg/org-maintenance.html#release-tags
2023-04-02 10:36:55 +02:00
Ihor Radchenko 1a6d5f11d0
Merge branch 'bugfix' 2023-03-29 16:59:01 +02:00
Ihor Radchenko 638e0ecc0b
Fix some compiler warnings
* lisp/org.el (org-remove-timestamp-with-keyword): Use `delete-char'
instead of for-interactive-use-only `backward-delete-char'.
(org-fast-tag-selection): Remove unnecessary `condition-case'.
(org-delete-backward-char): Make it explicit that we fall back to
normal interactive call.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62518
2023-03-29 16:58:43 +02:00
Ihor Radchenko e80ba42d62
Merge branch 'bugfix' 2023-03-27 13:14:02 +02:00
Stephen J. Eglen fcd813c406
lisp/org.el: Docstring fixes
* lisp/org.el (org-hide-emphasis-markers)
(org-hide-macro-markers)
(org-pretty-entities-include-sub-superscripts): Follow elisp
convention for docstrings: 'Non-nil means ...'.
2023-03-27 13:11:08 +02:00
Ihor Radchenko c1e8e2ffc7
Update version number for the 9.6.2 release 2023-03-26 11:33:48 +02:00
Aaron L. Zeng 04087be6b3
lisp/org.el: Make predicates non-interactive
* lisp/org.el (org-at-date-range-p):
(org--math-p):
(org-first-sibling-p): Remove interactive spec.

Predicates like `org-first-sibling-p' are no use when called
interactively, and should not appear in the M-x prompt.

TINYCHANGE
2023-03-23 12:59:27 +01:00
Matthew Trzcinski 5a52ee57d4 org-macs.el: Move UUID related code
* org-id.el (org-id-uuid): Move to org-macs.el.

* org.el (org-uuidgen-p): Move to org-macs.el.  Expose regexp used to
match UUID.

* org-macs.el (org-uuid-regexp): Refactor `org-uuidgen-p' to expose
regexp used to match UUID.
2023-03-22 14:08:08 -04:00
Ihor Radchenko 635a601dd5
org-self-insert-command: Do not trigger folding checks
* lisp/org.el (org-self-insert-command): Do not trigger folding checks
for interactive edits.
2023-03-15 15:18:23 +01:00
Ihor Radchenko d6e75d0eeb
org-read-date: Do not consider `org-extend-today-until' with default time
* lisp/org.el (org-read-date): When DEFAULT-TIME time provided, prefer
it even when `org-extend-today-until' dictates -1 day shift.  We
should only consider `org-extend-today-until' for actual today times,
not for future dates, where is becomes confusing.

Reported-by: Tim Ruffing <crypto@timruffing.de>
Link: https://orgmode.org/list/3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de
2023-03-11 10:30:15 +01:00
Ihor Radchenko 1b1d314ada
* lisp/org.el: Bump Org version on development branch 2023-03-05 12:56:02 +01:00
Ihor Radchenko 973669389b
Merge branch 'bugfix' 2023-03-03 15:57:17 +01:00
Gerard Vermeulen e8010e8a91
org.el: Sync org-babel-load-languages with Babel files in Org
* lisp/org.el (org-babel-load-languages): Sync with Babel files

(org-babel-load-languages): Synchronize the defcustom with the rest of
the code base, group languages by Org Babel file, and spell languages
using camel case (the current fashion).

Link: https://list.orgmode.org/712f2ef5b4edb2d9b565f6467e582030@posteo.net/
2023-03-03 15:55:14 +01:00
Ihor Radchenko aa22497876
Merge branch 'bugfix' 2023-02-26 14:43:54 +03:00
Damien Cassou f9aeba5dd7
org.el: Avoid crash in `org-file-contents' in case of network failure
* lisp/org.el (org-file-contents): Wrap the
`url-retrieve-synchronously' call into a `condition-case' block to
avoid throwing an error when NOERROR is non-nil.

TINYCHANGE
2023-02-26 14:42:13 +03:00
Ihor Radchenko 351279ffae
org-diary-to-ical-string: Make sure that temporary file/buffer is cleaned
* lisp/org.el (org-diary-to-ical-string): Clean temporary file buffer
on error.

Reported-by: Alexei Gilev <gerardomoro37@gmail.com>
Link: https://orgmode.org/list/CAF4Fj9gUBj4Ap4noTLP3aSG4owXJ2nydxaqwT4cF5x9DcdhQmg@mail.gmail.com
2023-02-23 12:41:38 +03:00
Ihor Radchenko fe92a3cedb
Provide a uniform way to inform users about missing third-party packages
* lisp/org-macs.el (org-require-package): New macro trying to load a
library and displaying custom error message or warning on failure.
The actual package (not library) name can be provided as optional
argument.

* lisp/ob-R.el (org-babel-R-initiate-session):
* lisp/ob-clojure.el (ob-clojure-eval-with-inf-clojure):
(ob-clojure-eval-with-cider):
(ob-clojure-eval-with-slime):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-haskell.el (org-babel-interpret-haskell):
(org-babel-haskell-initiate-session):
* lisp/ob-js.el (org-babel-execute:js):
(org-babel-js-initiate-session):
* lisp/ob-julia.el (org-babel-julia-initiate-session):
* lisp/ob-lisp.el (org-babel-execute:lisp):
* lisp/ob-ocaml.el (org-babel-prep-session:ocaml):
* lisp/ob-octave.el (org-babel-octave-initiate-session):
* lisp/ob-processing.el (org-babel-processing-view-sketch):
* lisp/ob-ruby.el (org-babel-execute:ruby):
(org-babel-ruby-initiate-session):
* lisp/ol-bbdb.el (org-bbdb-open):
(org-bbdb-complete-link):
(org-bbdb-anniv-export-ical):
* lisp/org-agenda.el:
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org.el:
* lisp/ox-ascii.el (org-ascii-table):
* lisp/ox-html.el (org-html-htmlize-generate-css):
* lisp/ox-org.el: Use the new macro.

* lisp/oc-csl.el: Add FIXME. oc-csl uses a custom function doing
similar job.

* lisp/ob-js.el (org-babel-js-initiate-session): Add FIXME noting that
the third-party package is outdated.
2023-02-17 17:09:23 +03:00
Ihor Radchenko 9e9669a271
Merge branch 'bugfix' 2023-02-10 14:43:41 +03:00