Commit Graph

24977 Commits

Author SHA1 Message Date
Stefan Kangas 36086a4f49 Backport commit 1fffe9a21 from Emacs
; * lisp/org/org.el: Fix version header.
1fffe9a210d328559da2af8facbb75286a31c74e
Stefan Kangas
Sun Nov 28 14:54:24 2021 +0100
2021-11-28 10:46:50 -05:00
Kyle Meyer 6e7c54ed94 Merge branch 'bugfix' 2021-11-27 16:17:16 -05:00
Kyle Meyer 96d91bea65 test-org-attach-git: Fix recent failure to load tests
* testing/lisp/test-org-attach-git.el: Provide feature.

As of 9044b300e (org-test: Fix ERC errors using latest Emacs master,
2021-11-24), tests must provide a feature.
2021-11-27 16:16:51 -05:00
Kyle Meyer b9cf130c91 test-org-attach-git: Fix file name in header and footer
* testing/lisp/test-org-attach-git.el: Update file name in the header
and footer to match the actual file name.
2021-11-27 16:16:48 -05:00
Ihor Radchenko c84c71b093
org-element-at-point: Report POM when parser throws error
* lisp/org-element.el (org-element-at-point): Mention the value of POM
in warning text when `org-element--parse-to' fails with error.
2021-11-27 12:20:33 +08:00
Ihor Radchenko e1aebc1a41
org-element--cache-for-removal: Error out of irrecoverable failure
* lisp/org-element.el (org-element--cache-for-removal): Consider wrong
parent to be critical failure: reset the cache and abort current
command.
2021-11-27 12:08:45 +08:00
Ihor Radchenko 49df468849
org-element-cache-map: Report pre-process time in statistics
* lisp/org-element.el (org-element-cache-map): Calculate time elapsed
while filling the cache gaps during pre-processing.
2021-11-27 12:08:44 +08:00
Nicolas Goaziou 8ddd95e5a3 Merge branch 'bugfix' 2021-11-26 12:20:59 +01:00
Nicolas Goaziou afc5ec2187 oc-csl: "Barf" functions should actually barf
* lisp/oc-csl.el (org-cite-csl--barf-without-citeproc): Actually raise
an error, as expected from the docstring.
2021-11-26 12:20:36 +01:00
Nicolas Goaziou 25640ace0f Merge branch 'bugfix' 2021-11-26 11:44:30 +01:00
Nicolas Goaziou 413afbe210 test-org: Fix failing test in non-English languages
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Do not assume
abbreviated day name is in English.
2021-11-26 11:43:20 +01:00
Nicolas Goaziou 2b0007a808 ox: Add autoload cookies
* lisp/ox.el (org-export-derived-backend-p):
(org-export-data):
(org-export-raw-string): Autoload function.

These functions are required at runtime by some other libraries (e.g.,
"oc-basic.el"), which cannot require `ox' because of circular
dependencies.

