Commit graph

18915 commits

Author SHA1 Message Date
Ihor Radchenko 607c230d74
org-with-point-at: Accept syntax node as POM 2023-07-01 14:35:46 +03:00
Ihor Radchenko f225e24869
org-element--current-element: Make defsubst 2023-07-01 14:35:45 +03:00
Ihor Radchenko b00c2d0e1d
org-element--parse-to: Provide deferred :parent when cache is inactive
* lisp/org-element.el (org-element--headline-parent-deferred): New
function to calculate :parent of a heading on demand.
(org-element--parse-to): Assign deferred :parent when cache is
inactive.
2023-07-01 14:35:44 +03:00
Ihor Radchenko bc29f5de41
org-element: New `org-element-*property*' functions
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties.  The functions are `setf'-able.

Update all the relevant code in Org to use the new functions instead
of genetic property queries.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 81a7e8c836
org-element-lineage: Allow TYPES to be a symbol
* lisp/org-element-ast.el (org-element-lineage): Allow TYPES argument
to be a symbol.
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii-format-inlinetask-default):
(org-ascii-section):
* lisp/ox-beamer.el (org-beamer--format-block):
* lisp/ox-html.el (org-html-section):
(org-html-table-cell):
(org-html-table-row):
* lisp/ox-latex.el (org-latex-table-cell):
(org-latex-table-row):
* lisp/ox-odt.el (org-odt-headline):
(org-odt-table-style-spec):
(org-odt-get-table-cell-styles):
(org-odt-table-cell):
(org-odt-table-row):
* lisp/ox-org.el (org-org-section):
* lisp/ox-publish.el (org-publish-collect-index):
* lisp/ox-texinfo.el (org-texinfo--get-node):
(org-texinfo-section):
(org-texinfo-table-row):
* lisp/ox.el (org-export--skip-p):
(org-export-get-node-property):
(org-export-table-cell-borders):
(org-export-table-row-in-header-p):
(org-export-table-row-number):
(org-export-collect-headlines): Update all the callers.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 2d22d7f515
ox.el: Rename `org-element-get-parent-element' and move to org-element
* lisp/org-element.el: Rename `org-element-get-parent-element' to
`org-element-parent-element'.
* lisp/org-compat.el (org-export-get-parent-element):
* lisp/ox.el (org-export-get-parent-element): Remove, adding obsolete
alias.
(org-export--skip-p):
* lisp/org-table.el:
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-footnote-reference):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-format-label):
(org-odt-link--inline-image):
(org-odt-link--inline-formula):
* lisp/ox-texinfo.el (org-texinfo--inline-image): Update all the
callers.
2023-07-01 14:35:42 +03:00
Ihor Radchenko ea4f4fdf58
Rename org-export-get-parent' to org-element-parent' 2023-07-01 14:35:41 +03:00
Ihor Radchenko 6a7aee2c35
org-texinfo--normalize-headlines: Use `org-element-create' 2023-07-01 14:35:40 +03:00
Ihor Radchenko a43cc8c9aa
org-export-get-node-property: Use `org-element-property-inherited' 2023-07-01 14:35:40 +03:00
Ihor Radchenko a2730b47fa
org-odt--paragraph-style: Use `org-element-lineage' 2023-07-01 14:35:39 +03:00
Ihor Radchenko 69383dfc24
org-ascii--current-justification: Use `org-element-lineage-map' 2023-07-01 14:35:38 +03:00
Ihor Radchenko 44baf8f2b8
org-element-parse-buffer: New optional argument to not force undefer
* lisp/org-element.el (org-element-parse-buffer): Do not force-undefer
when new optional argument is provided.
* lisp/org-lint.el (org-lint--generate-reports):
* lisp/org.el (org-unindent-buffer):
* lisp/ox.el (org-export--missing-definitions):
(org-export--annotate-info): Do not undefer when unnecessary.

Adjust all the declare forms.
2023-07-01 14:35:37 +03:00
Ihor Radchenko 244cc7d560
org-element-org-data-parser: Defer parsing
* lisp/org-element.el (org-element--get-category): New function
calculating buffer category, excluding top-level property drawer.
(org-element--get-global-node-properties): Set category as well,
calling `org-element--get-category'.
(org-element-org-data-parser): Defer category and top-level drawer
property parsing.
2023-07-01 14:35:37 +03:00
Ihor Radchenko a06dc07cc0
org-element: Defer more when parsing headings and inlinetasks
* lisp/org-element.el (org-element-headline-parser--deferred):
(org-element--headline-deferred): Rename.
(org-element--headline-archivedp):
(org-element--headline-footnote-section-p):
(org-element--headline-parse-title): New internal helpers.
(org-element-headline-parser):
(org-element-inlinetask-parser): Defer parsing headline components.
*
testing/lisp/test-org-attach.el (test-org-attach/dired-attach-to-next-best-subtree/1):
Use property API instead of relying upon internal syntax node representation.
2023-07-01 14:35:36 +03:00
Ihor Radchenko a7d1dfa171
Use `org-element-type-p'
Use `org-element-type-p' across Org source, except some tests, where `eq' can
produce more meaningful failure explanations.
2023-07-01 14:35:35 +03:00
Ihor Radchenko 5e94d5cef6
org-element-map: Allow FUN to be a lisp form
* lisp/org-element-ast.el (org-element-ast-map):
* lisp/org-element.el (org-element-map): Allow FUN to be a lisp form,
wrapping it into lambda.
2023-07-01 14:35:34 +03:00
Ihor Radchenko 71e2ea5698
org-element: Update docstrings using new syntax node terminology 2023-07-01 14:35:34 +03:00
Ihor Radchenko 23f9347d1a
org-element-map: Allow TYPES t and add new arg NO-UNDEFER
* lisp/org-element-ast.el (org-element-ast-map):
* lisp/org-element.el (org-element-map): Treat TYPES t as all possible
types.  Add new optional parameter to no resolve deferred while
traversing the AST.
2023-07-01 14:35:33 +03:00
Ihor Radchenko c22697f472
Use new function names org-element-extract' and org-element-set' 2023-07-01 14:35:32 +03:00
Ihor Radchenko 29cb0b370b
org-element-headline-parser: Defer property drawer values
* lisp/org-element.el (org-element--get-node-properties): Defer the
property values.
2023-07-01 14:35:31 +03:00
Ihor Radchenko 4fcdcb456d
org-element: Defer large buffer substrings when parsing
* lisp/org-element.el (org-element--substring):
(org-element--unescape-substring): New functions to be used for
deferred buffer substring calculation.
(org-element--headline-raw-value):
(org-element-comment-block-parser):
(org-element-example-block-parser):
(org-element-export-block-parser):
(org-element-latex-environment-parser):
(org-element-src-block-parser):
(org-element-table-parser):
(org-element--parse-generic-emphasis):
(org-element-inline-babel-call-parser):
(org-element-latex-fragment-parser):
(org-element-export-snippet-parser): Defer large buffer substrings.
2023-07-01 14:35:30 +03:00
Ihor Radchenko daebeb6446
org-element-inlinetask-parser: Use deferred properties 2023-07-01 14:35:30 +03:00
Ihor Radchenko 932c49c7bb
org-element-headline-parser: Use deferred properties
* lisp/org-element.el (org-element--headline-raw-value): New function
calculating :raw-value property dynamically.
(org-element-headline-parser): Use the new function, deferring
:raw-value to reduce memory footprint of the cache.
2023-07-01 14:35:29 +03:00
Ihor Radchenko 55ba9f05a7
org-element-map: Refactor using `org-element-ast-map'
* lisp/org-element.el (org-element-map): Use `org-element-ast-map' to
traverse the AST.  Update the docstring adding new features from
`org-element-ast-map' - FUN can now throw `:org-element-skip' signal
to skip current node and its child nodes.  Clarify the structure of
INFO argument.  Reverse the traverse order for dual keywords -
secondary value is now traversed after the main value.
* testing/lisp/test-org-element.el (test-org-element/map): Update the test
reflecting the change in dual keyword traversal order.
2023-07-01 14:35:28 +03:00
Ihor Radchenko 5f37f77fc6
org-element--cache-shift-positions: Make use of inliner
* lisp/org-element.el: Allow `org-element-property' inliner to expand
into `aref'.
2023-07-01 14:35:27 +03:00
Ihor Radchenko ad75fd2bae
org-element: Use `org-element-create' when parsing 2023-07-01 14:35:27 +03:00
Ihor Radchenko a8286a5a9e
org-element: Record origin buffer when parsing
* lisp/org-element.el (org-element-parse-buffer): Resolve all the
deferred values in the string.  If not, we might leave pointers to
killed buffer.
(org-element--parse-elements): Resolve deferred in objects.
(org-element--object-lex): Store :buffer property.
* lisp/org-macro.el (org-macro--find-date): Do not try to print
:buffer property.
* lisp/org-element.el (org-element--cache-persist-before-write):
(org-element--cache-persist-after-read): Clear and restore
non-printable buffer objects in :buffer property.
2023-07-01 14:35:26 +03:00
Ihor Radchenko f4aa3747e1
org-element: Preserve order of multiple affiliated keywords
* lisp/org-element.el: Do not reverse affiliated keyword order.
(org-element-map): Remove special arrangement to restore keyword
ordering.
(org-element--interpret-affiliated-keywords): Obey the new keyword order.
* lisp/ox.el (org-export-get-caption):
* testing/lisp/test-org-element.el (test-org-element/affiliated-keywords-parser):
* testing/lisp/test-org-element.el (test-org-element/interpret-data):
Do not assume reverse order.

This is one of the undocumented conventions that is inconsistent with
other aspects of the parser.
2023-07-01 14:35:25 +03:00
Ihor Radchenko 924a64da39
org-element: Use the new org-element-ast library
* lisp/org-element.el (org-element-class):
(org-element-interpret-data): Explicitly consider anonymous syntax
node type.
* lisp/org-element.el (org-element-put-property):
(org-element-set-contents):
(org-element-secondary-p):
(org-element-adopt-elements):
(org-element-extract-element):
(org-element-insert-before):
(org-element-set-element):
(org-element-create):
(org-element-copy):
(org-element-lineage): Remove from org-element.el, using
org-element-ast function versions.
* lisp/org-element.el (org-element-headline-parser):
(org-element-inlinetask-parser):
(org-element-item-parser):
(org-element-citation-parser):
(org-element-citation-reference-parser): Assign :secondary property.
(org-element-parse-buffer):
(org-element-parse-secondary-string): Resolve deferred properties.
(org-element--cache-shift-positions): Use the new AST API.
(org-element--cache-for-removal): Use optional argument for
`org-element-set-element' to keep the needed property values.
(org-element--cache-gapless): Bump element cache version when persisting.
* testing/lisp/test-org-element.el (test-org-element/class): Update
test using the new :secondary property convention.
* lisp/ox-man.el (org-man-paragraph): Use the new AST API.
2023-07-01 14:35:24 +03:00
Ihor Radchenko ea9d5b45db
org-element-create: Allow single &rest argument as a list
* lisp/org-element-ast.el (org-element-create): Add special case when
CHILDREN contains a single list of Org notes:

  (let ((children (list a b c ...)))
    (org-element-create 'type nil children))

This will simplify creating new elements when children are stored in a
list.
2023-07-01 14:35:24 +03:00
Ihor Radchenko 6333a20aa5
org-element-ast: New function `org-element-lineage-map' 2023-07-01 14:35:23 +03:00
Ihor Radchenko 6b20a23065
org-element-ast: New function `org-element-type-p' 2023-07-01 14:35:22 +03:00
Ihor Radchenko ae49451364
org-element-ast: New function `org-element-put-property-2'
* lisp/org-element-ast.el (org-element-put-property-2): New function
allowing to pass NODE as the last argument.
2023-07-01 14:35:21 +03:00
Ihor Radchenko 80122a1204
org-element-ast: New function `org-element-property-2' 2023-07-01 14:35:21 +03:00
Ihor Radchenko f611f131ee
org-element-ast: New function `org-element-ast-map'
* lisp/org-element-ast.el (org-element-ast-map): New function
equivalent to `org-element-map', but more low-level.  Unlike
`org-element-map', `org-element-ast' does not consider the details of
Org syntax - just syntax tree structure.
2023-07-01 14:35:20 +03:00
Ihor Radchenko 669e8d8824
org-element-ast: New function `org-element-property-inherited' 2023-07-01 14:35:19 +03:00
Ihor Radchenko 4a8849340d
org-element-ast: New functions to map and resolve property values
* lisp/org-element-ast.el (org-element--properties-mapc): New internal
helper.
(org-element-properties-resolve): New function used to resolve
deferred property values by side effect.
(org-element-properties-mapc):
(org-element-properties-map): New function to map over properties and
their values.
(org-element-resolve-deferred): New alias to resolve all the deferred
values in syntax nodes.
2023-07-01 14:35:18 +03:00
Ihor Radchenko 2d2656f6a7
org-element-ast: Add setters for org-element-property' and org-element-property-1' 2023-07-01 14:35:18 +03:00
Ihor Radchenko 1260f61830
Refactor org-element API for abstract syntax tree
Major changes:
1. Property values can now deferred and computed next time when the
   value is requested.
2. Some properties are stored in an array instead of plist.  The
   functions are inlined to turn the propery queries into direct
   `aref' and `aset' calls to the plist, when applicable.
3. Secondary strings are now considered of `anonymous' type, in
   backwards-compatible way.
4. New functions to map over and/or resolve deferred values of element
   properties.
5. Docstrings and code consistently use "node" for generic syntax tree
   elements, to not confuse the element/object terminology we use in
   the parser.

* lisp/org-element-ast.el (org-element-deferred): New type user to
store deferred values.
(org-element--deferred-resolve-once):
(org-element--deferred-resolve):
(org-element--deferred-resolve-force):
(org-element--deferred-resolve-list): Helper functions used to resolve
the deferred values.
(org-element--standard-properties):
(org-element--standard-properties-idxs):
(org-element--property-idx):
(org-element--parray):
(org-element--plist-property): Store most commonly used properties in
vector for faster access.  Implement inliner helpers to transform
property keywords into array indices.
(org-element-property-1): New function to retrieve property without
resolving deferred value.
(org-element--put-parray):
(org-element-put-property): Refactor, using the new property vector
when applicable.
(org-element--property): New helper function.
(org-element-property): Refactor, using the new property vector and
deferred value resolution.  Add new optional arguments DFLT and
FORCE-UNDEFER.  Define setters.
(org-element-set-contents): Handle anonymous nodes.
(org-element-set):
(org-element-adopt):
(org-element-extract): Rename from `org-element-set-elements',
`org-element-adopt-elements', and `org-element-extract-elements' and
keep backward-compatible alias.  This is to reduce the confusion about
"node" vs. "element" vs. "object".
(org-element-create): Initialize property array correctly.
(org-element-copy): Allow copying secondary strings.  Add new optional
argument KEEP-CONTENTS.
(org-element-lineage): Clarify the limitation when cache is disabled.
(org-element-type): New optional argument to identify anonymous nodes
instead of returning nil for both anonymous nodes and everything not
matching other element types.
2023-07-01 14:35:17 +03:00
Ihor Radchenko d5198e39fb
org-element-ast: Add commentary describing the basics of AST structure
Clarify some of the undocumented concept assumptions about Org syntax
tree that are used in Org code base.  In particular, clarify that
syntax nodes are not necessarily limited by the specific Org syntax -
exporters can define new "pseudo" elements and objects.

Introduce a new concept of deferred values.

Add a new convention to keep secondary property names in a special
:secondary property.

Introduce `anonymous' element type, which was previously
indistinguishable from values that are not Org syntax elements.
2023-07-01 14:35:16 +03:00
Ihor Radchenko f750f46c9d
Factor out pure syntax tree API to org-element-ast.el (copy old functions)
The functions to be modified are copied here for better diffs with
subsequent commits.
2023-07-01 14:35:15 +03:00
Ihor Radchenko 184b735323
Merge branch 'bugfix' 2023-07-01 13:26:08 +03:00
Gerard Vermeulen a4586f0d71
org: fix symbol names and grammar in docstrings
* lisp/org.el (org-outline-level):
* lisp/org.el (org-current-level): change undefined symbol names
  to `org-odd-levels-only' and change "Unlike to" to "Unlike".
2023-07-01 13:25:21 +03:00
Ihor Radchenko 64a0a624d2
org-insert-structure-template: Err on empty TYPE
* lisp/org.el (org-insert-structure-template): Throw a user error on
empty TYPE input.  Throw an error when TYPE is not a string or an
empty string.

Reported-by: pva-outdoor@yandex.ru
Link: https://orgmode.org/list/87a5wij05o.fsf@yandex.ru
2023-07-01 13:22:46 +03:00
Ihor Radchenko 85aa3c1850
org-narrow-to-block: Use element API and handle all the block types
* lisp/org.el (org-narrow-to-block): Narrow to any block type,
including dynamic blocks.  Use org-element API.

Reported-by: pva-outdoor@yandex.ru
Link: https://orgmode.org/list/87a5wij05o.fsf@yandex.ru
2023-07-01 13:18:38 +03:00
Ihor Radchenko dc70878fc0
org-lint: Add new linter for ambiguous literal $
* lisp/org-lint.el (org-lint-LaTeX-$-ambiguous): New linter that
matches "$.12" and similar that match right LaTeX fragment boundary,
but are likely indented for literal use.

Reported-by: Paul Rubin <paulr@hackyon.net>
Link: https://orgmode.org/list/49c5dcf6-26fa-5fe1-1778-c932d056eadb@hackyon.net
2023-07-01 13:03:11 +03:00
Ihor Radchenko c33ea8f9e2
org-refile: Fix typo in 94c2c8d92
* lisp/org-refile.el (org-refile): Fix typo in variable name.
2023-06-30 15:49:57 +03:00
Ihor Radchenko a19654583c
Refactor `org-fast-tag-selection'
* lisp/org.el (org-fast-tag-selection): Refactor the function, adding
commentary and renaming variables to more readable names.
2023-06-30 15:46:51 +03:00
Ihor Radchenko f5001c0da6
Refactor `org-fast-todo-selection'
* lisp/org.el (org-fast-todo-selection): Refactor the function, adding
commentary and renaming variables to more readable names.
2023-06-30 15:46:51 +03:00
Matthew Trzcinski 88c572de25 Create aliases for export region functions
lisp/ox-ascii.el: Create alias `org-export-region-to-ascii` for
`org-ascii-convert-region-to-ascii`.
lisp/ox-html.el: Create alias `org-export-region-to-html` for
`org-html-convert-region-to-html`.
lisp/ox-latex.el: Create alias `org-export-region-to-latex` for
`org-latex-convert-region-to-latex`.
lisp/ox-md.el: Create alias `org-export-region-to-md` for
`org-md-convert-region-to-md`.
lisp/ox-texinfo.el: Create alias `org-export-region-to-texinfo` for
`org-texinfo-convert-region-to-texinfo`.
doc/org-manual.org: Change commands from "*-convert-region-*" form to
the "org-export-region-to-*" aliases.  Add function index for aliases.
2023-06-29 21:18:01 +02:00
Ihor Radchenko 5df1ee36ae
org-refile: Fix typo in 94c2c8d92
* lisp/org-refile.el (org-refile): Fix typo in variable name.
2023-06-28 12:34:53 +03:00
Ihor Radchenko 7da765e459
Revert "org-replace-escapes: Fix compiler warning"
This reverts commit 39786a8dbf.

In favor of an equivalent upstream Emacs commit 670174a6d5f.
2023-06-26 13:43:44 +03:00
Ihor Radchenko ca873f7fe4
Update version number for the 9.6.7 release 2023-06-25 14:06:19 +03:00
Ihor Radchenko 39786a8dbf
org-replace-escapes: Fix compiler warning
* lisp/org-macs.el (org-replace-escapes): Do not modify constant
string.
2023-06-25 14:05:36 +03:00
Ihor Radchenko f8b0b2babf
org-edit-special: Fix docstring
* lisp/org.el (org-edit-special): Document missing contexts in the docstring.
2023-06-25 13:45:18 +03:00
Ihor Radchenko 18f003a164
Merge branch 'bugfix' 2023-06-24 15:36:34 +03:00
Ihor Radchenko 421b443483
org-babel-tangle-single-block: Fix compiler warning
* lisp/ob-tangle.el (org-outline-regexp): Declare variable.
2023-06-24 15:34:22 +03:00
Ihor Radchenko 0a842cc94b
org-forward-heading-same-level: Do not rely on match-data from `org-back-to-heading'
* lisp/org.el (org-forward-heading-same-level): Use
`org-current-level' instead of relying upon `org-back-to-heading' to
set match data.

Reported-by: Nick Dokos <ndokos@gmail.com>
Link: https://orgmode.org/list/87352hk0nt.fsf@alphaville.usersys.redhat.com
2023-06-24 15:33:59 +03:00
Ihor Radchenko 57bb9cada3
org-mouse-transform-to-outline: Do not rely on match-data from `org-back-to-heading'
* lisp/org-mouse.el (org-mouse-transform-to-outline): Use
`org-current-level' instead of relying upon `org-back-to-heading' to
set match data.

Reported-by: Nick Dokos <ndokos@gmail.com>
Link: https://orgmode.org/list/87352hk0nt.fsf@alphaville.usersys.redhat.com
2023-06-24 15:33:13 +03:00
Ihor Radchenko f56ca5009e
fixup! org-babel-tangle-single-block: Do not rely on match-data from `org-back-to-heading' 2023-06-24 15:32:40 +03:00
Ihor Radchenko 94c2c8d929
Inhibit error when saving bookmarks with `debug-on-error' set to non-nil
* lisp/org-capture.el (org-capture-store-last-position):
* lisp/org-refile.el (org-refile): Use `condition-case' instead of
`with-demoted-errors' when saving bookmarks.  We intent to suppress
errors completely here (116c09053), even when `debug-on-error' is set.
`with-demoted-errors' does trigger error in such scenario, unlike
explicit `condition-case' clause.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/875y7d7jlr.fsf@gmail.com
2023-06-24 15:05:12 +03:00
Dmitry Logvinenko 5b3a1a634c
lisp/org-habit.el: Inherit habit style property
* lisp/org-habit.el (org-is-habit-p):  Use `org-entry-get' with
'selective option to optionally find habit subheadings.
* etc/ORG-NEWS: Describe a breaking change.

TINYCHANGE
2023-06-23 13:47:51 +03:00
Tim Visher bea9fca183
org-capture.el: Allow `(here)' as a template target
* lisp/org-capture.el (org-capture-set-target-location): Allow
`(here)' as a template target in addition to `here'.
(org-capture-templates): Update the docstring, describing the new
target.
* doc/org-manual.org (Template elements): Add `(here)' target
documentation
* etc/ORG-NEWS (Capture templates now support ~(here)~ as a target):
Document the new feature.

Templates had no user accessible way to target the current location
directly from a capture template. Attempting to directly utilize the
behavior accessible through a 0 prefix arg exposed the inconsistent
treatment of the `:target` property in
`org-capture`. `org-capture-set-target-location` understood that it
could be both a symbol and a list, while `org-capture` itself required
it to be a list through its use of `car`.

This change opts to make `org-capture-set-target-location` more
liberal in what it accepts rather than making `org-capture` agree that
targets can be lists. This is because the manual implies, especially
in the `(clock)' entry, that targets are expected to be lists even if
they are meant as specific points.

TINYCHANGE
2023-06-22 13:14:12 +03:00
Ihor Radchenko 200d168275
Merge branch 'bugfix' 2023-06-22 12:54:51 +03:00
Ihor Radchenko 79ec91584c
org-babel-tangle-single-block: Do not rely on match-data from `org-back-to-heading'
* lisp/ob-tangle.el (org-babel-tangle-single-block): Explicitly move
to the beginning of title instead of assuming that
`org-back-to-heading' sets match data appropriately (it is not
documented to do so).
* testing/lisp/test-ob-tangle.el (ob-tangle/comment-org): Add test.

Reported-by: Nick Dokos <ndokos@redhat.com>
Link: https://orgmode.org/list/87bkh8k3at.fsf@alphaville.usersys.redhat.com
2023-06-22 12:54:23 +03:00
Ihor Radchenko c8c8e3326d
org-priority-show: Fix the docstring after changes in "priority" for agenda
* lisp/org.el (org-priority-show): Do not wrongly assert that the
priority is affected by scheduled and deadline values.  This was not
true in the past for Org mode buffers, and it is no longer true after
8fab6eeef renamed composite agenda rank from priority to urgency.

* etc/ORG-NEWS (~org-priority=show~ command no longer adjusts for
scheduled/deadline): Document the change, right before the NEWS item
describing changes in the agenda.
2023-06-21 20:22:43 +03:00
Jack Kamm 294a4d2fe2 ox-icalendar: Add support for unscheduled and repeating TODOs
* lisp/ox-icalendar.el (org-icalendar-todo-unscheduled-start): New
customization to control the exported start time of unscheduled tasks.
(org-icalendar--rrule): Helper function for RRULE export.
(org-icalendar--vevent): Use the new helper function for RRULE.
(org-icalendar--repeater-type): Helper function to get the repeater
type, and display warning if not supported.
(org-icalendar--vtodo): Change how unscheduled TODOs are handled using
the new customization option.  Export SCHEDULED and DEADLINE
repeaters.  In case of SCHEDULED repeater and a DEADLINE without
repeater, treat DEADLINE as RRULE UNTIL.  Emit a warning for tricky
edge cases that are not yet implemented.
* testing/lisp/test-ox-icalendar.el
(test-ox-icalendar/todo-repeater-shared): Test for exporting shared
SCHEDULED/DEADLINE repeater.
(test-ox-icalendar/todo-repeating-deadline-warndays): Test using
warning days as DTSTART of repeating deadline.
(test-ox-icalendar/todo-repeater-until): Test using DEADLINE as RRULE
UNTIL.
(test-ox-icalendar/todo-repeater-until-utc): Test RRULE UNTIL is in
UTC format when DTSTART is not in local time format.
(test-ox-icalendar/warn-unsupported-repeater): Unit test to warn for
unsupported repeater types.
* lisp/org-lint.el (org-lint-mismatched-planning-repeaters): Add lint
for mismatched SCHEDULED and DEADLINE repeaters.
* testing/lisp/test-org-lint.el
(test-org-lint/mismatched-planning-repeaters): Add test for linting of
mismatched SCHEDULED and DEADLINE repeaters.
* doc/org-manual.org (iCalendar Export): Add link to new variable
`org-icalendar-todo-unscheduled-start'.
2023-06-18 06:51:47 -07:00
Ihor Radchenko 1ec3a43c58
org-lint: Add checker for misspelled export options in properties
* lisp/org-lint.el (org-lint-export-option-keywords): New linter
checking export properties without EXPORT_.

Link: https://orgmode.org/list/87ttv7kp2j.fsf@k-7.ch
2023-06-17 15:09:03 +03:00
Ihor Radchenko 739c8989a7
Merge branch 'bugfix' 2023-06-15 12:39:12 +03:00
Ihor Radchenko 7b3b7b92e7
org-fold-core: Try harder to reduce overheads
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
Clear folds from killed indirect buffers once only.  Avoid calling
`remove-text-properties' when there is nothing to remove.
* lisp/org-fold-core.el (org-fold-core--fix-folded-region): Ignore
deletions more aggressively, avoiding the calls to
`org-fold-core-cycle-over-indirect-buffers'.
2023-06-15 12:36:32 +03:00
Ihor Radchenko a072608567
org-set-font-lock-defaults: Fix checkbox fontification
* lisp/org.el (org-set-font-lock-defaults): Use full
`org-list-full-item-re' that accounts for alphabetical bullets as
well.

Reported-by: pondersson <pondersson@gmail.com>
Link: https://orgmode.org/list/CAHewz5N5vNMiWFuG3t=bZoyVmsYswyerZ6VsLC88DGTXR+AhOA@mail.gmail.com
2023-06-14 13:49:09 +03:00
Ihor Radchenko 2f7b35ac89
org-element-cache: Reduce memory footprint in indirect buffers
* lisp/org-element.el (org-element--cache-setup-change-functions): Set
buffer-local cache values to nil in indirect buffers.

Reported-by: Sebastian Wålinder <s.walinder@gmail.com>
Link: https://orgmode.org/list/87v8funovi.fsf@localhost
2023-06-13 13:08:48 +03:00
Ihor Radchenko 34082ff184
org-indent-line: Fix with line is within blank lines after heading
* lisp/org.el (org-indent-line): Fix when we are within blank lines
after heading.  ELEMENT is then `heading' and looking at :begin - 1
does not make sense.
* testing/lisp/test-org.el (test-org/indent-region): Add test.

Reported-by: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Link: https://orgmode.org/list/d7129804-1f42-ea2b-85e8-18ea1ee32d73@vodafonemail.de
2023-06-11 13:16:31 +03:00
Ihor Radchenko 9082fa8892
Merge branch 'bugfix' 2023-06-08 16:14:13 +03:00
Ihor Radchenko 84e5a4da54
org-element-cache-map: Fix edge case when FUNC removes DATA
* lisp/org-element.el (org-element-cache-map): Fix when DATA is
obsolete after buffer modification.
* testing/lisp/test-org.el (test-org/map-entries): Add test.

Reported-by: Victor A. Stoichita <victor@svictor.net>
Link: https://orgmode.org/list/87v8fzxbfo.fsf@svictor.net
2023-06-08 16:11:38 +03:00
Ihor Radchenko c9f3de6e8f
Merge branch 'bugfix' 2023-06-07 20:34:23 +03:00
Steven Allen f2e71ee726
org.el: inline display of attached images in link descriptions
* lisp/org.el (org-display-inline-images): inline display of attached
images in link descriptions.

Previously, `org-display-inline-images' only inlined images in link
descriptions when they were explicit "file:" links. This change adds
support for "attachment:" links. E.g.:

    [[https://orgmode.org][attachment:emacs-screenshot.png]]
2023-06-07 20:32:26 +03:00
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 e83d4e94d8
fixup! org-fold-core: Fix folding for `isearch-filter-prediacate' outside isearch
* lisp/org-fold-core.el (org-fold-core--isearch-show-temporary): Fix
edge case when `org-fold-core--isearch-local-regions' contains empty
region.
2023-06-03 11:09:52 +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 1cb5de6211
org-eval: Use `condition-case-unless-debug' for better backtraces 2023-06-02 10:52:12 +03:00
Leo Butler d55a112149
lisp/ob-C.el: replace %f with %s to prevent unneeded rounding
* lisp/ob-C.el (org-babel-C-val-to-C-type): Floats should be printed
as string literals to prevent rounding introduced by %f format.

* testing/lisp/test-ob-C.el (ob-C/float-var): Test that floats are not
rounded when passed as an org :var.
2023-06-02 10:23:58 +03:00
Ihor Radchenko 2c77551a68
org-texinfo-export-to-info: Fix docstring
* lisp/ox-texinfo.el (org-texinfo-export-to-info): Remove description
of a removed argument from the docstring.  The PUB-DIR argument has
been removed in 496ed832d.

Reported-by: Niall Dooley <dooleyn@gmail.com>
Link: https://list.orgmode.org/orgmode/CADS3Lq7W=LZYd3F3aA0p1RaDWdHSmwahvs8oyJfx_Hw0WF9K9Q@mail.gmail.com/
2023-06-02 10:23:57 +03:00
Leo Butler c50b03d99e
lisp/ob-C.el: replace %f with %s to prevent unneeded rounding
* lisp/ob-C.el (org-babel-C-val-to-C-type): Floats should be printed
as string literals to prevent rounding introduced by %f format.

* testing/lisp/test-ob-C.el (ob-C/float-var): Test that floats are not
rounded when passed as an org :var.
2023-06-02 10:21:28 +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 7dee2c07f4
org-fold-core: Fix folding for `isearch-filter-prediacate' outside isearch
* lisp/org-fold-core.el (org-fold-core--keep-overlays): New internal
macro, signaling `org-fold-core-region' to keep overlays in place and
store new overlays for later use in isearch.
(org-fold-core-region): Never remove overlays and store newly created
ones in `org-fold-core--isearch-overlays' when
`org-fold-core--keep-overlays' is non-nil.  Remove resolved FIXME.
(org-fold-core--isearch-setup): Advice `isearch-clean-overlays' as
more reliable way to clear all the temporary overlays created for
isearch.  `query-replace' and EVIL packages use
`isearch-filter-predicate' separately as thus `isearch-mode-end-hook'
is not sufficient to ensure that isearch overlays are converted back
to text properties.
(org-fold-core--isearch-show-temporary): Do not alter match data, as
isearch expects the match data to stay unchanged.  Arrange the
overlays to be kept for isearch consumption (otherwise, isearch will
signal an error; see
https://list.orgmode.org/orgmode/87pmc4smdg.fsf@fastmail.fm/).
(org-fold-core--create-isearch-overlays): Call `org-fold-core-region'
with let-bound `org-fold-core-style' instead of repeating the code
from `org-fold-core-region'.

Reported-by: Michael Dauer <mick.dauer@gmail.com>
Link:
https://list.orgmode.org/orgmode/CAP7OBx+L11ck3Ni6rv94HGU3otdj6C4rG-rMDzkwR1LTj=BWiw@mail.gmail.com/
Link+: https://list.orgmode.org/orgmode/87pmc4smdg.fsf@fastmail.fm/
Link+: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60399
Link+: https://yhetil.org/emacs-devel/87fs7c10cq.fsf@web.de/
2023-06-01 14:24:33 +03:00
Ihor Radchenko 873b0d22fd
org-fold-core--isearch-reveal: Fix typo
* lisp/org-fold-core.el (org-fold-core--isearch-setup): Fix arguments
in the `org-fold-core-get-region-at-point' call.
2023-06-01 14:22:59 +03:00
Ihor Radchenko 74198ac49c
org-lint: Add linter for unknown babel language
* lisp/org-lint.el (org-lint-suspicious-language-in-src-block): New
linter checking for unknown src block languages.
2023-05-31 11:40:47 +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 93492b8619
org-compile-file: Ensure whitespace before ERR-MSG
* lisp/org-macs.el (org-compile-file): Make sure that ERR-MSG has
lading whitespace and no trailing whitepace when displaying error.

Reported-by: Niall Dooley <dooleyn@gmail.com>
Link:
https://orgmode.org/list/CADS3Lq5Uv4gK0U93H2EX9r=g43BbhzHT33oXbWVg7bAURmFvFw@mail.gmail.com
2023-05-25 13:56:32 +02:00
Ihor Radchenko 8037aab493
org-texinfo-export-to-info: Fix docstring
* lisp/ox-texinfo.el (org-texinfo-export-to-info): Remove description
of a removed argument from the docstring.  The PUB-DIR argument has
been removed in 496ed832d.

Reported-by: Niall Dooley <dooleyn@gmail.com>
Link: https://list.orgmode.org/orgmode/CADS3Lq7W=LZYd3F3aA0p1RaDWdHSmwahvs8oyJfx_Hw0WF9K9Q@mail.gmail.com/
2023-05-24 16:56:24 +02:00
Ihor Radchenko 6d9f3af774
org-element--parse-to: Micro optimizations
* lisp/org-element.el (org-element-headline-parser): Store :true-level
property.
(org-element--parse-to): Call `org-get-limited-outline-regexp'
directly rather than via `org-with-limited-levels'.  Avoid moving
point unnecessarily.  Prefer `org-headline-re' to generate regexps.
* lisp/org-macs.el (org-headline-re):
(org-skip-whitespace): Inline.
2023-05-18 15:22:49 +02:00
Ihor Radchenko 64e15ea0b0
Optimize org-element--cache-compare
* lisp/org-element.el (org-element--cache-key): Reduce property and
type queries.
(org-element--cache-compare): Convert into `defsubst'.
2023-05-18 15:22:49 +02:00
Ihor Radchenko 534045979d
org-element--current-element: Do not try to query cache
* lisp/org-element.el (org-element--current-element): Do not try to
search cache.  This is rarely useful and forces an awkward
`org-element-copy' workaround what parsing buffer.
(org-element--parse-elements): Do not use `org-element-copy' for
element at point - it is now safe to assume that
`org-element--current-element' does not return cached.
(org-element--parse-to): Do not force disabled cache when calling
`org-element--current-element'.  It is no longer needed.
2023-05-18 15:22:48 +02:00
Ihor Radchenko bc4ee1c72a
org-element--current-element: Micro optimizations
* lisp/org-element.el (org-element--current-element): Try hard
spending minimal amount of time in testing which parser to call.
Prefer `look-at-p' that does not modify match data and thus save us
significant amount of time.  Do not call `org-with-limited-levels' and
instead use the simplest possible tests with all unnecessary branches
removed.  Add commentary explaining the importance of writing fast
core when adding new elements.
(org-inlinetask-min-level): Declare variable.

* lisp/org-list.el (org--item-re-cache):
(org-item-re): Cache results rather than calculating regexp every time
the parser is invoked.
* lisp/org-macs.el:
(org--headline-re-cache):
(org--headline-re-cache-no-bol):
(org--headline-re-cache-bol):
(org-headline-re): Prefer plists to store headline regexp cache - the
number of items tends to be within 10-20 and hence hash table is an
overkill and will be slower.
2023-05-18 15:22:44 +02:00
Ihor Radchenko 3a4f9604f1
Cache <N>-level headline regexps instead of calculating dynamically
* lisp/org-macs.el (org-headline-re): New function to retrieve cached
or get a new regexp for headline of level TRUE-LEVEL.
(org-get-limited-outline-regexp): Use `org-headline-re'.  Add new
optional argument WITH-BOL.
2023-05-18 15:07:24 +02:00
Ihor Radchenko bfa362c47d
org-element-section-parser: Optimize performance
* lisp/org-element.el (org-element-section-parser): Call
`re-search-forward' directly instead of using `outline-next-heading'.
2023-05-18 14:15:02 +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 fe74a3ed2d
org-crypt-decrypt-entry: Apply initial visibility upon decryption
* lisp/org-crypt.el: Call `org-cycle-set-startup-visibility' on the
decrypted entries.  Still re-fold if the decrypted entry has been
inside an existing fold.
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Respect narrowing.
* etc/ORG-NEWS (=org-crypt.el= now applies initial visibility settings
to decrypted entries): Announce the change.

This patch solves a slight annoyance when the freshly decrypted entry
is fully unfolded, including all the property drawers.  It will make
more sense to make the folding state follow initial visibility
settings, including VISIBILITY properties.
2023-05-15 15:35:56 +02:00
Jim Wisniewski 9d06e7bf80
ox.el: Add more customizable `org-export-dispatch' options
* lisp/ox.el (org-export-dispatch): Add customizable variables
`org-export-body-only', `org-export-visible-only', and
`org-export-force-publishing', and use them in `org-export-dispatch'.
* doc/org-manual.org (The Export Dispatcher): Document the new export
variables.
* etc/ORG-NEWS (New customization options for ~org-export-dispatch~):
Announce the new customization options.

Currently when calling `org-export-dispatch', two of the export
options can have their defaults specified with customizable variables:
"Export scope" (via `org-export-initial-scope') and "Async export"
(via `org-export-in-background').  This change adds customizable
variables for the "Body only", "Visible only", and "Force publishing"
options as well.
2023-05-14 16:16:01 +02:00
Ihor Radchenko cfb2ddab11
org-update-checkbox-count: Disable fold modification check 2023-05-14 14:11:26 +02:00
Ihor Radchenko ea3d06e57e
org-element--cache-active-p: Fix when cache is not initialized 2023-05-14 14:09:03 +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 c8e8f4e3c2
org-fold--reveal-headline-at-point: Fix edge case with invisible subtree 2023-05-14 14:04:41 +02:00
Ihor Radchenko 6fd6b94cd5
org-element-parse-buffer: Use "property" term consistently 2023-05-14 14:01:18 +02:00
Ihor Radchenko aafa0c2828
org-element: Cache commonly used property value strings in obarray
* lisp/org-element.el (org-element--string-cache): New obarray holding
common strings in Org AST.
(org-element--get-cached-string): New function retrieving interned
string object.
(org-element-drawer-parser):
(org-element-dynamic-block-parser):
(org-element-footnote-definition-parser):
(org-element-headline-parser):
(org-element-inlinetask-parser):
(org-element-item-parser):
(org-element-special-block-parser):
(org-element-keyword-parser):
(org-element-node-property-parser):
(org-element-src-block-parser):
(org-element-citation-parser):
(org-element-citation-reference-parser):
(org-element-export-snippet-parser):
(org-element-footnote-reference-parser):
(org-element-inline-babel-call-parser):
(org-element-inline-src-block-parser):
(org-element-link-parser):
(org-element-macro-parser): Reuse string objects that are likely to
occur in parsed elements.
2023-05-14 14:00:44 +02:00
Ihor Radchenko ec694f00de
org-element-inlinetask-parser: Store boolean instead of larger integer 2023-05-14 13:56:05 +02:00
Ihor Radchenko b70ef01ff2
org-element: Prefer property values that occupy less memory
* lisp/org-element.el (org-element-subscript-parser):
(org-element-superscript-parser): Use boolean values where it is
sufficient.
2023-05-14 13:55:35 +02:00
Ihor Radchenko 57eb97fa35
org-element: Consistently drop text properties when parsing
* lisp/org-element.el (org-element-headline-parser):
(org-element-inlinetask-parser):
(org-element-item-parser):
(org-element-example-block-parser):
(org-element-src-block-parser):
(org-element-link-parser):
(org-element-timestamp-parser): Do not preserve text properties in the
element property values that are strings.
2023-05-14 13:52:57 +02:00
Ihor Radchenko 17608670a4
Update version number for the 9.6.6 release 2023-05-14 09:37:51 +02:00
Ihor Radchenko ef4d8adcaa
fixup! org-lint: Lint malformed timestamps 2023-05-13 12:42:05 +02:00
Ihor Radchenko ab542a6532
org-lint: Lint malformed timestamps
* lisp/org-lint.el (org-lint-timestamp-syntax): New linter checking
timestamp syntax.

Link: https://list.orgmode.org/orgmode/87a6c3urkv.fsf@localhost/
2023-05-13 12:39:25 +02:00
Ihor Radchenko 30b790f42b
org-refile: Fix heading being removed when refiling into itself
* lisp/org-refile.el (org-refile): Throw an error when attempting to
refile heading into itself and the point is not at bol.
* testing/lisp/test-org.el (test-org/refile): Add tests.

Reported-by: Oliver Epper <oliver.epper@gmail.com>
Link: https://list.orgmode.org/orgmode/CAP8tsuSEScO+Q7=g7kL=9Dk-95reJvUmLoyqmJjd2-ZM6iycfA@mail.gmail.com/
2023-05-11 12:07: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 fdea20084d
org-element-cache-map: Fix edge case
* lisp/org-element.el (org-element-cache-map): Fix when we use
NEXT-RE/FAIL-RE, the initial cached guess is not right, and the
NEXT-RE hits not-yet-cached element.
2023-05-07 14:56:54 +02:00
Max Nikulin ed0cfbd7b5
org-clock.el: Fix week start != 1
* lisp/org-clock.el (org-clock-special-range): Prevent returning
previous week for `thisweek' KEY when WSTART is 0.  Treat both 0 and 7
as Sunday.
* testing/lisp/test-org-clock.el (test-org-clock/special-range): New
test for `thisweek' and various WSTART arguments.

It seems only the case of weeks starting on Monday was tested.
Other variants caused shifted intervals.

Bug report: Marcin Borkowski. What is a week?
Mon, 10 Apr 2023 05:35:44 +0200.
<https://list.orgmode.org/87h6to1ka7.fsf@mbork.pl>
2023-05-07 10:03:52 +02:00
Ihor Radchenko 8944124edf
Revert "org-persist-gc: GC collections without persist file"
`org-persist-gc' is ran before `org-persist-write-all' and we may not
yet have all the persist files written.  Absence of a persist files is
thus not a sign that collection is expired.

This reverts commit e11073d17d.
2023-05-06 17:50:18 +02:00
Ihor Radchenko 080710797a
fixup! org-babel-common-header-args-w-values: Add docstring 2023-05-03 19:51:33 +02:00
Ihor Radchenko f268819d19
org-babel-common-header-args-w-values: Add docstring
* lisp/ob-core.el (org-babel-common-header-args-w-values): Add missing
docstring.
2023-05-03 19:19:28 +02:00
Ihor Radchenko e11073d17d
org-persist-gc: GC collections without persist file
* lisp/org-persist.el (org-persist-gc): Do not store collections that
lack persist file.  Such collection may emerge, for example, when
writing fails or gets blocked for some reason (in
`org-persist-before-write-hook' or when associated with encrypted
file).

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/CAM9ALR_F4gjWxOVh_Eq14NOC9nF6g0Cv1jAKb=p4FjPvjqSkWQ@mail.gmail.com
2023-05-03 12:55:26 +02:00
Ihor Radchenko 5ec364a1ae
org-cite-list-bibliography-files: Preserve relative bibliography paths
* lisp/oc.el (org-cite-list-bibliography-files): When the bibliography
path is relative to the exported file location, keep the path
relative.  Resolve relative paths for bibliographies from SETUPFILE as
well.

* testing/lisp/test-oc.el (test-org-cite/list-bibliography-files):
* testing/examples/sub-bib/include-relative-bib.org:
* testing/examples/sub-bib/include-global-bib.org: New test.

Link: https://orgmode.org/list/CAO48Bk_upR4h-xd0YL+FxeKtWvDoqH+Eju6F_Vzds_m6oxBKcg@mail.gmail.com
2023-05-02 14:47:56 +02:00
Gerard Vermeulen e58bbded5c
lisp/ob-lisp: fix `org-babel-execute:lisp' for use with Sly
* lisp/ob-lisp (org-babel-execute:lisp): by default, Sly and Slime
talk with different RPC server programs with different names.
Specialize the prefix of eval-and-grab-output to Slime (prefix swank:)
or to Sly (prefix slynk:).
2023-05-02 14:09:37 +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 7ddc86a2ca
Merge branch 'bugfix' 2023-05-01 12:16:48 +02:00
Ihor Radchenko 08077812ef
org-clock-update-time-maybe: Fix return value
* lisp/org-clock.el: Ensure that we return expected value.
* testing/lisp/test-org-clock.el
(test-org-clok/org-clock-update-time-maybe): Add new test.
2023-05-01 12:15:09 +02:00
Kyle Meyer e5ae9c0ce7 Merge branch 'bugfix' 2023-04-30 19:55:54 -04:00
Stefan Monnier 2993f482c1 Backport commit 2bcf11d0e from Emacs
* lisp/org-macs.el (org--inhibit-version-check): Fix docstring.

2bcf11d0efecd18a1be8bcf0ac1a1dadb14d971a
Stefan Monnier
Sun Apr 30 09:41:13 2023 -0400
2023-04-30 19:34:05 -04:00
Kyle Meyer 2ab083dd1a Merge branch 'km/from-emacs-master' into bugfix
Both Org bugfix's 52dc48050 (Handle compiler warnings from Emacs
master, 2023-04-27) and Emacs master's 4f0849a9e6d (Remove unused
values in effect context, 2023-04-09) comment out an unused condition
in org-babel-insert-result to silence a compiler warning that's new to
the Emacs master branch.  However, the changes are slightly different,
so the next sync to emacs-29 will trigger a conflict when merged to
master.

Takes Emacs's variant to 1) avoid the conflict and 2) undo the
unrelated space change from Org's variant.  (52dc48050 improved the
comment slightly, but it's not worth the conflict.)
2023-04-30 19:32:33 -04:00
Mattias Engdegård b77a209f78 Backport commit 4f0849a9e from Emacs
* lisp/ob-core.el (org-babel-insert-result): Silence
ignored-return-value warnings about calls to side-effect-free
functions in the last clause of `cond` statements whose values are
unused.

Remove unused values in effect context
4f0849a9e6d29e25d23e061bd81bacce9468856d
Mattias Engdegård
Sun Apr 9 16:45:40 2023 +0200
2023-04-30 19:19:03 -04:00
Ihor Radchenko 921e0e8bc1
Update version number for the 9.6.5 release 2023-04-30 19:28:18 +02:00
Ihor Radchenko 128742418b
Merge branch 'bugfix' 2023-04-30 19:18:58 +02:00
Ihor Radchenko a686c7b609
ox-odt: Throw actual error when export fails
* lisp/ox-odt.el (org-odt--export-wrap): Throw an error rather than a
warning when export fails.
2023-04-30 19:18:21 +02:00
Ihor Radchenko c756f8a853
org-odt-plain-text: Fix when TEXT is a blank string
* lisp/ox-odt.el: Do not re-fill newlines when TEXT only contains
spaces.

Reported-by: Damien Cassou <damien@cassou.me>
Link: https://orgmode.org/list/87ttwxphm6.fsf@cassou.me
2023-04-30 19:12:42 +02:00
Ihor Radchenko c265d964f9
ox-odt: Improve some warning messages
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Reference
`org-odt-with-latex' variable in the warning to direct users what to
do.  Only display the warning when there are LaTeX fragments to
convert.
2023-04-30 19:07:26 +02:00
Ihor Radchenko 310a668917
org-compile-file-commands: Fix return value when PROCESS is a function
* lisp/org-macs.el (org-compile-file-commands): Make sure that we
always return a list, as expected by `org-compile-file'.  Document the
return value in the docstring.  Also, document ERR-MSG argument.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CALEYq0_DsD2Ofw1XG4=EbEbJ9nr5_jWoU1+7-kUkmZF=ELhd5Q@mail.gmail.com
2023-04-30 18:42:02 +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 42e95938ed
org-latex-compile: Fix erasing PDF output buffer late
* lisp/ox-latex.el (org-latex-compile): Clear the PDF output log
buffer before running compile command.

Fixes regression introduced in 0dfbf0c3.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CALEYq0_t38_gsmjE-qgPCX07-V0P8FYwYEt9R4AT0dZ_SnXRuA@mail.gmail.com
2023-04-30 10:17:09 +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 f067a4bd43
org-attach-tag: Work around error when before first heading
* lisp/org-attach.el (org-attach-tag): Avoid error thrown when trying
to set tags before first heading.  This is not a proper fix, but it
will at least allow attaching files to Org file.  The tagging will be
skipped for now, until setting FILETAGS is supported by Org API.
2023-04-28 12:52:09 +02:00
Ihor Radchenko 7e75571f02
Handle more compiler warnings from Emacs master
* lisp/org-macs.el (org-id-uuid): Use built-in `time-convert' instead
of function defined in org-compat.  `time-convert' can already be used
as it is available in Emacs 26.
2023-04-27 22:45:47 +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 2bc510217a
org-element--cache-find: Remove statistics gathering code
* lisp/org-element.el (org-element--cache-find): Do not collect
hashing statistics.  According to
https://orgmode.org/list/87sfffawfe.fsf@localhost, it is quite useful
for a fraction of users, yielding up to 30% recent cache queries being
memoized.  Add additional commentary.  Also, slight refactoring.
(org-element--cache-hash-nocache):
(org-element--cache-hash-statistics):
(org-element-cache-hash-show-statistics): Remove.
2023-04-27 15:26:56 +02:00
Ihor Radchenko 9e42842a82
org-persist: Fix :last-access being set on every write
* lisp/org-persist.el (org-persist-write:generic): Do not set
:last-access on write, unless writing first time.  Otherwise,
:last-access may never trigger expiration.
2023-04-26 23:39:49 +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
Zelphir Kaltstahl d97ba5ba52
org-babel-expand-body:scheme: define header arg vars using define
* ob-scheme.el (org-babel-expand-body:scheme,
org-babel-expand-header-arg-vars:scheme): Change the way header
argument :var variables are expanded for for Scheme source blocks.  Use
`define' instead of wrapping using `let'.

Wrapping binding definitions using `let' can lead to issues with GNU
Guile and potentially other Scheme dialects.  GNU Guile will only get
to the body of the let at evaluation time, not at macro expansion
time.  If the let form wraps any imports of libraries that define
macros, then those imported macros are seen too late and their
corresponding forms inside the body of the let are not
expanded.  Using `define' to define bindings avoids this problem, at
least in GNU Guile.

For more context see the mailing list discussion at: https://lists.gnu.org/archive/html/emacs-orgmode/2023-03/msg00087.html

TINYCHANGE
2023-04-25 14:25:30 +02:00
Ihor Radchenko e065b53a4a
Merge branch 'bugfix' 2023-04-24 14:27:42 +02:00
Eli Zaretskii 8eb209984e
Backport commit 62e4eb8fcf7 from Emacs
Fix build when Org's version changes

* lisp/org/org-macs.el (org--inhibit-version-check): Rename from
'org--built-in-p' and make it a defvar.  All users changed.
(Bug#62762)

62e4eb8fcf71a852117b372809bd4a7953f9b679
Eli Zaretskii
Mon Apr 24 14:16:05 2023 +0300
2023-04-24 14:24:27 +02:00
Ihor Radchenko 56f651e961
org-lint: Add new linter for empty header arguments
* lisp/org-lint.el (org-lint-empty-header-argument):
(empty-header-argument): New linter.
2023-04-24 14:01:12 +02:00
Ihor Radchenko 6376237779
org-babel-parse-multiple-vars: Do no err on empty :var
* lisp/ob-core.el (org-babel-parse-multiple-vars): Parse empty :var
header argument into (:var) alist element.
2023-04-24 14:00:49 +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 9440a29828
Merge branch 'bugfix' 2023-04-20 11:05:12 +02:00
Ihor Radchenko 27ee55ebfd
ox-latex: Fix << and >> in verbatim and code markup
* lisp/ox-latex.el (org-latex--protect-texttt): Protect "<<" and ">>"
sequences.

Reported-by: Garid Z. <garidzorigoo@gmail.com>
Link: https://orgmode.org/list/871qkhtb4o.fsf@gmail.com
2023-04-20 11:03:17 +02:00
Ihor Radchenko 264d555e4b
org-org-publish-to-org: Handle fixme
* lisp/ox-org.el (org-org-publish-to-org): Remove setting buffer
modification status.

There is no clear reason why it should be done and none of the tests
are failing without this statement.  Can be re-added if a real problem
is encountered, with appropriate explanation in the comment.
2023-04-20 10:45:05 +02:00
Ihor Radchenko 4929f0c55f
* lisp/ob-R.el: Fix ESS compatibility
(org-babel-R-initiate-session): Fix `require'.  Do not use obsolete
`R' function.
2023-04-17 20:20:58 +02:00
Ihor Radchenko 2ebc518675
* lisp/ob-R.el: Fix ESS compatibility
(org-babel-R-initiate-session): Fix `require'.  Do not use obsolete
`R' function.
2023-04-17 20:17:55 +02:00
Matthew Trzcinski 26ef5e3e5b org-src: Use `sh-mode' for all the shells it can handle
* lisp/org-src.el (org-src--get-known-shells): New helper function
extracting known shells from `sh-ancestor-alist'
(org-src-lang-modes): Update the value

Link: https://orgmode.org/list/CAMbmz5ntkOHMiZG4EbNAks9ob-0ahnciCfHQ9LQmJoci0+i7fg@mail.gmail.com
2023-04-17 10:57:35 -04:00
Ihor Radchenko cfe5e01e14
org-lint: Add checker for $...$ LaTeX fragments
* lisp/org-lint.el (org-lint-LaTeX-$): New checker warning about
semi-obsolete $...$ LaTeX fragment syntax.

Link: https://orgmode.org/list/86ileukojk.fsf@lan
2023-04-17 16:00:41 +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 d4b66e99fd
Merge branch 'bugfix' 2023-04-17 13:12:22 +02:00
Ihor Radchenko 7d8a9324f8
org-babel-js-function-wrapper: Fix when the last line is a comment
* lisp/ob-js.el (org-babel-js-function-wrapper): Ensure that last line
of the body being comment does not shadow the closing parenthesis.

Reported-by: sgherdao@tuta.io
Link: https://orgmode.org/list/NT8rSmu--F-9@tutanota.com
2023-04-17 13:10:10 +02:00
Ihor Radchenko 425f379458
Merge branch 'bugfix' 2023-04-17 12:48:10 +02:00
Ihor Radchenko c827341dfb
org-cite-activate: Ensure that we keep the correct match-data
* lisp/oc.el (org-cite-activate): Discard match data set by activate
function.  We already move the point after citation by force, so can
as well ensure that match-data remain accurate for later font-lock
use.

Reported-by: Lin Jian <me@linj.tech>
Link: https://orgmode.org/list/87sfczztg6.fsf@linj.tech
2023-04-17 12:45:07 +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 81acba727a
Merge branch 'bugfix' 2023-04-16 13:21:07 +02:00
Ihor Radchenko a8a95b6c2c
* lisp/org-agenda.el: Do not modify string constant " "
(org-agenda-highlight-todo): Use `propertize' that copies the argument
string instead of `org-add-props'.  Otherwise, if the compiler
optimizes string constants into a single object, the properties may
populate in unexpected places.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/CAM9ALR95F_ZHV2_WsqAz0-35-S2rwxbHqsA5VGftvq51Yz3ZAQ@mail.gmail.com
2023-04-16 13:18:42 +02:00
Jack Kamm f4446ce795 ox-icalendar: Apply folding to whole VCALENDAR
Moves the calls to `org-icalendar-fold-string' out of
`org-icalendar--vevent' and `org-icalendar--vtodo', instead calling it
from `org-icalendar--vcalendar'.  This way, the string folding applies
to the entire VCALENDAR rather than just the VEVENT or VTODO, as
required by the iCalendar spec.

See also:
https://list.orgmode.org/m2pm85jyw1.fsf@eglen.org.uk/T/#md08cfd0209f6332a1a0c6a54f08544006ff93aed

* lisp/ox-icalendar.el (org-icalendar--vevent, org-icalendar--vtodo):
Remove call to `org-icalendar-fold-string'.
(org-icalendar--vcalendar): Add call to `org-icalendar-fold-string'.
2023-04-15 21:47:58 -07:00
Ihor Radchenko f1fd1f22f4
Update version number for the 9.6.4 release 2023-04-15 13:53:24 +02:00
Ihor Radchenko 07508fb097
org-assert-version: Skip version check when Org is a part of Emacs
* lisp/org-macs.el (org--built-in-p): New constant indicating if Org
source is a part of Emacs source tree.
(org-assert-version): Skip check when Org is built-in.
2023-04-15 13:50:42 +02:00
Ihor Radchenko 9607226610
org-export--prune-tree: Ensure spaces when removing objects
* lisp/ox.el (org-export--prune-tree): If the removed object has
trailing spaces and previous object does not have, keep the trailing
spaces.
* etc/ORG-NEWS (Blank lines after removed objects are not retained
during export): Document the change.

Reported-by: Andrea Lazzarini <andrea.lazzarini1@gmail.com>
Link: https://orgmode.org/list/87o7p7z9k3.fsf@localhost
2023-04-14 13:46:22 +02:00
Timothy 00abdca361
oc-csl: Recognise ¶/§ entity locators
* lisp/oc-csl.el: Recognise org-entity based paragraph and section
locators "\P" and "\S".
2023-04-13 09:02:58 +02:00
Timothy 0f62e9771b
org-entities: Treat ¶ similarly to §
* lisp/org-entities.el: Treat pilcrows / paragraph symbols similarly to
section symbols (§), move them next to each other and add a \P entity.
2023-04-13 09:02:58 +02:00
Timothy cd53816c3a
org-entities: § is a section sign, not paragraph
* lisp/org-entities.el: Correct the ASCII version of § to be "section",
not "paragraph".
2023-04-13 09:02:57 +02:00
Ihor Radchenko 00fb0a0b33
Merge branch 'bugfix' 2023-04-13 09:02:47 +02:00
Timothy 6a96054f05
ob-tangle: Edit default file mode to match docstr
* lisp/ob-tangle.el (org-babel-tangle-default-file-mode): The docstring
states that it the default value is read-write for the user, read only
for everyone else.  This is not consistent with the default value which
is actually read-*execute* for the user, read only for everyone else.
The default value is updated to be read-write for the user, as stated in
the docstring.

Reported-by: Ruijie Yu <ruijie@netyu.xyz>
Link: https://list.orgmode.org/orgmode/sdv3554xtat.fsf@fw.net.yu
2023-04-13 08:59:47 +02:00
Timothy 81fc8c06ce
ob-tangle: Fix interpretation of rw-r--r-- modes
* lisp/ob-tangle.el (org-babel-interpret-file-mode): When specifying a
file mode in the "rw-r--r--" style, this is interpreted by splicing the
user, group, and other compenents into a "u=rw,g=r,o=r" style string and
applying `file-modes-symbolic-to-number`.  For correct interpretation,
we need to ensure the dashes are removed in this process.
2023-04-13 08:59:27 +02:00
Ihor Radchenko 5d32058bf9
Merge branch 'bugfix' 2023-04-12 10:58:44 +02:00
Ihor Radchenko 5ac1ebaa15
org-latex--protect-texttt: Fix "---"
* lisp/ox-latex.el (org-latex--protect-texttt): Fix >2 consecutive
dashes.

Reported-by: Garid Zorigoo <garidzorigoo@gmail.com>
Link: https://orgmode.org/list/CAEDgBW44j4NpYUpppLpOA5Pmmsfi-GbCzDH4rTmRjf-F64mSaA@mail.gmail.com
2023-04-12 10:57:34 +02:00
Ihor Radchenko cd10999e7d
Merge branch 'bugfix' 2023-04-11 12:26:15 +02:00
Ihor Radchenko 60ce29dc41
org-odt-plain-text: Fix when text contains leading spaces
* lisp/ox-odt.el (org-odt-plain-text): Do not count leading spaces
twice.

Reported-by: Damien Cassou <damien@cassou.me>
Link: https://orgmode.org/list/87v8i3y135.fsf@cassou.me
2023-04-11 12:25:13 +02:00
Ihor Radchenko 8dd1cc04d0
Merge branch 'bugfix' 2023-04-09 13:16:38 +02:00
Ihor Radchenko 072ddbc975
org-element-cache: Disable extra consistency checks
* lisp/org-element.el (org-element--cache-self-verify): Switch to nil
by default, disabling costly cache self-verification.  This is
relatively safe as no relevant bug reports have been submitted for a
while.  Also, the most critical cache failures are still monitored.
2023-04-09 13:13:25 +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
Ihor Radchenko 28d41e69d7
Merge branch 'bugfix' 2023-04-07 12:37:40 +02:00
Aaron L. Zeng 19b0d0e5aa
org-table: Fix incorrect input when used with evil-escape
* org-table.el (org-self-insert-command): Use `last-command-event'
instead of `last-input-event'.  Using `last-input-event' causes
problems in the presence of `evil-escape'.  Consider a buffer that has
`orgtbl-mode' enabled while evil-escape is in use.  Assume the
evil-escape sequence is "fd".  Typing "f RET" will instead insert "RET
RET" into the buffer, since `last-input-event' is "RET", but
`last-command-event' is "f".

TINYCHANGE
2023-04-07 12:35:43 +02:00
Aaron L. Zeng 54a743cd72
org-table: Refactor away unnecessary variable
* org-table.el (orgtbl-self-insert-command): Remove unnecessary
intermediate variable.  `(cdr nil)` is nil.

TINYCHANGE
2023-04-07 12:35:42 +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 8fab6eeef2
org-agenda: Rename sorting "priority" to "urgency"
* lisp/org-habit.el (org-habit-get-priority): Rename to
`org-habit-get-urgency'.
* lisp/org-compat.el (org-habit-get-priority): Obsolete the old name.
* lisp/org-agenda.el (org-agenda-sorting-strategy):
* lisp/org-agenda.el (org-search-view):
(org-agenda-get-todos):
(org-agenda-get-timestamps):
(org-agenda-get-progress):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks):
(org-entries-lessp): Alter priority-up and priority-down sorting
strategies to only sort by actual priority.  Rename the previous
composite sorting rank to urgency, corresponding to the new urgency-up
and urgency-down sorting strategies.  Store the new rank in 'urgency
text property.  Update the docstrings accordingly.  Use `urgency-down'
in place of `priority-down' in the default sorting strategy.
(org-set-sorting-strategy): Use `urgency-down' in place of
`priority-down'.
* etc/ORG-NEWS ("Priority" used to sort items in agenda is renamed to
"urgency"): Document the change.
* doc/org-manual.org (Sorting of agenda items): Update manual using
"urgency" term in place of confusing "priority".

Thanks to Samuel Wales for the idea how to fix the inconsistency.

Reported-by: Jonas Olofsson <jonas.olofsson@apple.com>
Link: https://orgmode.org/list/26396316-1201-4D88-9D81-C87DDDA8885A@apple.com
2023-04-06 11:40:30 +02:00
Feraidoon Mehri 5e9953fa0e
ox.el: Refactor ID prefixes
* lisp/ox-html.el (org-html--id-attr-prefix):
* lisp/ox-odt.el (org-odt--id-attr-prefix): Refactor hardcoded "ID-"
as a new private variable.

* org/ox-html.el (org-html--reference): Add support for the ID
property (previously only supported CUSTOM_ID).

These changes make crossfile ID links work in the exported HTML when
`org-html-prefer-user-labels' is not-nil.
2023-04-05 11:22:32 +02:00
Ihor Radchenko 614b96f910
org-lint: Add checker for numbered list item numbers
* lisp/org-lint.el (org-lint-item-number): New checker to ensure
consistency between item bullet text and the counter Org will use when
exporting.
2023-04-04 12:05:03 +02:00
Jack Kamm e10b4054e6 ox-icalendar: Use consistent CRLF line endings
Fixes issue where the ox-icalendar export uses an inconsistent mix of
dos and unix style line endings.

* lisp/ox-icalendar.el (org-icalendar-fold-string): No longer converts
to CRLF, instead delegating that to `org-icalendar--post-process-file'.
(org-icalendar--post-process-file): New function to handle exported
file post-processing.  Converts EOL to CRLF, and then runs
`org-icalendar-after-save-hook'.
(org-icalendar-export-to-ics, org-icalendar-export-current-agenda,
org-icalendar--combine-files): Call `org-icalendar--post-process-file'
instead of running `org-icalendar-after-save-hook' directly.
* testing/lisp/test-ox-icalendar.el: New file for unit tests of
ox-icalendar.  Add an initial test for CRLF line endings.

See also:

https://list.orgmode.org/87o7oetneo.fsf@localhost/T/#m3e3eb80f9fc51ba75854b33ebfe9ecdefa2ded24

https://list.orgmode.org/orgmode/87ilgljv6i.fsf@localhost/
2023-04-02 13:20:56 -07:00
Ihor Radchenko 9ca271c406
org-export: Display warning when code block results cannot be computed
* lisp/ob-exp.el (org-babel-exp-results): Display warning when babel
does not know how to execute exported code block and :results
demands results to be exported.
2023-04-02 17:04:43 +02:00
Ihor Radchenko c316476ee9
org-export: Be less aggressive with window configuration in export dispatch
* lisp/ob-exp.el (org-babel-exp-process-buffer): Do not use
`save-window-excursion'.
* lisp/ox.el (org-export-dispatch):
(org-export--dispatch-ui): Use `save-window-excursion' only when
displaying the dispatch interface.
2023-04-02 17:00:06 +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 2289739ed4
Prefer write-region' to save-file'
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use
non-interactive `insert-file-contents' + `write-region' to avoid
triggering various interactive hooks.  Ensure that temp files are
always deleted.
* lisp/org-agenda.el (org-agenda-write):
* lisp/org-table.el: Simplify code using `write-region'.
* lisp/ox-odt.el (org-odt-template): Use `insert-file-contents' +
`write-region' instead of `find-file-noselect' that may trigger
various hooks.  The new approach makes `revert-buffer' not
necessary (and do not trigger `revert-buffer' hooks).  Also, the
problem with backups will no longer exists.

Original idea: https://list.orgmode.org/orgmode/20221002035931.12191-1-dafydd.lukes@gmail.com/
2023-04-02 16:25:44 +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 f2949d4d1d
org-babel-comint-with-output: Fix edge case for partial prompts
* lisp/ob-comint.el (org-babel-comint-with-output): Do not try to
filter out prompts in `comint-output-filter-functions'.  The prompts
may arrive there arbitrarily - multiple prompts together, partial
prompts, full prompts, etc.  For example "ghci> " prompt may arrive as
"gh" + "ci> " with second part still matching `comint-prompt-regexp'.
As a result, if we keep using `comint-output-filter-functions', the
split prompts may sometimes retain their initial part, littering the
results.  Now, we postpone filtering to after receiving the output,
still making sure that agglomerated prompts gets filtered using a
custom regexp derived from `comint-prompt-regexp'.
2023-04-02 12:15:10 +02:00
Ihor Radchenko 7fa9e9a4b3
org-babel-comint-with-output: Handle agglomerated prompts better
* lisp/ob-comint.el (org-babel-comint-with-output): Consider that
comint can sometimes agglomerate multiple prompts together even within
a single output increment as passed to
`comint-output-filter-functions'.

Example in GHC comint buffer:

GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> ghci> :{
main :: IO ()
main = putStrLn "Hello World!"
:}

main
"org-babel-haskell-eoe"
ghci| ghci| ghci| ghci> ghci> Hello World!
ghci> "org-babel-haskell-eoe"
ghci>
2023-04-02 12:15: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
Jack Kamm e46811c5e1 ob-python: Allow working with externally started sessions again
* lisp/ob-python.el (python-shell-buffer-name): Remove unneeded
defvar.
(org-babel-python-initiate-session-by-key): Check if session already
existed before run-python.  Only wait for initialization if it's a
newly started session.  Also simplify the code a bit by combining
multiple setq and let statements into a single let statement.  Also
add a comment about why adding to `python-shell-first-prompt-hook'
after `run-python' should be safe from race conditions.
2023-03-31 09:11:42 -07: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 f53205a443
org-export-data: Clarify that filters are not applied
* lisp/ox.el (org-export-data): Clarify the docstring.
2023-03-29 16:34:11 +02:00
Ihor Radchenko c1bb68ab9d
ox: Make export errors more prominent
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-latex.el (org-latex-generate-engraved-preamble):
(org-latex-inline-src-block):
(org-latex-src-block):
(org-latex-src--engrave-code):
* lisp/ox-odt.el:
(org-odt--table):
(org-odt--translate-latex-fragments):
(org-odt--export-wrap): Use `warn' instead of `message' when external
dependency/tool is missing/fails.
2023-03-29 16:30:41 +02:00
Ihor Radchenko e9110a8dd7
Prefer `string-search' when matching exact strings
* lisp/ob-core.el (org-babel-inline-result-wrap):
(org-babel-demarcate-block):
* lisp/org-agenda.el (org-agenda-get-represented-categories):
* lisp/org-persist.el (org-persist--read-elisp-file):
* lisp/ox-beamer.el (org-beamer--format-frame):
* lisp/ox-latex.el (org-latex--environment-type):
(org-latex--inline-image): Use a simple and faster `string-search'
when searching for non-regexps.
2023-03-29 15:54:24 +02:00
Ihor Radchenko 88f7bea169
org-babel-temp-stable-file: Avoid `sxhash' collisions
* lisp/org-macs.el (org-sxhash-safe): New function to calculate object
hashes.  Unlike `sxhash', the new function ensures that
if (= (org-sxhash-safe A) (org-sxhash-safe b)) then (equal A B)
Not just the opposite.
* lisp/ob-core.el (org-babel-temp-stable-file): Use the new function.

Reported-by: Thomas Worthington <thomas.worthington@cosector.com>
Link: https://orgmode.org/list/877cwrcdh2.fsf@localhost
2023-03-29 15:10:19 +02:00
Ihor Radchenko 05ae268973
org-fold-show-children: Only display direct children by default
* lisp/org-fold.el (org-fold-show-children): Clarify the docstring
emphasizing that direct children are always displayed.  Fix
grandchildren being displayed when the first child has deeper level
than the next children.
2023-03-29 14:58:28 +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
Ihor Radchenko 44e1cbb094
org-compile-file: Fix when `org-batch-test' is not defined
* lisp/org-macs.el (org-compile-file): Avoid error when
`org-batch-test' is not defined.
2023-03-24 14:59:36 +01:00
Ihor Radchenko 866ed1a3c5
org-babel-comint-with-output: Fix edge case for partial prompts
* lisp/ob-comint.el (org-babel-comint-with-output): Do not try to
filter out prompts in `comint-output-filter-functions'.  The prompts
may arrive there arbitrarily - multiple prompts together, partial
prompts, full prompts, etc.  For example "ghci> " prompt may arrive as
"gh" + "ci> " with second part still matching `comint-prompt-regexp'.
As a result, if we keep using `comint-output-filter-functions', the
split prompts may sometimes retain their initial part, littering the
results.  Now, we postpone filtering to after receiving the output,
still making sure that agglomerated prompts gets filtered using a
custom regexp derived from `comint-prompt-regexp'.
2023-03-24 11:15:58 +01:00
Ihor Radchenko a8a516ba33
org-babel-comint-with-output: Handle agglomerated prompts better
* lisp/ob-comint.el (org-babel-comint-with-output): Consider that
comint can sometimes agglomerate multiple prompts together even within
a single output increment as passed to
`comint-output-filter-functions'.

Example in GHC comint buffer:

GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> ghci> :{
main :: IO ()
main = putStrLn "Hello World!"
:}

main
"org-babel-haskell-eoe"
ghci| ghci| ghci| ghci> ghci> Hello World!
ghci> "org-babel-haskell-eoe"
ghci>
2023-03-24 10:46:05 +01:00
Ihor Radchenko 03d15dd724
org-logind-dbus-session-path: Fix CI tests failure
* lisp/org-clock.el (org-logind-dbus-session-path): Do not try to use
dbus when `dbus-call-method' errs.

`dbus-call-method' may throw
Debugger entered--Lisp error: (dbus-error "org.freedesktop.login1.NoSessionForPID" "PID 7361 does not belong to any known session")
Do not try to use dbus method in such scenario.

Link: https://builds.sr.ht/~bzg/job/961763
2023-03-23 13:47:38 +01:00
Daniel Kraus 880782660a
ob-clojure.el: Reword docstring for ob-clojure-eval-with-cider
* lisp/ob-clojure.el (ob-clojure-eval-with-cider): Mention in the
docstring that the Babel params argument is not used anymore.
2023-03-23 13:25:15 +01: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
Nathaniel Nicandro 693df6fd90
lisp/org-clock.el: Add support for logind
* lisp/org-timer.el (org-logind-dbus-session-path): New variable.
(org-logind-user-idle-seconds): New function.
(org-user-idle-seconds): Use them.
* etc/ORG-NEWS (Add support for ~logind~ idle time in
~org-user-idle-seconds~): Document the new feature.
2023-03-23 12:43:30 +01:00
Matthew Trzcinski f7aa8c19f5 ob-shell.el: Add async evaluation
* ob-shell.el (org-babel-sh-evaluate): Add condition for async within
session.  Allow :async header argument to be either t or blank.

* test-ob-shell.el:
(test-ob-shell/session-async-valid-header-arg-values): Check that
:async header works for both t and blank values.
(test-ob-shell/session-async-inserts-uuid-before-results-are-returned):
Check that UUID is used as placeholder until results return.
(test-ob-shell/session-async-evaluation): Check that asynchronously
evaluated results are eventually placed in the buffer.

Link: https://list.orgmode.org/186283d230a.129f5feb61660123.3289004102603503414@excalamus.com/
2023-03-22 14:55:11 -04:00
Matthew Trzcinski 180c1c37a9 ob-comint.el: Fix off-by-one error in async result
* ob-comint.el (org-babel-comint-async-filter): Fix region returned
after async calculation completes so that the trailing prompt ends in
a space.

Link: https://list.orgmode.org/18705dca9b8.f4f7e70c165671.6021704484862511260@excalamus.com/
2023-03-22 14:25:51 -04:00
Matthew Trzcinski cb95d88936 ob-R.el/ob-python: Update md5' calls to org-id-uuid'
* ob-R.el (ob-session-async-org-babel-R-evaluate-session): Use
`org-id-uuid' instead of `md5' as results placeholder.

* ob-python.el (org-babel-python-async-evaluate-session): Use
`org-id-uuid' instead of `md5' as results placeholder.
2023-03-22 14:20:47 -04: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 20b33106cd
org-element-headline-parser: Fix empty headings with tags
* lisp/org-element.el (org-element-headline-parser): Allow empty title
with tags.  Do not consider space after COMMENT to be a part of title.
*
testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
Add tests.

Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/87zg8t4zgo.fsf@localhost
2023-03-22 16:08:32 +01:00
Ihor Radchenko 93bf820384
org-element-headline-parser: Treat "* TODO" as empty title + TODO keyword
* lisp/org-element.el (org-element-headline-parser): Allow end of line
instead of space after todo keyword.
*
testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
Add new test.
2023-03-22 15:52:24 +01:00
Daniel Kraus cd2355a204
ob-clojure.el: Fix compiler warning
* lisp/ob-clojure.el (ob-clojure-eval-with-cider): Silence compiler
warning about unused argument 'params'.
2023-03-19 21:39:07 +01:00
Ihor Radchenko a645a6d679
Merge branch 'bugfix' 2023-03-19 14:06:34 +01:00
Ihor Radchenko 4c01eba265
org-texinfo-supports-math-p: Fix CI test failures
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Consider
compilation error as indication that math is not supported.  texinfo
compiler throws "unknown command `displaymath'" error in such case,
causing `org-texinfo-compile' to err as well.

Fixes CI tests failures when testing with Texinfo versions with no
math support.

https://builds.sr.ht/~bzg/job/959487
2023-03-19 13:58:07 +01:00
Ihor Radchenko 533a83a989
org-compile-file: Expose logs when running Org tests
* lisp/org-macs.el (org-compile-file): Output logs on failure when
running Org test suite.  This is useful to expose more information in
CI tests.
2023-03-19 11:10:04 +01:00
Ihor Radchenko 6bf8e44d3f
Merge branch 'bugfix' 2023-03-18 13:03:31 +01:00
Ihor Radchenko 92471e5303
org-agenda-run-series: Fix `org-agenda-list' call
* lisp/org-agenda.el (org-agenda-run-series): Fix arguments in the
call.  "agenda*" should include appointments and thus HOURS argument
should be non-nil.  See `org-agenda' for analogous call.
2023-03-18 13:01:58 +01:00
Ihor Radchenko 3b9ffc6868
org-latex-export-to-latex: Use nil arg for `write-region'
* lisp/ox.el: Use BEG=nil instead of explicit arguments to
`write-region'.  This simplifies the code.
2023-03-18 12:33:15 +01:00
Ihor Radchenko 4cad6c8eaf
* lisp/Makefile: Remove references to org-contrib
Since org-contrib is now a separate package, the parts of Makefile
that are referring to it are no longer needed.
2023-03-16 13:34:34 +01:00
Daniel Kraus 6efb073463
ob-clojure.el: Fix results output, support clojure-cli
* lisp/ob-clojure.el (org-babel-clojure-backend): Add support for
clojure-cli.
* lisp/ob-clojure.el (org-babel-clojurescript-backend): Move nbb to
clojurescript.
* lisp/ob-clojure.el (org-babel-expand-body:clojure)
* lisp/ob-clojure.el (ob-clojure-eval-with-cider): Return only the
last expression when :results is not set or value, and return only
stdout when :results is set to output.
* lisp/ob-clojure.el (ob-clojure-eval-with-cmd): Rename function as
it is not only for babashka.
* lisp/ob-clojure.el (org-babel-execute:clojure): Differentiate
between Clojure and ClojureScript source blocks.

The problem was that the ob-clojure results where not correctly
taking the results parameter into account.
E.g. with the cider backend, you would get all printed or returned
values for each line in your block:

(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)

| #'user/small-map |
| {:some :map}     |
| 4                |

or for babashka you would only get the printed values but not the
last return value:
(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)

: :xx

Now when you specify :results value, the result is only the last
returned value, and with :results output you get all values
printed to stdout.
So the examples above would all result in the same:
(def small-map {:a 2 :b 4 :c 8})
{:some :map}
(prn :xx)
(:b small-map)

: 4
2023-03-16 11:25:41 +01: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 0e7b5626ef
Merge branch 'bugfix' 2023-03-14 14:51:57 +01:00
Ihor Radchenko 6fc420167c
org-persist: Fix file path calculation
* lisp/org-persist.el (org-persist-read:file):
(org-persist-read:url): Use `org-file-name-concat' instead of simple
`concat'.
2023-03-14 14:45:00 +01:00
Ihor Radchenko d2e8a118f6
Merge branch 'bugfix' 2023-03-14 13:21:28 +01:00
Pedro Andres Aranda Gutierrez 3eb51d8dbc
* lisp/ox-latex.el (org-latex-generate-engraved-preamble): Fix typo 2023-03-14 13:20:29 +01:00
Ihor Radchenko 3d04af3826
org-latex-paragraph: Ensure that paragraphs are not split by empty lines
* lisp/ox-latex.el (org-latex-paragraph): If export creates single
paragraph contents with empty lines, remove the empty lines to ensure
that we retain a single paragraph.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tufdb6$11h2$1@ciao.gmane.io
2023-03-14 13:11:37 +01:00
Ihor Radchenko 5f817f21fc
Merge branch 'bugfix' 2023-03-12 12:25:39 +01:00