Commit Graph

24918 Commits

Author SHA1 Message Date
Ihor Radchenko 2ae8d6c1cf
org-babel-tangle-collect-blocks: Use cache
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use element
cache to find the containing headline instead of regexp search.
Direct regexp search sometimes causes quadratic scaling.

See https://lists.gnu.org/r/emacs-orgmode/2022-01/msg00484.html
2022-01-26 19:27:03 +08:00
Ihor Radchenko 70970dff8d
org-before-first-heading-p: Use cache and clarify docstring 2022-01-25 22:53:08 +08:00
Ihor Radchenko 26decec006
test-org-element-at-point: Add tests for point outside contents 2022-01-24 22:54:18 +08:00
Max Nikulin 2da1046435
make test: Make failure summary more verbose
* mk/default.mk: By default enable verbose failure summary for Emacs-28
or newer.

Set or unset EMACS_TEST_VERBOSE environment to control reporting of failure
reasons in summary since in Emacs-28 ERT switches to verbose mode even by
an empty string (fixed in Emacs-29).
2022-01-23 21:26:55 +08:00
Ihor Radchenko e604187779
Merge branch 'bugfix' 2022-01-23 17:41:12 +08:00
Ihor Radchenko 5b404a2225
org-dblock-write:clocktable: Fix typo in error string
Reported in https://list.orgmode.org/874k5uu85j.fsf@yandex.com/T/#u
2022-01-23 17:40:25 +08:00
Ihor Radchenko 1587e445be
org-element-cache: Suggest to share warning text as well in the warnings
Multiple users reported that they saw the warning, but did not
actually report the warning text.  It's better to ask about sharing
explicitly.
2022-01-23 12:06:56 +08:00
Nicolas Goaziou 3154c22559 Merge branch 'bugfix' 2022-01-22 15:51:43 +01:00
Nicolas Goaziou 23daada78d compat: Prevent spell-checking citation
* lisp/org-compat.el (org--flyspell-object-check-p): Do not
spell-check citation and citation-reference objects.

Reported-by: Rudolf Adamkovič <salutis@me.com>
<http://lists.gnu.org/r/emacs-orgmode/2022-01/msg00434.html>
2022-01-22 15:48:26 +01:00
Ihor Radchenko 846226a202
test-org-element/cache: Fix typo 2022-01-21 20:53:11 +08:00
Ihor Radchenko 5ac2b2291b
Make sure that 'inherited text property in tags does not propagate to cache
* lisp/org.el (org--get-local-tags, org-get-tags): Explicitly copy
cached tag strings to make sure that modifications are not propagated
to cached tag values.

Fixes
https://list.orgmode.org/CAFyQvY2HkE5p00wQ1QycQCdtwy3drRB_naK8wenrKwVT-cbH7g@mail.gmail.com/T/#t
2022-01-21 19:47:18 +08:00
Ihor Radchenko 5d05f5911a
org-element-cache: Allow detecting changes from indirect non-Org buffers
* lisp/org-element.el (org-element--cache-before-change):
(org-element--cache-after-change): Do not prevent trigerring if the
current indirect buffer is not in Org mode, but its base buffer is in
Org mode.
2022-01-19 17:37:34 +08:00
Ihor Radchenko 37edef8bbd
org-mode: Initialise cache before initialising file-local regexps
* lisp/org.el (org-mode): Initialise cache earlier, allowing the
file-local settings to be taken from persistent cache when
possible.  Also, bind `org-mode-loading' while org-mode is loading.
* lisp/ol.el (org-update-radio-target-regexp): Do not try to refresh
cache when we are loading file for the first time.
2022-01-19 11:58:17 +08:00
Marco Wahl 0725237eed org: Small simplification
* lisp/org.el (org-metaup, org-metadown): Remove unnecessary min/max computation.
2022-01-18 09:47:53 +01:00
Ihor Radchenko 9b58ead467
org-element-context: Use element cache
* lisp/org-element.el (org-element-context): Use
`org-element-at-point', which makes use of cache.
* testing/lisp/test-org-element.el (test-org-element/lineage): Expect
full lineage up to org-data from `org-element-context'.
2022-01-17 20:20:57 +08:00
Ihor Radchenko f41ba23689
org-colview: Do not remap faces repeatedly
* lisp/org-colview.el (org-columns--display-here):
(org-columns-remove-overlays): Do not call `face-remap-add-relative'
after it is already called.  For large files,
`face-remap-add-relative' can take more than 90% CPU time.  Set
`org-columns-header-line-remap' to nil when we remove the temporary
remapping.
2022-01-17 20:20:44 +08:00
Ihor Radchenko 8d9ca0eac1
test-org/entry-get: Add test checking reported bug
See https://list.orgmode.org/orgmode/87zgrqqlcs.fsf@toloe.se/
2022-01-15 19:48:24 +08:00
Ihor Radchenko 7ba24c673b
ob-gnuplot: Fix wrong table conversion when first column has ?-
* lisp/ob-gnuplot.el (org-babel-gnuplot-table-to-data): Revert to
using ascii exporter.
* lisp/ox-ascii.el (org-ascii-table-cell): Do not throw error when
CONTENTS is wider than initial cell value.
2022-01-14 22:03:38 +08:00
Ihor Radchenko 9623da4408
ob-gnuplot: Fix wrong table conversion when first column has ?-
* lisp/ob-gnuplot.el (org-babel-gnuplot-table-to-data): Revert to
using ascii exporter.
* lisp/ox-ascii.el (org-ascii-table-cell): Do not throw error when
CONTENTS is wider than initial cell value.
2022-01-14 21:56:09 +08:00
Ihor Radchenko 6631b3f7bb
org-element--parse-to: Fix limit when pasting top-comment and no cache
* lisp/org-element.el (org-element--parse-to): Manually parse org-data
and set appropriate parser mode when POS is before first headline and
cache is disabled.
(org-element-org-data-parser--recurse): New variable flagging if
`org-element-data-parser' is called recursively.
(org-element-org-data-parser): Handle recursive calls from inside `org-element-at-point-no-context'.

