Commit Graph

26655 Commits

Author SHA1 Message Date
Hraban Luyat 39ae2eda5b
test-ox-html: Add new tests for postamble format
* testing/lisp/test-ox-html.el (ox-html/postamble-default):
(ox-html/postamble-custom):
(ox-html/postamble-custom-format):
(ox-html/postamble-none):
(ox-html/postamble-format-wrong-config):
(ox-html/postamble-format-proper-config):
(ox-html/postamble-format-conflict):
(ox-html/postamble-format-author): New tests.
2023-08-10 12:41:35 +03:00
Hraban Luyat 003927a594
test-ox-html: Add new tests for checkboxes: ascii, html & unicode
* testing/lisp/test-ox-html.el (ox-html/checkbox-ascii):
(ox-html/checkbox-html):
(ox-html/checkbox-unicode): New tests.
2023-08-10 12:35:34 +03:00
Ihor Radchenko f80c824040
* doc/org-manual.org: Clarify that org-emphasis-alist does not affect parser
(Emphasis and Monospace): Clarify that modifying `org-emphasis-alist'
does not affect parser; just the fontification.
2023-08-09 12:52:53 +03:00
Ihor Radchenko 6c40983e86
org-with-remote-undo: Update docstring
* lisp/org-macs.el (org-with-remote-undo): Mention all the arguments.
Document that function is not useful outside agenda.
2023-08-09 11:47:07 +03:00
Ihor Radchenko 8ed3887821
etc/ORG-NEWS: Clarify that `org-element-property' can be used with deferred
* etc/ORG-NEWS (Internal structure of Org parse tree has been
changed): Clarify when one needs to adjust for the breaking change
introducing deferred properties.
2023-08-09 10:26:35 +03:00
Ihor Radchenko f159adc269
org-element-property: Improve docstring
* lisp/org-element-ast.el (org-element-property): Clarify the meaning
of FORCE-UNDEFER argument.
2023-08-09 10:26:11 +03:00
Ihor Radchenko a18ebc7893
Revert "Avoid creating ID property during tangling"
This reverts commit 0b4e357d62.

The original bug report actually does not need special handling
because (1) some people actually want the "fixed" behavior with IDs
being created; (2) people who don't can set org-id-link-to-org-use-id
to 'create-if-interactive.

See https://orgmode.org/list/87v8e3p5fv.fsf@localhost
2023-08-08 15:54:56 +03:00
Ihor Radchenko 173b5de0ec
testing: Re-introduce more useful new tests instead of deleted dupllicates
* testing/lisp/test-ol.el (test-org-link/store-link):
* testing/lisp/test-org-table.el (test-org-table/get-field):
* testing/lisp/test-org.el (test-org/auto-fill-function): Add modified
version of the removed test duplicates, according to their likely
original intention.

Link: https://orgmode.org/list/87cz0wyw9m.fsf@localhost
2023-08-08 15:40:59 +03:00
Ilya Chernyshov fe85d61a92
testing: Delete duplicate tests
* testing/lisp/test-ol.el (test-org-link/store-link): Delete a duplicate test.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/properties): Delete a duplicate test.

* testing/lisp/test-org-element.el (test-org-element/link-parser,
test-org-element/timestamp-parser): Delete duplicate tests.

* testing/lisp/test-org-table.el (test-org-table/get-field): Delete a duplicate test.

* testing/lisp/test-org.el (test-org/auto-fill-function): Delete a duplicate test.
2023-08-08 15:33:06 +03:00
Ihor Radchenko 3780948905
lisp/ob-ditaa.el: Fix checkdoc warnings
* lisp/ob-ditaa.el (org-babel-execute:ditaa): Mention all the
arguments in the docstring.  Start error message from capital letter.
2023-08-08 12:38:14 +03:00
Jens Schmidt f689eb44f1
org-make-tags-matcher: Add starred property operators, fix quoting
* lisp/org.el (org-make-tags-matcher): Add starred property operators.
Recognize additional operators "==", "!=", "/=".  Clean up and
document match term parsing.  Remove needless and buggy unquoting of
minus characters in property and tag names.
(org-op-to-function): Recognize additional inequality operator "/=".

* doc/org-manual.org (Matching tags and properties): Add documentation
on starred and additional operators.  Document allowed characters in
property names and handling of minus characters in property names.

* testing/lisp/test-org.el (test-org/map-entries): Add tests for
starred and additional operators.  Add tests for property names
containing minus characters.

* etc/ORG-NEWS: (~org-tags-view~ supports more property operators):
Add announcement on starred and additional operators.

