Commit Graph

18031 Commits

Author SHA1 Message Date
Ihor Radchenko 514e3a9cd2
org-export: Suppress cache persistence in buffer copies during export
* lisp/org-element.el (org-element-cache-reset): Add new optional
argument that suppresses all persistence-related calculations.
* lisp/org-table.el (org-element-cache-reset):
* lisp/org.el (org-element-cache-reset): Update function signature.
* lisp/ox.el (org-export--generate-copy-script): Do not try to use
cache persistence in throwaway buffer copies.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:17 +08:00
Ihor Radchenko 09fd5f886a
org-html-format-latex: Avoid unnecessary string allocation
* lisp/ox.el (org-export--generate-copy-script): Add new optional
arguments to limit what is being copied.
(org-export-copy-buffer): Allow copying into provided buffer and copy
selectively passing the new optional arguments to
`org-export--generate-copy-script'.  Do not try to check if all the
local variable values are `read'able - it is only needed during async
export.
* lisp/ox-html.el (org-html-format-latex): Re-use the same hidden
buffer during export.  Only copy local variables into that buffer.

This commit avoids excessive calls to `org-mode' and copying the
exported buffer contents for every single latex fragment.  The result
is lower impact on GC and better overall performance.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:16 +08:00
Ihor Radchenko b45911d41e
org-export-copy-buffer: Prevent saving to disk
* lisp/ox.el (org-export--generate-copy-script): Prevent Emacs from
ever saving copied buffer contents to disk despite `buffer-file-name'
being set to the original value.
2022-10-07 13:15:15 +08:00
Ihor Radchenko 0551eba40c
org-export-get-ordinal: Cache results
* lisp/ox.el (org-export-get-ordinal): Cache results while counting to
avoid quadratic scaling.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:14 +08:00
Ihor Radchenko 4cb1b8ebd0
org-export-ignored-local-variables: Do not copy cache
* lisp/ox.el (org-export-ignored-local-variables): Do not copy buffer
cache.  It is large by size (and, thus, slow to `read') and may be
changed destructively by reference, interfering with the original
buffer when calling `org-export-copy-buffer'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:14 +08:00
Ihor Radchenko aa90e5b59c
org-export-with-buffer-copy: Avoid all the hooks, not just `org-mode-hook'
* lisp/ox.el (org-export--generate-copy-script): Use
`delay-mode-hooks' to disable all the hooks to be executed instead of
only `org-mode-hook'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:13 +08:00
Ihor Radchenko 5a167f6ef2
org-element-cache-reset: Never use cache persistence in non-file buffers
* lisp/org-element.el (org-element-cache-reset): Disable cache
persistence in non-file buffers.  In particular, do not try to restore
cache for temporary buffers based on their contents hash.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:12 +08:00
Ihor Radchenko 279bee087d
org-element-clock-line-re: Fix Emacs 26 compatibility after e305755b1
* lisp/org-element.el (org-element-clock-line-re): Use Emacs
26-compatible `rx' notation.
2022-10-07 13:09:32 +08:00
Rudolf Adamkovič a220492064
ob-sed: Fix typo
* lisp/ob-sed.el: Fix a typo in a comment
2022-10-07 12:10:21 +08:00
Jonas Bernoulli 9b690462a3
Allow returning empty list from post-processing block
* lisp/ob-ref.el (org-babel-ref-resolve): When the result an empty
list, then treat it as a list, not as the symbol nil.
* testing/lisp/test-ob.el (test-ob/post-header-arguments): Add new
test.
* etc/ORG-NEWS (Post-processing code blocks can return an empty list):
Document change in behavior.
2022-10-07 12:06:30 +08:00
Stefan Kangas 0b67b9f64f
Improve documentation of org-kill-line
* lisp/org.el (org-special-ctrl-k): Doc fix; clarify what is being
killed and improve wording.  Add command substitutions.
(org-kill-line): Doc fix; mention user options that this command
relies on.
2022-10-07 11:47:45 +08:00
Stefan Kangas e28e3aaabb
Improve documentation of org-agenda-skip-*
* doc/org-manual.org (Special Agenda Views): Improve indexing.
* lisp/org-agenda.el (org-agenda-skip-function)
(org-agenda-skip-entry-if, org-agenda-skip-subtree-if): Expand
docstrings.
(org-agenda-skip-if): Doc fix; clarify wording.
2022-10-07 11:47:44 +08:00
Stefan Kangas 101280aa66
Add crossreference to org-stuck-projects docstring
* lisp/org-agenda.el (org-stuck-projects): Add Info manual reference
to docstring.
2022-10-07 11:47:43 +08:00
Liu Hui edf5afc1d8
Fix filter preset problem for sticky agenda
* lisp/org-agenda.el (org-agenda-local-vars):
(org-agenda-filters-preset): Add a new variable
`org-agenda-filters-preset' for storing per-buffer filter presets.
(org-agenda):
(org-agenda-filter-any):
(org-agenda-prepare):
(org-agenda-finalize):
(org-agenda-redo):
(org-agenda-filter-by-tag):
(org-agenda-filter-make-matcher):
(org-agenda-set-mode-name):
(org-agenda-reapply-filters): Use `org-agenda-filters-preset' for
getting and setting per-buffer filter presets, rather than modifying
the global symbol property.  Change `org-lprops' from symbol property
to per-buffer text property.  Delete unused `last-args' symbol
property.
* testing/lisp/test-org-agenda.el (test-org-agenda/sticky-agenda-filter-preset):
(test-org-agenda/redo-setting): Add tests.
2022-10-07 11:43:32 +08:00
Ihor Radchenko f0b7dfb3a0
org-table: Repair table before inserting rows/columns
* lisp/org-table.el (org-table-insert-column):
(org-table-insert-row): Repair the table as needed before inserting.
The internal insertion logic assumes that the table is valid.  The
rapair checks are copied from `org-table-insert-hline'.

Reported-by: Mauro Aranda <maurooaranda@gmail.com>
Link: https://orgmode.org/list/87o8csah5t.fsf@localhost
2022-10-06 16:22:57 +08:00
Ihor Radchenko 224708323e
org-clock: Do not assume that clock is always inside capture buffer
* lisp/org-capture.el (org-capture): Store the clock marker in `org-capture-clock-was-started'.
(org-capture-clock-was-started): Document that the variable holds
clock marker.
(org-capture-finalize): Check the stored value of the clock marker
when deciding if the currently running clock has been started by
capture.

Reported-by: Bernt Hansen <bernt@norang.ca>
Link: https://orgmode.org/list/878rza7c0w.fsf@localhost
2022-10-06 16:00:59 +08:00
Ihor Radchenko 2c8bd0cc9b
org-fill-element: Respect region selection when filling src-block
* lisp/org.el (org-fill-element): When region is not active, run
`fill-paragraph' at point inside src block.  When region is active and
within src block boundaries, run `fill-paragraph' preserving the
region.  When region is active and crosses src block boundaries, fill
the whole src block.

Reported-by: Fabio Natali <me@fabionatali.com>
Fixes: https://orgmode.org/list/201b44de-1f97-1b23-1767-970ee00f259c@posteo.eu
2022-10-05 13:20:58 +08:00
Ihor Radchenko ceb99b8600
org-table-fix-formulas: Ensure shifting columns after removing invalid
* lisp/org-table.el (org-table-fix-formulas): Search from the
beginning of table formula when shifting moved column numbers.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
Link: https://orgmode.org/list/87r1gaw0av.fsf@mat.ucm.es
2022-10-05 13:13:36 +08:00
Ihor Radchenko e305755b1a
org-element: Parse malformed clock lines as paragraphs
* lisp/org-element.el (org-element-clock-line-re): Update the regexp
matching the actual required clock line structure.
(org-element--set-regexps): Use `org-element-clock-line-re'.

Link: https://orgmode.org/list/87h7571bpb.fsf@localhost
2022-10-05 12:51:46 +08:00
Kyle Meyer 1f8cc85542 org-agenda: Replace 29.1 version keywords with package-version
* lisp/org-agenda.el (org-agenda-block-separator):
(org-agenda-time-grid):
(org-agenda-current-time-string): Replace version keyword with
package-version keyword.

Prefer package-version so that the help buffer shows

  This variable was introduced, or its default value was changed, in
  version 9.6 of the Org package that is part of Emacs 29.1.

rather than

  This variable was introduced, or its default value was changed, in
  version 29.1 of Emacs.
2022-10-04 21:07:19 -04:00
Kyle Meyer 95a4c59bfe compat: Add compatibility wrapper for format-prompt
* lisp/org-compat.el (org-format-prompt): New compatibility
function.
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Use org-format-prompt.

Prefer a wrapper to inlining compatibility kludges.

This is a follow-up to the port of Emacs's 664094222.
2022-10-04 18:38:25 -04:00
Kyle Meyer 07b6a0e044 compat: Use org- wrapper for string-equal-ignore-case compatibility
* lisp/org-compat.el (org-string-equal-ignore-case): New compatibility
function.
(org-mode-flyspell-verify):
* lisp/ob-core.el (org-babel-results-keyword):
(org-babel-insert-result):
* lisp/org-lint.el (org-lint-duplicate-custom-id):
* lisp/ox.el (org-export-resolve-radio-link):
Use org-string-equal-ignore-case.

Prefer an explicit org- wrapper to isolate the kludge and avoid any
confusion about where it is defined.

This is a follow-up to the port of Emacs's 70341cab3.
2022-10-04 18:38:25 -04:00
Kyle Meyer 75d63533d3 compat: Move string-equal-ignore-case to correct section
Emacs's 70341cab3 put this in the "Emacs < 24.4 compatibility" section
(which no longer exists in main), but string-equal-ignore-case is new
to Emacs 29.
2022-10-04 18:38:25 -04:00
Kyle Meyer 98e168b489 compat: Add compatibility wrapper for string-clean-whitespace
* lisp/org-compat.el (org-string-clean-whitespace): New compatibility
function.
* lisp/ox.el (org-export-resolve-radio-link): Use
org-string-clean-whitespace.

This is a follow-up to the port of Emacs's 70341cab3.
2022-10-04 18:38:25 -04:00
Kyle Meyer 0e0fe76ae4 ox-icalendar: Fix time zone construct from recently ported commit
* lisp/ox-icalendar.el (org-icalendar--combine-files): Correct typo in
format-time-string specifier.

This is a follow-up to the port of Emacs's e0ca8f791.
2022-10-04 18:38:25 -04:00
Kyle Meyer 6dd736ab35 ol-eshell: Make recently ported change compatible with Emacs < 29
* lisp/ol-eshell.el (org-eshell-open): Inline action if
display-comint-buffer-action isn't bound.

This is a follow-up to the port of Emacs's 18b680cfd.
2022-10-04 18:38:25 -04:00
Kyle Meyer abc34b458f org-mouse: Make recently ported change compatible with Emacs < 29
* lisp/org-mouse.el (org-mouse-show-context-menu): Conditionally
restore old code path, falling back to double-click-time if
mouse-double-click-time isn't available.

This is a follow-up to the port of Emacs's 2fba71cf1.
2022-10-04 18:38:25 -04:00
Kyle Meyer 42c418693f Merge branch 'km/from-emacs-master' 2022-10-04 18:37:42 -04:00
Kyle Meyer aeb934b598 Merge branch 'km/from-emacs-28' 2022-10-04 18:36:31 -04:00
Kyle Meyer 631d4eb6af org-macs: Move org-current-text-indentation to silence byte-compiler
Move org-current-text-indentation upstream of first use to avoid 'make
single' (and the Emacs repo) reporting

  org-macs.el:1106:11: Warning: macro ‘org-current-text-indentation’ defined too
      late
2022-10-04 18:36:19 -04:00
Lars Ingebrigtsen 9b62bcc9c6 Backport commit 8dacd8cd9 from Emacs
* lisp/org/org-macro.el (vc-exec-after): Update declaration.

Add a new command vc-pull-and-push
8dacd8cd914fdbe0f6f17ca57915611d48e9124d
Lars Ingebrigtsen
Sat Sep 24 15:19:03 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas c2c8e66e5d Backport commit b7e867b84 from Emacs
Make point-at-eol and point-at-bol obsolete
b7e867b841f47dcff3aeaef9b5608a237386ce70
Stefan Kangas
Tue Aug 23 04:54:57 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7d0.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 9c2bc2877f Backport commit 06d716147 from Emacs
Fix some no-X build warnings
06d7161476255c77defa119fffa842b7abaa0dcb
Lars Ingebrigtsen
Mon Aug 22 19:22:33 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen add8552b1d Backport commit 48aacbf29 from Emacs
* lisp/oc-basic.el (org-cite-basic--set-keymap): Adjust
buffer-substring generalized variable usage.

Make many seldom-used generalized variables obsolete
48aacbf292fbe8d4be7761f83bf87de93497df27
Lars Ingebrigtsen
Sun Aug 21 22:12:43 2022 +0200

[ km: This was independently covered on the main branch with
  a526ea6a3.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Stefan Kangas e58217ff1f Backport commit 57259773b from Emacs
; * lisp/org/org.el: Delete unnecessary declarations.
57259773b4f0b992e38843859a8b93d82317ded3
Stefan Kangas
Sun Aug 14 23:46:33 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas 25e638f726 Backport commit 1137219c9 from Emacs
Make compat alias image-refresh obsolete
1137219c97dda512a309ce4bfad5abde0d2be206
Stefan Kangas
Tue Aug 9 14:04:39 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7d0.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Peder O. Klingenberg 2ac8c44f04 Backport commit b335e1a04 from Emacs
* lisp/org.el (eq): Fix load of compiled or compressed
org-loaddefs (bug#56982).

* lisp/org/org.el: Fix load of compiled or compressed org-loaddefs
b335e1a0469105bb55b9741ae3106dc0a6023ce2
Peder O. Klingenberg
Thu Aug 4 20:27:56 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas 883f87c3e7 Backport commit 4d64c39fa from Emacs
; * lisp/org/ob-lilypond.el: Add FIXME.
4d64c39fad481f2dc125aa4d207ab191bf697529
Stefan Kangas
Thu Aug 4 14:48:44 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 1bbd86310a Backport commit 4c1bc8315 from Emacs
* lisp/ob-core.el (org-src-sha): Avoid triggering the
`register-definition-prefixes' in doc strings (bug#56968).

Fix up some prefix registration problems in doc strings
4c1bc8315d8e677e4eeb2760d7a5ab7b7553359b
Lars Ingebrigtsen
Thu Aug 4 11:03:10 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen e9df837d8a Backport commit 0a6e2b3bf from Emacs
* lisp/ox.el (org-export-to-file): Fix quoting of #' in doc strings.

Fix quoting of #' in some doc strings
0a6e2b3bfce8b5ae9e713e0668cb3cf5609073e2
Lars Ingebrigtsen
Wed Aug 3 13:14:32 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 19c3969e75 Backport commit 2682ea1b3 from Emacs
* lisp/org.el (org-dynamic-block-define): Autoload because
it's referred to in org-loaddefs.el.

Fix org.el byte-compile warning in org-loaddefs.el
2682ea1b3a9524eb54efac41b3221b514374c232
Lars Ingebrigtsen
Sun Jul 31 11:43:48 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas e7059f7dbe Backport commit 22a5f0223 from Emacs
* lisp/org.el (org-file-apps):
Doc fixes; don't mention XEmacs specific library EFS.

Doc fixes: don't mention EFS
22a5f022344af8c0c0a9eddc2ac5ad36392d0cef
Stefan Kangas
Thu Jul 28 10:48:38 2022 +0200
2022-10-04 17:18:04 -04:00
Sam Steingold e614a763ca Backport commit 70341cab3 from Emacs
* lisp/ob-core.el (org-babel-results-keyword):
  Use `string-equal-ignore-case' instead of explicit `compare-strings'.
(org-babel-insert-result): Likewise.
* lisp/org-compat.el (string-equal-ignore-case):
  Define unless defined already.
(org-mode-flyspell-verify): Use `string-equal-ignore-case'.
* lisp/org-lint.el (org-lint-duplicate-custom-id): Likewise.
* lisp/ox.el (org-export-resolve-radio-link): Use
  `string-equal-ignore-case' and `string-clean-whitespace'.

string-equal-ignore-case: new function
70341cab3eb26e2f49bbc13d6bca247ab9403abc
Sam Steingold
Tue Jul 26 13:49:28 2022 -0400

[ km: Note that string-clean-whitespace also requires a compatibility
  kludge and the string-equal-ignore-case kludge was added to the
  wrong org-compat section.  These will be addressed in a follow-up
  commit. ]
2022-10-04 17:17:22 -04:00
Mattias Engdegård 1adbaca75a Backport commit 563bf2fae from Emacs
; * lisp/org/ol.el (org-link--decode-compound): `lsh` -> `ash`
563bf2fae5ec238172f1f16c81e51b9aadd77017
Mattias Engdegård
Wed Jul 20 13:51:55 2022 +0200
2022-10-04 17:10:50 -04:00
Stefan Kangas 07ca33e603 Backport commit 2a05479c2 from Emacs
; Fix typos: prefer American spelling
2a05479c221d4a13b15ed731e4eb1c0de99e97ed
Stefan Kangas
Thu Jul 14 12:13:31 2022 +0200
2022-10-04 17:10:50 -04:00
Stefan Kangas 69ba7a20be Backport commit 2a8d08360 from Emacs
The w3 package was removed from GNU ELPA in 2020 as it doesn't run on
a recent Emacs, and development had stopped over a decade before that.
If anyone wants to revive the w3 package, they should look this all
over, but it doesn't make sense for us to maintain this support code.
Ref: https://debbugs.gnu.org/25395

* lisp/ol.el (org-store-link): Remove w3 support code and related
documentation and comments.  (Bug#56435)
* doc/org-manual.org (Handling Links): Don't mention W3.

Drop support for the dead third-party w3 package
2a8d083607e7e0fe9358f1f6526dbd8aa928af61
Stefan Kangas
Sat Jul 9 17:27:49 2022 +0200
2022-10-04 17:10:50 -04:00
Stefan Kangas 675ec6771f Backport commit 9230953f2 from Emacs
; Fix typos.
9230953f23c432699347bb3eeadebd82e4cbbfaa
Stefan Kangas
Sat Jul 2 10:20:23 2022 +0200
2022-10-04 17:10:50 -04:00
Ihor Radchenko c77692e8fb Backport commit f94e93a6e from Emacs
* lisp/oc.el (org-cite-list-citations): Avoid quadratic complexity.
Pre-calculate list of all footnote definitions and cache the footnote
label search hits.  Do not make `org-element-map' accumulate unused
result.

org-cite-list-citations: Cache footnote-definition searches
f94e93a6eec92d834a6b545d8d4b68280b0993b0
Ihor Radchenko
Thu Jun 16 10:55:05 2022 +0300

[ km: This ported commit comes from main's b061e7b61.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 0da6c49f75 Backport commit 4f37a3b29 from Emacs
* lisp/org-element.el (org-element-map): Do not call `(plist-get info
:ignore-list)' on every iteration.

org-element-map: Avoid repetitive `plist-get' call
4f37a3b299bcec71a0e9bdd84b7b226494006fe4
Ihor Radchenko
Thu Jun 16 10:54:14 2022 +0300

[ km: This ported commit comes from main's 37a447ae0.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 8ac9203d5c Backport commit 979308b4c from Emacs
* lisp/ox.el (org-export-data): Use temporary buffer to collect export
data instead of `mapconcat'.  Using buffer puts less load on garbage
collector.

org-export-data: Concatenate strings in temporary buffer for performance
979308b4cad2b573606ed71a1689a47a9e7a9e98
Ihor Radchenko
Thu Jun 16 10:53:51 2022 +0300

[ km: This ported commit comes from main's a158b263a and was reverted
  in 811deae32.  I'm applying it here too for bookkeeping/traceability
  purposes, but these changes will be discarded when merged with
  main. ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 4ae72c6174 Backport commit 0f7ceb480 from Emacs
* lisp/ox.el (org-export-as): Use `buffer-chars-modified-tick' and
avoid extra invocations of `org-set-regexps-and-options' and
`org-update-radio-target-regexp' when the buffer is not changed.
Also, disable folding checks.  Folding is irrelevant inside export
buffer.

org-export-as: Do not update buffer settings when not modified
0f7ceb4803cabcb3c406fa7c27ccb7625096058e
Ihor Radchenko
Thu Jun 16 10:53:16 2022 +0300

[ km: This ported commit comes from main's 076dd92ac.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 4f8ea50604 Backport commit d21412df0 from Emacs
* lisp/ox.el (org-export-resolve-id-link): Pre-cache all the ids in
the parse tree for faster lookup.

org-export-resolve-id-link: Pre-cache all the ids in the parse tree
d21412df06b99b551e67d39c097d95e8a284de73
Ihor Radchenko
Thu Jun 16 10:52:54 2022 +0300

[ km: This ported commit comes from main's 84c89ea7c.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 07c5d066aa Backport commit 3236dedc2 from Emacs
* lisp/ox.el (org-export-resolve-fuzzy-link): Before matching LINK,
pre-process and cache all the non-nil search cells in the parse tree.
When matching, use the pre-processed info.  Fix the :test function for
the cache hash table.

org-export-resolve-fuzyy-link: Pre-cache all possible search cells
3236dedc2de5975afde877f7460bd012da89a98d
Ihor Radchenko
Thu Jun 16 10:52:36 2022 +0300

[ km: This ported commit comes from main's 792cd4b0a.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Ihor Radchenko 303c89350e Backport commit 5b3d4e7bf from Emacs
* lisp/ox.el (org-export-get-footnote-definition): Pre-process parse
tree once to filter out all non-footnote elements.  This speeds up
subsequent footnote definition searches.

org-export-get-footnote-definition: Pre-cache references in parse tree
5b3d4e7bf0b6a1eb576e1c6e6592028e3589f792
Ihor Radchenko
Thu Jun 16 10:52:17 2022 +0300

[ km: This ported commit comes from main's f51c28671.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
2022-10-04 17:10:50 -04:00
Stefan Kangas 5a81ec0018 Backport commit 253374f81 from Emacs
* lisp/org-clock.el (org-clock-select-task): Remove XEmacs
compat code.

Remove some XEmacs compat code from org-mode
253374f81a13109b73afc8e319ca1fea72f68c72
Stefan Kangas
Sat May 14 15:55:20 2022 +0200
2022-10-04 17:10:50 -04:00
Stefan Kangas e74ea551bf Backport commit cc8b6101f from Emacs
* lisp/ol-eww.el (org-eww-copy-for-org-mode):
* lisp/ol-w3m.el (org-w3m-copy-for-org-mode):
* lisp/org-refile.el (org-refile):
* lisp/org.el (org-change-tag-in-region): Remove XEmacs compat
code.

Remove some XEmacs compat code from org-mode
cc8b6101f4479a80a6af7f9d80c6f9d774a85f40
Stefan Kangas
Fri May 13 23:17:16 2022 +0200
2022-10-04 17:10:50 -04:00
Stefan Kangas c06dc10f39 Backport commit 2fba71cf1 from Emacs
* lisp/org-mouse.el (org-mouse-show-context-menu): Use
'mouse-double-click-time' instead of 'double-click-time'.

Fix handling double-click-time nil or t
2fba71cf1fadc9d681e6be250d152cc156bf6a00
Stefan Kangas
Mon May 2 12:03:08 2022 +0200

[ km: Note that mouse-double-click-time isn't available until Emacs
  29; a follow-up commit will add a compatibility kludge. ]
2022-10-04 17:10:04 -04:00
Paul Eggert 37bb3547c7 Backport commit fa1a7ac61 from Emacs
Byte-compiler problem reported by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg01256.html
* lisp/org-compat.el (org-at-table.el-p):
Now declared in org-table, not org.
(org-string-collate-lessp): Define the ersatz
org-string-collate-lessp with the same API as the primary form, to
pacify check-declare-file when run on org-macs.
* lisp/org-macs.el (org-time-convert-to-integer): Declare.

Pacify byte compiler etc. on org-compat, org-macs
fa1a7ac617619ef015e02e72950eef219ec62336
Paul Eggert
Thu Apr 28 13:41:35 2022 -0700
2022-10-04 16:59:33 -04:00
Paul Eggert 56ba22b9df Backport commit 3abb3681b from Emacs
* lisp/org-macs.el (org-file-newer-than-p):
Don’t assume list-format timestamps, by using
org-time-convert-to-integer instead of doing it by hand.

Use org-time-convert-to-integer instead of by hand
3abb3681b57d7c8ca7fa808addb0a10b6b109cab
Paul Eggert
Wed Apr 27 00:30:25 2022 -0700
2022-10-04 16:59:33 -04:00
Paul Eggert 723af4afae Backport commit 8ef37913d from Emacs
* lisp/ol.el (org-store-link):
* lisp/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-macro.el (org-macro--vc-modified-time):
* lisp/org-macs.el (org-2ft, org-matcher-time):
* lisp/org-table.el (org-table-eval-formula):
* lisp/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Don’t assume Emacs 27 encode-time, since standalone Org still
works with Emacs 25 and it’s easier if we minimize differences
from standalone Org.  Problem reported by Max Nikulin (Bug#54731).
This reverts much of 2021-12-16T17:40:21Z!eggert@cs.ucla.edu.

Port Org encode-time usage back to Emacs 25
8ef37913d3be5ff518018acb6b0144d6e559b5ba
Paul Eggert
Tue Apr 5 17:52:34 2022 -0700

[ km: See main's 8908a1bda (org-macs.el: Introduce a helper for
  `encode-time', 2022-07-17). ]
2022-10-04 16:59:15 -04:00
Sam Steingold 5d5a7832ec Backport commit 18b680cfd from Emacs
* lisp/ol-eshell.el (org-eshell-open): Pass
'display-comint-buffer-action' to 'pop-to-buffer' instead of using
'pop-to-buffer-same-window'.

Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
18b680cfd177e877991be2bd70ead628bbdc0aa0
Sam Steingold
Tue Dec 28 17:28:49 2021 -0500

[ km: Note that display-comint-buffer-action isn't available until
  Emacs 29.  A compatibility kludge will be added in a follow-up
  commit. ]
2022-10-04 16:57:09 -04:00
Stefan Kangas 1a3dd6ec85 Backport commit 5f57b41aa from Emacs
; Minor license statement fixes
5f57b41aa612e5f190f5a3c1ea013be114493a03
Stefan Kangas
Mon Dec 20 22:31:31 2021 +0100
2022-10-04 16:57:09 -04:00
Paul Eggert 659646f135 Backport commit e0ca8f791 from Emacs
* lisp/ox-icalendar.el (org-icalendar-template)
(org-icalendar-export-current-agenda)
(org-icalendar--combine-files):
Prefer (format-time-string "%Z") to (cadr (current-time-zone)).

Prefer format-time-string to current-time-zone
e0ca8f791c2e4396f1e40d86c136ae547b40185d
Paul Eggert
Thu Dec 16 11:17:26 2021 -0800

[ km: The org-icalendar--combine-files change has a typo that will be
  fixed in a follow-up commit. ]
2022-10-04 16:57:09 -04:00
Paul Eggert 772c44779c Backport commit dd0727e1e from Emacs
* lisp/ol.el (org-store-link):
* lisp/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-macro.el (org-macro--vc-modified-time):
* lisp/org-macs.el (org-2ft, org-matcher-time):
* lisp/org-table.el (org-table-eval-formula):
* lisp/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Prefer (encode-time L) to (apply #'encode-time L) where either will do.
* lisp/org-clock.el (org-clocktable-steps):
Prefer (encode-time S M ...) to (apply #'encode-time (list S M ...)).

encode-time simplifications
dd0727e1ec1f535b9b06be88173b4d3ccd55abcb
Paul Eggert
Thu Dec 16 11:17:25 2021 -0800

[ km: Note that these changes will be reverted by the port of Emacs's
  8ef37913d. ]
2022-10-04 16:55:56 -04:00
Paul Eggert 1a2d2fd5e4 Backport commit c1145c31a from Emacs
* lisp/org-compat.el (file-attribute-modification-time):
Update doc string to match that of builtin Emacs.

Update org-compat doc string
c1145c31adf143460911dd87b408d35ea88a1a92
Paul Eggert
Sun Dec 5 23:24:10 2021 -0800
2022-10-04 16:27:45 -04:00
Stefan Kangas f99a8ea434 Backport commit 104e90d93 from Emacs
* lisp/org-clock.el (org-clock-persist-file):
* lisp/org-id.el (org-id-locations-file): Prefer
'locate-user-emacs-file' to fiddling with 'user-emacs-directory'
directly.

Prefer locate-user-emacs-file
104e90d93664892ed1a7a1631c5b0141d0552a60
Stefan Kangas
Tue Nov 9 07:51:27 2021 +0100
2022-10-04 16:27:45 -04:00
Stefan Kangas c7e1bbfd1c Backport commit 664094222 from Emacs
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Prefer format-prompt
when it is fboundp.

Use format-prompt for many more prompts
66409422214a0a90e1d2a12ef2c4ebf86f2c01a9
Stefan Kangas
Tue Oct 5 03:44:56 2021 +0200
2022-10-04 16:27:45 -04:00
Stefan Kangas e7572fa86c Backport commit 616dcf27e from Emacs
; Fix typos in Lisp symbols
616dcf27e57388403d4c28d441bf7310bb665241
Stefan Kangas
Tue Sep 20 12:21:40 2022 +0200
2022-10-04 16:27:36 -04:00
Ihor Radchenko 506d5b12dd
org-comment-line-break-function: Avoid built-in Emacs comment machinery
* lisp/org.el (org-comment-line-break-function): Rely on Org
parser (`org-adaptive-fill-function') to determine comment filling.
Handle nil values of `fill-prefix' correctly.

* testing/lisp/test-org.el (test-org/default-indent-new-line): New
test.  Written by Kaushal Modi <kaushal.modi@gmail.com>
https://list.orgmode.org/CAFyQvY36DkBSNy2mPxDNZWeoTjUK8mAqgJM-zHxNamfReqGkuQ@mail.gmail.com/

Reported-by: Richard Lawrence <richard.lawrence@uni-tuebingen.de>
Link: https://list.orgmode.org/87lf18fue9.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me/
2022-10-04 19:47:11 +08:00
Ihor Radchenko 9db57aee3e
Do not use visual `current-indentation' when we need real values
* lisp/org-macs.el (org-current-text-indentation): New macro
calculating the real text indentation disregarding buffer visibility.
(org-do-remove-indentation):
* lisp/org-src.el (org-src--edit-element):
* lisp/org.el (org-indent-line):
(org-indent-region):
(org-toggle-fixed-width):
(org-comment-or-uncomment-region):
* lisp/ox.el (org-export-expand-include-keyword): Use
`org-current-text-indentation' instead of `current-indentation' and
`org-current-text-column' instead of `current-column' when we need
real text values but not visible values.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837

Reported-by: tony aldon <tony.aldon.adm@gmail.com>
Link: https://orgmode.org/list/87k0h49s7z.fsf@localhost
2022-10-04 15:21:20 +08:00
Kyle Meyer 9ce4727d8e org-element: Fix Emacs 29 warning about quoting style
* lisp/org-element.el (org-element--parse-generic-emphasis): Change
quoting style to avoid Emacs 29 byte compiler warning about 'wrong
usage of "fancy" single quotation marks'.
2022-10-03 18:44:25 -04:00
Kyle Meyer 2bd9db8345 Silence byte-compiler under 'make single'
These are warnings that would show up when these changes made their
way to the Emacs repo.
2022-10-03 18:44:25 -04:00
Kyle Meyer 6a30ef2781 org.el: Move definition to silence warning
* lisp/org.el (org-agenda-file-menu-enabled): Move definition upstream
of its first use.

'make single' flags this (and so would the Emacs repo's build).
2022-10-03 18:44:22 -04:00
Kyle Meyer b196a05f5a Clean up spacing to pass Emacs's pre-commit check
Avoid trailing spaces and spaces before tabs.
2022-10-03 17:57:03 -04:00
Ihor Radchenko 7b9d8e7bed
org-fold-core-style: Document that it must be set before loading Org
* lisp/org-fold-core.el (org-fold-core-style): Update docstring
highlighting that the variable must be set before loading Org.
2022-10-01 09:09:36 +08:00
Ihor Radchenko fe1f4f2ccf
fixup! org-fold-core: Respect 'ignore-indirect optimization better 2022-09-30 07:24:34 +08:00
Ihor Radchenko e9781f1c08
org-fold-core: Respect 'ignore-indirect optimization better
* lisp/org-fold-core.el (org-fold-core--property-symbol-get-create):
(org-fold-core-decouple-indirect-buffer-folds): Do not try to decouple
folding state in indirect buffers when 'ignore-indirect is requested
in `org-fold-core--optimise-for-huge-buffers'.
2022-09-29 22:28:07 +08:00
Ihor Radchenko 791ea50528
* lisp/org-element.el (org-element--cache-active-p): Fix compiler warning
Using `defsubst' here is impractical because some code above does call
`org-element--cache-active-p'.  Moving would trigger major refactoring
for little gain.  Hence, move back to using simple `defun' until we
modularize lisp/org-element.el better.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/874jws2v87.fsf@gmail.com
2022-09-28 12:30:27 +08:00
Ihor Radchenko d7a55bbd53
org-latex-export-to-latex: Do not suppress major modes in babel
* lisp/ox.el (org-export-to-file): Suppress loading major mode in the
exported text explicitly instead of doing it across the whole export
process.  This way, babel evaluation will not suffer from unexpected
behavior when no major modes are being loaded.

Reported-by: Asilata Bapat <asilata@gmail.com>
Link: https://list.orgmode.org/orgmode/87fsk5955a.fsf@gmail.com/
2022-09-28 12:07:14 +08:00
Bastien c536832308 lisp/ob-clojure.el: Add Daniel Kraus as maintainer 2022-09-27 21:36:51 +02:00
Thierry Banel aa3eac143d ob-C: do not swallow double quotes on raw output
* lisp/ob-C.el (org-babel-C-execute): Remove the erroneous
  call to `org-babel-read' when output is raw.
* testing/examples/ob-C-test.org (Output),
  testing/lisp/test-ob-C.el (ob-C/ouput-doublequotes):
  Add a test with double quotes output.

https://list.orgmode.org/orgmode/bc004962-679e-498f-b245-ae253aae6271@www.fastmail.com/
2022-09-27 16:20:57 +02:00
Bhavin Gandhi 2e012db31a
org.el: Make sure `org-add-log-note' runs at the end of Org command
* lisp/org.el (org-add-log-setup): Save `this-command' and
`recursion-depth' before adding the `org-add-log-note' to
`post-command-hook'.
(org-add-log-note): Execute only if the current `(recursion-depth)'
and `this-command' are same as the ones we saved during the log-setup.

(org-log-note-this-command):
(org-log-note-recursion-depth): New variables storing `this-command'
and `recursion-depth'.

This change tries to make sure that we run the `org-add-log-note' only
after the current Org command has finished executing.  Previously, the
`post-command-hook' was getting triggered if the Org command in turn
runs some other command.

Fixes the bug originally reported by Michael Powe.

Bhavin Gandhi. [BUG] org-auto-repeat-maybe: error "Can’t expand
minibuffer to full frame" and missing log note.
Sat, 18 Jun 2022 23:30:50 +0530.
https://list.orgmode.org/CAOn=hbcsOCO++We0XgRHFoxxCEXROCpyGd1nCjzKYy-9LckQZg@mail.gmail.com/

Relevant discussion on bug-gnu-emacs: https://debbugs.gnu.org/56425
2022-09-26 20:41:54 +08:00
Ihor Radchenko 73f25bba8f
* lisp/org-macs.el (org-assert-version): Use more lax assertion
See https://orgmode.org/list/jwvczc05u7r.fsf-monnier+emacs@gnu.org
2022-09-26 19:25:20 +08:00
Ihor Radchenko c8e0a402df
org: Prefer standard version format accepted by `version-to-list'
* lisp/org.el: Rename Org version on development branch from "9.6-dev"
to "9.6-pre".  The latter is accepted by `version-to-list'.

See https://orgmode.org/list/87edvzbniw.fsf@gnu.org
2022-09-26 19:14:20 +08:00
Bastien a2d1806f66 lisp/ox-latex.el: Fix docstring typos
* lisp/ox-latex.el (org-latex-src-block-backend): Fix typos in docstring.
2022-09-26 06:47:14 +02:00
Ihor Radchenko ad52345f00
org-element-cache: Report buffer size for unregistered modifications
* lisp/org-element.el (org-element--cache-sync): Provide the details
on the expected and actual values of buffer size.
2022-09-26 12:35:59 +08:00
Giovanni Alfredo Garciliano Díaz 0d8440f55d * lisp/ox-html.el (org-html-doctype-alist): Fix system identifier for XHTML 1.1 DTD
Right DTDs are listed on https://www.w3.org/QA/2002/04/valid-dtd-list.html

TINYCHANGE
2022-09-25 11:19:28 +02:00
Ihor Radchenko cf93247473 ox-publish: Allow linking to encrypted Org files
* lisp/ox-html.el (org-html-link): Convert .org.gpg file links to
.html, in addition to previously performed .org -> .html convertion.
(org-html-link-org-files-as-html): Update the docstring.
* doc/org-manual.org (Publishing links):
* etc/ORG-NEWS (Publishing now supports links to encrypted Org files):
Document the new feature.
2022-09-25 11:19:28 +02:00
Ihor Radchenko 235c72e31f lisp/org.el: Do not skip loading org-loaddefs when using `eval-buffer'
* lisp/org.e: Do not skip loading "org-loaddefs.el" when Org mode is
loaded through M-x eval-buffer.

Fixes https://orgmode.org/list/874jwyalo1.fsf@localhost
2022-09-25 11:19:28 +02:00
Bastien fd195266dd lisp/org-macs.el: Minor docstring enhancements
* lisp/org-macs.el (org-assert-version): Minor docstring enhancements.
2022-09-25 11:16:28 +02:00
Sajad Hosseini Balef 36c27f11d9 lisp/ox.el: Add Persian/Farsi translation to `org-export-dictionary'
* lisp/ox.el (org-export-dictionary): Add Persian/Farsi translation.

TINYCHANGE
2022-09-25 09:24:59 +02:00
Daniel Kraus 764642f55b ob-clojure.el: Add support for babashka and nbb backend
* lisp/ob-clojure.el: Add support for babashka and nbb backend.
2022-09-25 05:07:28 +02:00
TEC e8a797e143
ob-core: Display babel execution time
* lisp/ob-core.el (org-babel-execute-src-block,
org-babel-format-result): Record the babel execution time, and then
supplement the "Code block evaluation complete." (etc.) messages with
the execution time when >0.05s.
2022-09-24 17:10:58 +08:00
TEC d1c6d02092
ob-core: Display type of element babel executes
* lisp/ob-core.el (org-babel-execute-src-block): The babel execute
function is run on more than just source blocks, so it makes sense to
note the type of element being executed.  A fourth optional argument is
added to allow for explicit specification of the type of element
responsible for the execution.

* lisp/ob-lob.el (org-babel-lob-execute-maybe): Pass the type of the
execution triggering element to `org-babel-execute-src-block'.

* lisp/org.el (org-ctrl-c-ctrl-c): When executing a babel call, pass the
type of the execution triggering element to
`org-babel-execute-src-block'.
2022-09-24 17:10:46 +08:00
TEC 392ccbbf5d
ob-core: Display position of executed babel blocks
* lisp/ob-core.el (org-babel-execute-src-block): When an unnamed babel
block is executed, show the position of the block.

This makes it easier to track the execution without having to name every
block.

ob-core: point

* lisp/ob-core.el (org-babel-execute-src-block):
2022-09-24 17:10:42 +08:00
Ihor Radchenko 0a6a56c804
org-adapt-indentation: Fix 'headline-data checks
* lisp/org.el (org--at-headline-data-p): New function used to check if
element at point belongs to headline data.
(org--get-expected-indentation):
(org-indent-line): Use `org--at-headline-data-p' instead of
explicit (and inaccurate) condition.
* testing/lisp/test-org.el (test-org/indent-region): Add tests.

Fixes incorrect LOGBOOK drawer indentation when
`org-adapt-indentation' is set to 'headline-data.
2022-09-24 14:07:31 +08:00
Ihor Radchenko 9bd8a99a6e
org-agenda-get-sexps: Avoid excessive calls to `org-agenda-skip'
* lisp/org-agenda.el (org-agenda-get-sexps): Only check if entry
should be skipped on matching sexps, when `org-diary-sexp-entry'
returns non-nil.
2022-09-23 23:34:10 +08:00
TEC 6a82d17c89
ob-tangle: New tangle-finished hook
* lisp/ob-tangle.el (org-babel-tangle, org-babel-tangle-finished-hook):
Create a new hook, `org-babel-tangle-finished-hook', and run it at the
end of `org-babel-tangle'.
(org-babel-pre-tangle-hook): Update docstring to mention buffer the hook
is run in, to match the docstring of `org-babel-tangle-finished-hook`.
2022-09-23 20:14:52 +08:00
Ihor Radchenko d240386c10
org-diary-sexp-entry: Re-use cached nil return values
* lisp/org.el (org-diary-sexp-entry): Do not consider cached nil
return values as if they are not cached.
2022-09-23 12:57:13 +08:00
Ihor Radchenko 9dde82411a
org-table: Prevent Emacs from merging displayed separator spaces
* lisp/org-table.el (org-table-separator-space): Remove.
(org-table--separator-space-pre):
(org-table--separator-space-post): Use non-`eq' spaces as table cell
boundaries.  This way, Emacs display engine will not merge the two
spaces with `eq' 'display properties in empty table cells.

(org-table--make-shrinking-overlay):
(org-table--align-field): Use the new constants for table alignment.

Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45915
2022-09-22 20:00:03 +08:00