In particular, this fixes
<http://lists.gnu.org/r/emacs-orgmode/2021-11/msg00594.html>.
2021-11-26 11:40:28 +01:00
Ihor Radchenko 20ed794b92
org-element-parse-buffer: Avoid excessive garbage collection
* lisp/org-element.el (org-element-parse-buffer): Increase
`gc-cons-threshold' to improve performance.  In my tests on large Org
buffers, garbage collection took 50% of the time without increasing
the threshold.
2021-11-25 18:39:24 +08:00
Ihor Radchenko 08e595f312
org-agenda-get-scheduled: Fix wrong matches when WITH-HOUR is non-nil
* lisp/org-agenda.el (org-agenda-get-scheduled): Do not rely on regex
match to judge that current headline is scheduled with time when
WITH-HOUR argument is non-nil.  Limit regexp search when looking for
scheduled timestamp in current headline and intentionally signal
search error if something went wrong (headline without scheduled
timestamp in planning line must not be encountered at this point in
the code).

This commit continues 77a9932b0 and 82197761.
2021-11-25 18:39:11 +08:00
Nicolas Goaziou b3cc2f793b Merge branch 'bugfix' 2021-11-24 22:51:41 +01:00
Nicolas Goaziou 30a6126bb9 oc: Fix `org-cite-fontify-default' docstring and simplify code
* lisp/oc.el (org-cite-fontify-default): We don't need to assume
activate processor may be used on a citation reference: that will not
happen.
2021-11-24 22:50:09 +01:00
Nicolas Goaziou 308f4cb570 oc: Ensure activation returns a non-nil value
* lisp/oc.el (org-cite-activate): Return a non-nil value when
successful, even if citation processor doesn't.
2021-11-24 22:39:50 +01:00
Ihor Radchenko 23138b9b11
Merge branch 'bugfix' 2021-11-24 20:10:03 +08:00
Ihor Radchenko e76c29a586
org-element-cache-map: Update docstring 2021-11-24 20:09:56 +08:00
Ihor Radchenko cc3b468657
org-element-cache: Use 'org-element-cache warning type
* lisp/org-element.el (org-element--cache-log-message):
(org-element--cache-warn): Use special 'org-element-cache warning
type to display warnings.
2021-11-24 20:09:55 +08:00
Ihor Radchenko 9044b300ee
org-test: Fix ERC errors using latest Emacs master
* testing/lisp/test-ob-C.el:
* testing/lisp/test-ob-awk.el:
* testing/lisp/test-ob-sed.el: Add missing provide.
* testing/lisp/test-property-inheritance.el: Fix incorrect feature
name.
* testing/org-test.el (org-test-load): Use `require' instead of
`load-file' to load tests.  `load-file' can lead to duplicate test
definitions that now trigger ERC errors.

See https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-11/msg01968.html
2021-11-24 20:06:15 +08:00
Ihor Radchenko 0d7cf4e402
test-ob.el: Remove duplicate test 2021-11-24 20:06:07 +08:00
Bastien 77a9932b03 lisp/org-agenda.el:
* lisp/org-agenda.el (org-agenda-get-scheduled): Don't throw an
error when the search for the regular expression fails.