Link: https://orgmode.org/list/9132e58f-d89e-f7df-bbe4-43d53a2367d2@vodafonemail.de
2023-08-08 10:01:00 +03:00
Ihor Radchenko f9e083086f
Merge branch 'bugfix' 2023-08-07 14:59:17 +03:00
Ihor Radchenko 168ba7e6cf
test-ob-scheme.el: Disable testing for older Emacs unsupported by Geiser
* testing/lisp/test-ob-scheme.el (version<=): Throw
'missing-test-dependency unless minimum Emacs version required by
Geiser is used.

Link: https://orgmode.org/list/87r0og2dz7.fsf@mail.jao.io
2023-08-07 14:57:17 +03:00
Ihor Radchenko 30b747b86d
org-babel-execute:css: Mention arguments in the docstring
* lisp/ob-css.el (org-babel-execute:css): Fix docstring.
2023-08-06 12:10:21 +03:00
Ihor Radchenko f4fecc244c
doc/org-manual.org: Refer to LaTeX docs for general terminology
* doc/org-manual.org (LaTeX Export): Add links to online and offline
LaTeX docs.
(Quoting LaTeX code): Clarify that direct LaTeX can be used for
fine-tuning.

Link: https://orgmode.org/list/SJ0PR03MB5455B2712FA85BA945DFF441A20BA@SJ0PR03MB5455.namprd03.prod.outlook.com
2023-08-06 11:03:10 +03:00
Ihor Radchenko da8fabf464
org-delete-indentation: Fix Emacs 26 compatibility
* lisp/org.el (org-delete-indentation): `delete-indentation' in Emacs
26 does not yet accept region boundaries.  Provide compatibility
fallback.
2023-08-06 10:22:18 +03:00
Roshan Shariff 4ea9a98f85
org-macs: Fix incorrect use of relative paths in org-compile-file
* org-macs.el (org-compile-file, org-compile-file-commands): Resolve
symlinks in default-directory before computing relative source path

Commit 5a8a1d4ff [1] changed org-compile-file to use
`file-relative-name` for the SOURCE argument.  This was intended to
fix bug [2] by expanding ~ directories, like a shell.  Unfortunately,
this breaks when DEFAULT-DIRECTORY is a symlink and SOURCE has an
absolute path.

For example, on macOS Ventura, ~/Dropbox is a symlink to
~/Library/CloudStorage/Dropbox.  Suppose DEFAULT-DIRECTORY is
/Users/username/Dropbox and SOURCE is /var/tmp/test.org, so its
relative path is ../../../var/tmp/test.org.  But the working directory
of a compilation process is actually ~/Library/CloudStorage/Dropbox,
relative to which the source path resolves to
/Users/username/var/tmp/test.org.  The process thus cannot find the
source file.

This commit changes `org-compile-file` and its helper function
`org-compile-file-commands` to resolve symlinks in DEFAULT-DIRECTORY
before computing the relative path of SOURCE.  If SOURCE is already
relative, it is used as-is.  The absolute path is processed by
`expand-file-name`, avoiding bug [1].

[1] https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5a8a1d4ff
[2] https://orgmode.org/list/25528.42190.53674.62381@gargle.gargle.HOWL

TINYCHANGE
2023-08-06 09:44:13 +03:00
Ihor Radchenko c7e1f78326
Merge branch 'bugfix' 2023-08-05 16:17:35 +03:00
Ihor Radchenko e4f1274378
test-org-export/activate-smart-quotes: Update tests
* testing/lisp/test-ox.el: Fix inner French quotes.  See f099f84.
2023-08-05 16:16:31 +03:00
Ihor Radchenko 8dfd8c987c
org-format-latex: Add FIXME
* lisp/org.el (org-format-latex): Mark `overlay-recenter' call for
removal after Emacs 28 support is dropped.
2023-08-05 16:14:25 +03:00
Ihor Radchenko 0a5dd8cf68
org-babel--file-desc: Update docstring
* lisp/ob-core.el (org-babel--file-desc): Describe all the argument in
the docstring and clarify what the function returns.
2023-08-05 15:09:59 +03:00
Ihor Radchenko 222fdf9c57
Merge branch 'bugfix' 2023-08-05 14:00:18 +03:00
Ihor Radchenko 87b4de9617
org-publish-resolve-external-link: Fix links to non-Org files
* lisp/ox-publish.el: Do not try to call `org-at-heading-p' when not
in Org file.  `org-at-heading-p' and `org-entry-get' may err unless
inside Org buffer.
2023-08-05 13:57:45 +03:00
Ihor Radchenko 764a306cae
Merge branch 'bugfix' 2023-08-05 11:16:01 +03:00
Ihor Radchenko 453c47b57d
fixup! org-element--cache-for-removal: Fix changing heading granularity
* lisp/org-element.el:
(org-element--cache-for-removal): Explicitly assign :granularity to
not deceive parser when parsing for different granularity than cache.
Cache is always using 'element granularity.