This also fixes false-positives in `org-element--cache-verify-element'.
2022-01-14 14:29:16 +08:00
Mark A. Hershberger 1537bb4029
Fix signature for org-element-at-point 2022-01-12 22:26:10 +08:00
Ihor Radchenko a9b2e262cd
Merge branch 'bugfix' 2022-01-12 21:11:33 +08:00
Ihor Radchenko 65f9524136
test-org-agenda: Test for scheduled-looking lines
* testing/examples/agenda-file.org: Add test headings where SCHEDULED
line is not planning.
*
testing/lisp/test-org-agenda.el (test-org-agenda/non-scheduled-re-matces):
Make sure that SCHEDULED lines that do no belong to planning do not
trigger agenda matches.

See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t
2022-01-12 21:08:55 +08:00
Ihor Radchenko e8d6db540b
org-agenda-get-timestamps: Ignore non-timestamps matching re
* lisp/org-agenda.el (org-agenda-get-timestamps): Explicitly confirm
that object at point is a timestamp.

Fixes https://list.orgmode.org/20220102210433.GC29829@itccanarias.org/T/#m39b80d45d7d6cfc6b713284365c283579ac94cb1
2022-01-12 21:08:49 +08:00
Ihor Radchenko 34b0d95327
org-in-src-block-p: Do not rely on fontification
* lisp/org.el (org-in-src-block-p): New optional argument ELEMENT.
The code now relies on org-element API to check if we are inside
src-block.

Partially fixes https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t
2022-01-12 21:08:41 +08:00
Ihor Radchenko 1f48d2d751
org-element-cache-map: Do not byte-compile FUNC
Byte compilation can unpredictably break agenda searches in some Emacs
builds.

See https://list.orgmode.org/PAXPR08MB6640260AFA03FCDFABE245A3A34F9@PAXPR08MB6640.eurprd08.prod.outlook.com/T/#t
2022-01-10 22:32:38 +08:00
TEC 071c5e4bf1
org-entities: Fix LaTeX macron accent
* lisp/org-entities.el: The macron accent should be produced with the
text accent \=, not \bar which is a maths accent.
2022-01-10 00:38:32 +08:00
Ihor Radchenko dc4b2772e3
org-element-cache-map: Fix an edge case with org-element-cache-continue-from
* lisp/org-element.el (org-element-cache-map): Make sure that START is
never set to -1.  It may cause infinite loops in some scenarios.
* testing/lisp/test-org.el (test-org/map-entries): Add a test catching
the reported situation.

Reported in https://list.orgmode.org/CADywB5JHAyPX99Vr02SvAqiMTD+7ss4VWVipOhKfm=iGirDPhA@mail.gmail.com/T/#t
2022-01-07 22:10:22 +08:00
Ihor Radchenko 515ce56d4e
org-element-cache: Fix transforming keywords to affiliated
* lisp/org-element.el (org-element--cache-for-removal): Consider
preceding keywords to be updated unconditionally.
(org-element-cache-map): Fix infinite loop revealed by the new test.

* testing/lisp/test-org-element.el (test-org-element/cache-affiliated):
New test.
2022-01-07 21:24:43 +08:00
Ihor Radchenko a98ae424d2
org-element-cache: Give user more control over silent modificatoin checks
* lisp/org-element.el (org-element--cache-silent-modification-check):
New variable allowing the user to suppress modification checks completely.
* lisp/org-element.el (org-element--cache-sync): Support
`org-element--cache-silent-modification-check'.

The existing heuristics for built-in non-modifying commands that
change `buffer-chars-modified-tick' is not sufficient.  At least
`capitalize-word' changes the tick regardless whether the buffer was
actually modified or not.  Yet, `capitalize-word' does not call
`after-change-functions' if the buffer is not really modified.