This completes 82197761.
2021-11-24 09:02:28 +01:00
Ihor Radchenko d8293676c3
Merge branch 'bugfix' 2021-11-23 21:51:46 +08:00
Ihor Radchenko ce0f5c3beb
org-manual.org: Clarify how to handle markup ambiguity
* doc/org-manual.org (Emphasis and Monospace): Advice users to insert
zero width space to force Org ignore emphasis markers.
2021-11-23 21:41:11 +08:00
Ihor Radchenko 4b1def3c5c
org-table.el: Do not create new field when at EOL after table line
* lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$"
as unclosed table field.

Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06
2021-11-23 21:40:58 +08:00
Ihor Radchenko b5f992b678
org-table.el: Do not create new field when at EOL after table line
* lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$"
as unclosed table field.

Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06
2021-11-23 21:14:44 +08:00
Ihor Radchenko dd173bf451
org-get-buffer-tags: Use cache 2021-11-23 21:14:43 +08:00
Matt Huszagh 912cf21494
org.el: Fix missing arg in string-match-p call
* lisp/org.el (org-display-inline-image--width): `string-match-p'
requires two arguments, but the second one was missing.
2021-11-23 13:40:40 +08:00
Kyle Meyer 27f26f7829 org-display-inline-image--width: Fix syntax error from last commit
* lisp/org.el (org-display-inline-image--width): Fix unbalanced
parentheses and reference to free variable introduced in last commit.
2021-11-22 23:44:15 -05:00
TEC 4514a324c8
org: More carefully interpret image width attrs
* lisp/org.el (org-display-inline-image--width): Before attempting to
interpret a :width attribute numerically, check that it indeed starts
with a digit and use the default value given by `org-image-actual-width'
if not.  However, if a value of "t" is given, treat this as if
`org-image-actual-width' were "t" and just use the image's pixel width.

This change fixes a strange behaviour where a non-numeric width would
previously display the image with zero width.
2021-11-23 01:52:19 +08:00
Ihor Radchenko 17d4b31a84
org-element--cache-before-change: Make sure that rx expr is always valid
* lisp/org-element.el (org-element--cache-before-change): Make sure
that we never construct (repeat 1 0 "*") rx expr.

Hopefully fixes https://list.orgmode.org/d8749145-29b9-39d6-5bbe-4b7e765792e5@ctpowe.net/T/#u
2021-11-22 19:38:36 +08:00
Ihor Radchenko 7a14d6035c
Fix element property queries for inlinetasks
* lisp/org.el (org-get-tags): Do not ignore local tags in inlinetasks.
(org-in-commented-heading-p): Do not ignore commented inlinetasks.
* testing/lisp/test-org.el (test-org/get-tags): Add tests for
inlinetasks.

Fixes https://list.orgmode.org/CAKJdtO8-KkVvhcviTqhi+DMZmSK=o37jn1jJPM9qxcuXZPnGgw@mail.gmail.com/T/#u
2021-11-22 19:34:21 +08:00
Matt Huszagh cd3e138ee5
org.el: Improve inline image width calculation
* lisp/org.el (org-display-inline-image--width): When
display-line-numbers-width is nil, the width is computed dynamically.
This does not mean that the line number width is necessarily 0.
2021-11-22 03:13:04 +08:00
Ihor Radchenko 54da1d6d7b
org-element--cache-process-request: Fix phase 2 with nil parent field
* lisp/org-element.el (org-element--cache-process-request): Fix
potential error raised when merging phase 2 requests with current
request having nil parent field.

Should help with https://list.orgmode.org/PAXPR08MB664034C85DDC73D21AD1CB0FA39E9@PAXPR08MB6640.eurprd08.prod.outlook.com/T/#t
2021-11-21 17:52:40 +08:00
Ihor Radchenko 28d47cfb82
org-element--cache-sync: Do not show warning on known safe modifications
* lisp/org-element.el (org-element--cache-sync): Do not raise warning
when `buffer-chars-modified-tick' changes safely outside
org-element-cache visibility.  Safe modifications are detected
according to heuristics based on `buffer-chars-modified-tick' and
`buffer-modified-tick'.  Their difference contains footprint for some
known [1,2,3] modifications triggered by Emacs internals.  However,
still reset cache to avoid false-positives for all but one [1] type of
modification.