This commit is only needed on bugfix.  On main, :granularity is set
correctly.
2023-08-05 11:14:26 +03:00
Ihor Radchenko 5e378a6e13
org-capture-template-contexts: Improve docstring
* lisp/org-capture.el (org-capture-templates-contexts): Clarify that
function context definition is not a cons cell using example.
2023-08-05 09:53:13 +03:00
Ihor Radchenko 8d6ec48b84
org-end-of-subtree: Fix when inside inlinetask
* lisp/org.el (org-end-of-subtree): Do not consider inlinetasks as
dedicated subtrees.
* testing/lisp/test-org.el (test-org/end-of-subtree): New test.
2023-08-05 09:48:10 +03:00
Bastien 73cb528c24 Merge branch 'bugfix' 2023-08-04 13:08:25 +02:00
Juan Manuel Macias 07f099f84e lisp/ox.el: Fix inner smart quotes in French
* (org-export-smart-quotes-alist): Add correct French second level
quotation marks.
2023-08-04 13:03:03 +02:00
Ihor Radchenko 8dc71d915e
lisp/ob-core.el: Fix some checkdoc warnings
* lisp/ob-core.el (org-babel-where-is-src-block-head): Quote
`match-data'.
(org-babel-insert-result): Ensure two spaces between sentences.
(org-babel-temp-file): Clarify that `temporary-file-directory' refers
to a function.
2023-08-04 11:33:33 +03:00
Ihor Radchenko 6eb117da06
* lisp/ob-core.el (org-babel--expand-body): Document all the arguments 2023-08-04 11:33:18 +03:00
Ihor Radchenko 4fb8ad9990
lisp/ob-core.el: Add some missing docstrings
* lisp/ob-core.el (org-babel-execute-safely-maybe):
(org-babel-execute-maybe):
(org-babel-active-location-p): Add docstrings.
2023-08-04 11:33:01 +03:00
Ihor Radchenko 47b04383e7
fixup! org-id-update-id-locations: Optimize performance
Avoid modifying FILES by side effect.
2023-08-04 10:54:19 +03:00
Ihor Radchenko 11ce194dcf
org-string-width: Fix Emacs <29 compatibility
* lisp/org-compat.el (org-buffer-text-pixel-width): New function using
`buffer-text-pixel-size' in Emacs >=29 and falling back to
`window-text-pixel-size' in older Emacs.
* lisp/org-macs.el (org-string-width): Use the new function.
2023-08-04 10:53:17 +03:00
Ihor Radchenko f5467b53ec
lisp/ob-shell.el: Fix sessions for generic "shell" blocks
* lisp/ob-shell.el (org-babel-prompt-command): Remove variable.
(org-babel-sh-initiate-session): Set prompt according to
`shell-file-name' - either the value set in let-binding provided by
`org-babel-shell-initialize' or using the default Emacs value of
`shell-file-name'.
(org-babel-shell-initialize): Do not set `org-babel-prompt-command'.
Only let-bind `shell-file-name' according to shell variant in src
block.
2023-08-04 09:30:47 +03:00
Ihor Radchenko 5ed2763b15
org-id-update-id-locations: Optimize performance
* lisp/org-id.el (org-id--locations-checksum): New internal variable
holding list of files and their modification times for the last known
ID list.
(org-id-update-id-locations): Do nothing when the ID locations
correspond to the same ID file list and modification times.  Convert
SEEN-IDS to hash table for faster lookup of the duplicates.  Re-enable
element cache.  Avoid queries to heading properties that would force
full parsing.
2023-08-03 16:52:04 +03:00
Ihor Radchenko b11894aa55
org-lint: Use markers instead of line number to track report positions
* lisp/org-lint.el (org-lint--generate-reports): Store marker to
reports as text property in the Line field.
(org-lint--current-marker): New function retrieving marker
corresponding to current report.
(org-lint--jump-to-source): Jump using marker, not line number.

This fixes *Org Lint* report jumping to wrong location when the Org
buffer is edited while going through the report.
2023-08-03 16:03:56 +03:00
Ihor Radchenko 8b9e3be9a9
* lisp/ob-comint.el (org-babel-comint-async-dangling): Fix docstring
Make first line a complete sentence.
2023-08-03 11:45:15 +03:00
Ihor Radchenko 2c4c5fdd8b
Merge branch 'bugfix' 2023-08-03 08:29:54 +03:00
Ihor Radchenko bf45090f4c
org-element--cache-for-removal: Fix changing heading granularity
* lisp/org-element.el (org-element--cache-for-removal): Do not update
heading using object granularity.  `org-element-at-point' parses
headings without :title objects and cache updates should not change
this.
2023-08-03 08:28:01 +03:00
Ihor Radchenko 63e8cac2ca
org-goto-sibling: Fix when called from inlinetask
* lisp/org.el (org-goto-sibling): Do not try to find inlinetask
siblings.  Clarify the docstring.
* testing/lisp/test-org.el (test-org/goto-sibling): New test.
2023-08-02 16:06:02 +03:00
Ihor Radchenko 345d4e09b5
org-insert-drawer: Make sure that point is left inside drawer
* lisp/org.el (org-insert-drawer): Leave and reveal point inside
drawer even when we insert property drawer or drawer around region, as
advertised by the docstring.
2023-08-02 15:42:53 +03:00
Ihor Radchenko 83575624ab
Ensure that clocking drawer is inserted before point
* lisp/org-clock.el (org-clock-find-position): Insert before point
when creating drawers.  This makes sure that newly inserted drawer do
not interfere with user typing.  See f993ecd67.
* lisp/org-clock.el (org-clock-in): Add commentary.
2023-08-02 15:23:06 +03:00
Ihor Radchenko 28b6a231e9
org-element-normalize-contents: Fix when ELEMENT is anonymous
* lisp/org-element.el (org-element-normalize-contents): Use
`org-element-set-contents' to set contents instead of assuming
(TYPE PROP CONTENTS) structure.
2023-08-02 12:04:30 +03:00
Ihor Radchenko 8e2f6d94e9
ob-C: Fix docstrings
* lisp/ob-C.el (org-babel-execute:cpp):
(org-babel-expand-body:cpp):
(org-babel-execute:C++):
(org-babel-expand-body:C++):
(org-babel-execute:D):
(org-babel-expand-body:D):
(org-babel-execute:C):
(org-babel-expand-body:C):
(org-babel-C-execute):
(org-babel-C-expand-C++):
(org-babel-C-expand-C):
(org-babel-C-expand-D):
(org-babel-C-val-to-base-type):
(org-babel-C-var-to-C): Mention all the arguments.
(org-babel-prep-session:C):
(org-babel-load-session:C): Make first line a proper short description
consisting of a single sentence.
2023-08-02 10:42:39 +03:00
Ihor Radchenko 7b80334fda
org-lint-timestamp-syntax: Improve lint message
* lisp/org-lint.el (org-lint-timestamp-syntax): Mention the original
timestamp in the link message.

Reported-by: Fraga, Eric <e.fraga@ucl.ac.uk>
Link: https://orgmode.org/list/87y1iuyb3m.fsf@ucl.ac.uk
2023-08-02 09:31:44 +03:00
Ihor Radchenko 20d90b9790
org-lint-export-option-keywords: Improve message and ignore `org-default-properties'
* lisp/org-lint.el (org-lint-export-option-keywords): Mention which
backends the suspicious properties may belong to.  Avoid triggering on
`org-default-properties'.

Reported-by: Fraga, Eric <e.fraga@ucl.ac.uk>
Link: https://orgmode.org/list/87y1iuyb3m.fsf@ucl.ac.uk
2023-08-02 09:31:21 +03:00
Ihor Radchenko f9d2d92f42
Merge branch 'bugfix' 2023-08-02 08:18:15 +03:00
Ihor Radchenko 6c1ff952fe
Make transient overlay lists permanent-local
* lisp/org-clock.el (org-clock-overlays):
* lisp/org-colview.el (org-columns-overlays):
* lisp/org-num.el (org-num--overlays):
* lisp/org-table.el (org-table-header-overlay):
(org-table-coordinate-overlays):
* lisp/org.el (org-custom-properties-overlays):
(org-occur-highlights):
(org-inline-image-overlays): Mark as permanent-local to not lose track
of the overlays when changing major modes.

Reported-by: Eli Qian <eli.q.qian@gmail.com>
Link: https://orgmode.org/list/871qgmeleu.fsf@gmail.com
2023-08-02 08:16:47 +03:00
Ihor Radchenko 8aa6e8125d
lisp/ob-cal.el: Fix docstrings
* lisp/ob-calc.el (org-babel-execute:calc): Mention all the args.
(org-babel-calc-maybe-resolve-var): Add docstring.
2023-08-02 08:05:29 +03:00