Reported in https://list.orgmode.org/2022-01-06T12-13-17@devnull.Karl-Voit.at/T/#mb3771758f81b31721ba2f420878a4d16081dc483
2022-01-06 20:16:00 +08:00
Kyle Meyer fe70c4d259 ox-koma-letter: Collapse space in copyright line
Match the space change made in Emacs's 19dcb237b5b (; Add 2022 to
copyright years, 2022-01-01) to avoid noise when syncing to the Emacs
repo.
2022-01-01 17:47:00 -05:00
Kyle Meyer b8656a2cef Update main-only copyright years 2022-01-01 15:25:06 -05:00
Kyle Meyer aae2ac3a68 Merge branch 'bugfix' 2022-01-01 15:21:37 -05:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Ihor Radchenko 06f58e4759
org-element-cache-map: Fix when FUNC deletes current element
* lisp/org-element.el (org-element-cache-map-continue-from): New
variable forcing `org-element-cache-map' to continue from a custom
point in buffer.
(org-element-cache-map): Add support for
`org-element-cache-map-continue-from'.  Update docstring accordingly.
Also, make sure that mapping terminates correctly when FUNC deletes
all elements in buffer.
* testing/lisp/test-org.el (test-org/map-entries): Add test.

Fixes https://orgmode.org/list/CADywB5KOJ1p0NpvA=iX-ybHsO=huGA8qL3xMpUTETmS2qp7_ng@mail.gmail.com
2022-01-01 14:13:26 +08:00
Kyle Meyer ce75d2b8b9 Merge branch 'bugfix' 2021-12-29 22:53:55 -05:00
Ihor Radchenko eb9f34222a
ob-gnuplot: Fix regression from 23d8d59df when ox-org is not loaded
* lisp/ob-gnuplot.el (org-babel-gnuplot-table-to-data): Require
ox-org, making sure that org export backend is available.
2021-12-27 00:46:00 +08:00
Ihor Radchenko c614234688
ob-gnuplot: Use org backend when assigning table to variable
* lisp/ob-gnuplot.el (org-babel-gnuplot-table-to-data): Switch to 'org
backend when exporting table data to plain text table.  ascii backend
incorrectly handles quote transcoders that change the column width and
sometimes throws an error.  (ascii backend simply ignores transcoded
table cells and calculates width based on the initial cell text).
2021-12-27 00:45:39 +08:00
Ihor Radchenko d012350dad
org-persist: Report read/write duration
* lisp/org-persist.el (org-persist--report-time): New variable
controlling time reporting.  The default value is to report if
read/write opeartion takes over 0.5 sec.
(org-persist-write):
(org-persist-read): Display message about read/write duration for each
variable according to `org-persist--report-time'.
2021-12-25 23:36:26 +08:00
Ihor Radchenko ecce81dace
Merge branch 'bugfix' 2021-12-25 22:26:48 +08:00
Ihor Radchenko 377d6247af
org-clock-timestamps-down: Fix typo in docstring
Reported in https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-12/msg01841.html
2021-12-25 22:25:24 +08:00
Bastien 4eaf088c13 Merge branch 'bugfix' 2021-12-24 21:04:05 +01:00
Bastien fbff082f73 Update to version 9.5.2
* lisp/org.el: Update to version 9.5.2.
2021-12-24 21:01:49 +01:00
Ihor Radchenko 8f50ea2d69
org-element--parse-to: Get rid of unnecessary cache lookup
* lisp/org-element.el (org-element--parse-to): Disable cache in
`org-element--current-element'.  When calling it here, we know for
sure that element at point is not yet in cache.
2021-12-24 12:30:09 +08:00
Ihor Radchenko 410afd6f37
Revert "org-do-emphasis-faces: Never treat closing marker as next opening marker"
This reverts commit fa315986a1.

The commit broke fontification of nested emphasis like
/italic *bold* more italic/.
2021-12-22 23:51:51 +08:00
Ihor Radchenko e0b1a05460
org-persist-unregister: Fix when BUFFER is not 'all
* lisp/org-persist.el (org-persist-unregister): Use `string=' instead
of `eq' to compare strings.  `eq' always returns nil here.
2021-12-22 10:22:04 +08:00
Marco Wahl be03334a7e Merge branch 'bugfix' into main 2021-12-21 12:13:46 +01:00
Marco Wahl b6c5f028a0 Fix parallel make of docs
* doc/Makefile: Split multiple target "org.texi orgguide.texi".
* mk/org-fixup.el (org-make-manual, org-make-guide):  New functions.
  (org-make-manuals): Make obsolete.

Reported by Ulrich Müller.  https://list.orgmode.org/uee67gr96@gentoo.org/
2021-12-21 12:12:21 +01:00
Ihor Radchenko 0b670aa8e8
org-persist: Support old Emacs without file-attribute-inode-number
* lisp/org-persist.el (org-persist--get-index): Check is
`file-attribute-inode-number' function exists.  It was not there in
Emacs 25.

Fixes https://list.orgmode.org/CAJcAo8s21R1dRrxpaHV=h68RtWctLd6giFskw1vpt9fQh81dDw@mail.gmail.com/T/#u
2021-12-20 23:00:01 +08:00
Ihor Radchenko 344b99070f
org-persist.el: Make org-persist-directory a custom variable
* lisp/org-persist.el (org-persist): Create org-persist customisation
group.
(org-persist-directory): Convert into defcustom.
2021-12-20 23:00:00 +08:00