[1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-11/msg01069.html
[2] https://list.orgmode.org/YYy9Hx8mNQN08U7e@smoon.bkoty.ru/T/#t
[3] https://list.orgmode.org/87ee7jdv70.fsf@localhost/T/#t
2021-11-21 16:26:00 +08:00
Clément Pit-Claudel ebd06c15b5
org-src: Reset buffer-modified-p after fontifying
* lisp/org-src.el (org-src-font-lock-fontify-block): Reset the
modification flag of the temporary fontification buffer after
fontifying.

Without this some modes cause Emacs to prompt about unsaved buffers
when exiting: "Save buffer *org-src-fontification:...-mode*?".
2021-11-21 14:59:43 +08:00
Kyle Meyer 27edae8ced tangle: Fix :version keyword of org-babel-tangle-default-file-mode
* lisp/ob-tangle.el (org-babel-tangle-default-file-mode): Prefer
":package-version" to ":version".

The :version keyword should correspond to the Emacs version.  Using
the Org version leads to an incorrect help message:

  This variable was introduced, or its default value was changed, in
  version 9.6 of Emacs.

Instead go through :package-version so that the displayed message is

  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.
2021-11-20 14:36:21 -05:00
Kyle Meyer 58cc9efd7d Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.6 to
Emacs 29.1.

Emacs 28.1 is nearing release.  The earliest Emacs version that Org
9.6 would be synced with is 29.1.
2021-11-20 14:36:10 -05:00
TEC b21d11c614
Document new :tangle-mode forms
* etc/ORG-NEWS: Mention new forms that :tangle-mode accepts.

* doc/org-manual.org (Header arguments): Mention new forms that
:tangle-mode accepts.
2021-11-21 03:06:20 +08:00
TEC e6ae351f96
ob-tangle: Rename org-babel-tangle-default-mode
* lisp/ob-tangle.el (org-babel-tangle-default-mode,
org-babel-interpret-file-mode): Rename `org-babel-tangle-default-mode`
to the slightly more apt `org-babel-tangle-default-file-mode`, and
update `org-babel-interpret-file-mode` accordingly.
2021-11-21 03:06:19 +08:00
Nicolas Goaziou 1db301a758 element: Drop `org-end-of-subtree' use
* lisp/org-element.el (org-element-headline-parser): Implement
a simple end of subtree search instead of relying on
`org-end-of-subtree'.
2021-11-20 19:54:41 +01:00
Kyle Meyer 69dbe86625 org-element: Silence byte-compiler
* lisp/org-element.el (org-element--cache-gapless): Move definition
before first use to remove byte-compiler warning about assignment to
free variable.
2021-11-20 13:52:48 -05:00
Bruce D'Arcus 9b398ba626 oc-basic: Add function to shorten names
* lisp/oc-basic.el (org-cite-basic--shorten-names): new function to
shorten author names

* lisp/oc-basic.el (org-cite-basic--print-entry): shorten author name
list for the "plain" output style
2021-11-20 19:40:36 +01:00
Kyle Meyer af40fa9ae7 Merge branch 'bugfix' 2021-11-20 13:22:37 -05:00
Stefan Kangas c5d6656328 Backport commit 42d4e24ff from Emacs
; Fix typos
42d4e24ff3f13ccbd401d93d70ecdee99b88a26d
Stefan Kangas
Fri Nov 12 13:59:58 2021 +0100
2021-11-20 13:03:45 -05:00
TEC 048f478799
ob-tangle: Make ls-style file mode regex stricter
* lisp/ob-tangle (org-babel-interpret-file-mode): Instead of allowing 9
characters from [rwx-], require [r-][w-][x-] repeated thrice.  This no
longer allows invalid ls-style file modes.
2021-11-20 22:57:20 +08:00
TEC ff6fd93876
ob-tangle: Check that integer file modes are valid
* lisp/ob-tangle.el (org-babel-interpret-file-mode): Check that the
integer as an octal represents a valid file mode, and complain
otherwise.
2021-11-20 22:57:20 +08:00
TEC 3a6686010e
ob-tangle: Use oXXX as file mode octal shorthand
* lisp/ob-tangle (org-babel-interpret-file-mode): Accept "o755" and
similar as octal shorthand. A non-digit character must be included as
otherwise `org-babel-parse-header-arguments' will convert it to a
base-10 integer.
2021-11-20 22:57:20 +08:00
Nicolas Goaziou 26e68816bd element: Integrate some syntax constants
* lisp/org-element.el (org-element-archive-tag):
(org-element-clock-line-re):
(org-element-comment-string):
(org-element-closed-keyword):
(org-element-deadline-keyword):
(org-element-scheduled-keyword):
(org-element-planning-keywords-re):
(org-element-planning-line-re):
(org-element-drawer-re):
(org-element-dynamic-block-open-re):
(org-element-headline-re): New constants.
(org-element-drawer-parser):
(org-element-dynamic-block-parser):
(org-element--footnote-separator):
(org-element--get-node-properties):
(org-element--get-time-properties):
(org-element-headline-parser):
(org-element-headline-interpreter):
(org-element-inlinetask-parser):
(org-element--list-struct):
(org-element-paragraph-parser):
(org-element-planning-parser):
(org-element-planning-interpreter):
(org-element--current-element):
(org-element--cache-for-removal):
(org-element-cache-map):
(org-element-context): Use new constants so as to not use org.el's.
* testing/lisp/test-org-element.el (test-org-element/headline-comment-keyword):
(test-org-element/headline-archive-tag):
* testing/lisp/test-ox.el (test-org-export/handle-options): Fix tests.
2021-11-20 11:37:52 +01:00