Commit Graph

887 Commits

Author SHA1 Message Date
Ihor Radchenko fede1c9909
org-display-inline-images: Prioritize #+attr_org over other #+attr_...
* lisp/org.el (org-display-inline-image--width): When there is
 #+attr_org defining :width, use it.  Fall back to #+attr_<other>
otherwise.  Update the docstring.
(org-image-actual-width): Improve docstring (credit: Matt Huszagh).
* etc/ORG-NEWS (Inline image width value in =#+attr_org= is preferred
over other =#+attr_...= keywords): Document the change.

Co-authored-by: Matt Huszagh <huszaghmatt@gmail.com>
Link: https://orgmode.org/list/871r2ucuhz.fsf@gmail.com
2024-05-02 19:26:48 +03:00
Max Nikulin badb09d679
org-ctags.el: Do not activate on load
* etc/ORG-NEWS: Announce the change breaking for `org-ctags' users and
provide init file code to enable the feature.
* lisp/org-ctags.el (org-ctags-enable): Do no invoke this function
during library loading.  Collect all initialization code in its body.

Setting up hooks during library loading leads to various issues.
- Emacs coding conventions insist on incompatible changes if loading
  a library modifies behavior, see
  Info node `(elisp) Coding Conventions'.
- The library may be autoloaded for the sake of help completion
  breaking `org-open-at-point':
  Nick Dokos. org-ctags land grab. Mon, 20 Mar 2023 23:36:09 -0400.
  <https://list.orgmode.org/87o7omg4ie.fsf@alphaville.usersys.redhat.com>
- Unrelated unit tests fail due to user prompt:
  Ihor Radchenko. Re: [PATCH] org-ctags.el: Protect shell specials
  in directory name. Sun, 28 Apr 2024 12:53:38 +0000.
  <https://list.orgmode.org/87a5ldk5rh.fsf@localhost>
2024-04-30 12:49:52 +03:00
Ihor Radchenko 065af4b42a
ox-html: Use non-number footnote names as link anchors
* lisp/ox-html.el (org-html-footnote-section):
* lisp/ox-html.el (org-html-footnote-reference): When footnote has a
non-number name, build link anchors using this name.
* etc/ORG-NEWS (=ox-html=: When exporting footnotes with custom
non-number names, the names are used as link anchors): Announce the
change.

Link: https://orgmode.org/list/875xwngiwx.fsf@protesilaos.com

Co-authored-by: Protesilaos Stavrou <info@protesilaos.com>
2024-04-28 13:18:59 +03:00
Alexander Adolf 4e6fa96e26
lisp/org-colview.el: Add link parameter to colview dynamic block
* lisp/org-colview.el (org-columns--capture-view): Add new link
parameter, which when non-nil causes ITEM headlines to be linked to
their origins.
(org-dblock-write:columnview): Pass new link parameter to
`org-columns--capture-view', and explain its use in the docstring.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
new test for link feature.
* doc/org-manual.org (Capturing column view): Describe new :link
parameter.
* etc/ORG-NEWS (=colview= dynamic block can link to headlines):
Describe new link feature.
2024-04-26 15:44:46 +03:00
Alexander Adolf 5a98b4c563
lisp/org-colview.el: Add formatter parameter to colview dynamic block
* lisp/org-colview.el (org-dblock-write:column view): Factor out the
existing formatting code to new function
`org-columns-dblock-write-default', and honour new dblock parameter
:formatter for specifying a different formatting function.
(org-columns-dblock-write-default): New function with current
formatting code.
(org-columns--capture-view): Amend docstring to better explain the
format of the data being passed to the formatting function.
(org-clock-clocktable-formatter): New option to define a global
default formatting function, defaulting to the current behaviour.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): New test
for formatting function.
(test-org-colview/dblock-formatter): New function used in formatting
test.
* doc/org-manual.org (Capturing column view): Describe new :formatter
parameter.
* etc/ORG-NEWS (New option ~org-columns-dblock-formatter~): Announce
new option.
(=colview= dynamic block supports custom formatting function):
Describe new custom formatting function feature.
2024-04-26 15:44:44 +03:00
Pedro A. Aranda f124b616d9
oc-biblatex: Allow native biblatex options in CITE_EXPORT
* lisp/oc-biblatex.el: (org-cite-biblatex--package-options) Add support
for options in the native biblatex package format.
* doc/org-manual.org: Document the added format and add an example.
* etc/ORG-NEWS: Announce new format for #+cite_export biblatex options.
2024-04-26 15:23:29 +03:00
Rudolf Adamkovič 252cc0be07
ob-lua: Support all types and multiple values in results
* etc/ORG-NEWS
(New and changed options): Describe the new option
'org-babel-lua-multiple-values-separator'.
(New features): Describe the main change, as per the title of this
commit message.
* lisp/ob-lua.el
(org-babel-lua-multiple-values-separator): Enable the user to
customize the string that separates the individual values in
multi-valued returns.
(org-babel-lua-wrapper-method): Support all Lua types and multi-valued
returns.  Further, do not pretty-print tables with one or more
extraneous newline characters.
(org-babel-lua-pp-wrapper-method): Remove in favor of the new, more
general 'org-babel-lua-wrapper-method'.
(org-babel-lua-evaluate-external-process): Adapt for the new
'org-babel-lua-wrapper-method'.
* testing/lisp/test-ob-lua.el
(test-ob-lua/colnames-yes-header-argument-pp):
(test-ob-lua/colnames-nil-header-argument):
(test-ob-lua/colnames-no-header-argument): Stop expecting extraneous
newlines, now that the pretty printer does not output them.
(test-ob-lua/types): Test nil, boolean, number, string, and table
results.
(test-ob-lua/multiple-values): Test multi-valued results.
2024-04-24 16:04:38 +03:00
Ihor Radchenko c6c5474b7e
ob-exp: Preserve header arguments in source block after processing
* lisp/ob-exp.el (org-babel-exp-process-buffer): Fix infinite loop
when the inline src block replacement is the same as the existing src
block.
(org-babel-exp-code): Support new placeholder %header-args for
non-default header arguments.
(org-babel-exp-inline-code-template):
(org-babel-exp-code-template): Change the templates to include header
arguments.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-export/export-with-results-before-block): Adjust tests.
* etc/ORG-NEWS (=ox-org= preserves header non-default arguments in src
blocks): Document the breaking change.

This change fixes ox-org export for src blocks.  Previously src blocks
did not preserve their header arguments.  Now, non-default header
arguments are preserved.

Link: https://github.com/emacsorphanage/ox-pandoc/issues/37
2024-04-24 14:48:19 +03:00
Alexander Gogl 46e13c3ebd
ox-latex: New option to customize LaTeX footnote command
* lisp/ox-latex.el (org-export-define-backend): Add option.
(org-latex-default-footnote-command): New custom variable.
(org-latex-footnote-reference): Replace string "\\footnote{%s%s}"
with custom variable.

* etc/ORG-NEWS (New and changed options): Add description to option.

Some LaTeX classes define their own footnote commands. For example,
kaobook (https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf)
has \footnotes and \sidenotes, whereby sidenotes (notes are put into
the outter margin) are the dominant form of putting notes in
kaobook. It would be great if you could make the footnote command in
the footnote function customizable. My proposal is in the attachment.

Modified from a feature request by Alexander Gogl.

Link: https://list.orgmode.org/m2v84fhj9u.fsf@gmail.com/T/#m71809443a3b328ed704712ba53e6bb78282249cc

TINYCHANGE
2024-04-23 13:58:14 +03:00
Ihor Radchenko 5b0b7f2924
org-paste-subtree: With single/double prefix, force inserting sibling/child
* lisp/org.el (org-paste-subtree): When called with single or double
universal argument, force inserting sibling heading or child heading
accordingly.
* testing/lisp/test-org.el (test-org/paste-subtree): Add tests for the
new behavior.
* doc/org-manual.org (Structure Editing): Update the command description.
* etc/ORG-NEWS (~org-paste-subtree~ now handles =C-u= and =C-u C-u=
prefix arguments specially): Announce the change.

Link: https://orgmode.org/list/878rhxtszb.fsf@localhost
2024-04-21 14:59:37 +03:00
Morgan Smith 66e307b411
lisp/org-element.el: Add repeater-deadline support to org-element
* lisp/org-element.el (org-element-timestamp-parser,
org-element-timestamp-interpreter): Add support for repeater
deadlines.  Adds two new properties: ':repeater-deadline-value' and
':repeater-deadline-unit'.

* testing/lisp/test-org-element.el (test-org-element/timestamp-parser,
test-org-element/timestamp-interpreter): Test support for repeater
deadlines.

* etc/ORG-NEWS: Add relevant news.
2024-04-11 16:17:40 +03:00
Sławomir Grochowski cc3a13c1fe
lisp/org-colview.el: Add defcustom `org-columns-checkbox-allowed-values'
* lisp/org-colview.el Add defcustom
`org-columns-checkbox-allowed-values'.
(org-columns-next-allowed-value): Introduce variable
`org-columns-checkbox-allowed-values'.

This would allow to use more than two states ("[ ]", "[X]") in columns
with SUMMARY-TYPE that use checkbox ("X", "X/", "X%").  For example
you can add an intermediate state ("[-]").  Or empty state ("") to
remove checkbox.

* etc/ORG-NEWS: New option ~org-columns-checkbox-states~.
2024-04-06 15:54:35 +03:00
Ihor Radchenko b2827aed98
org-dblock-write:columnview: Write width specifications
* lisp/org-colview.el (org-dblock-write:columnview): When writing
table, write width specifications as well and apply them.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
test.
* etc/ORG-NEWS (=colview= dynamic block now writes column width
specifications): Document the change.

Link: https://orgmode.org/list/87r1015w30.fsf@localhost
2024-04-05 14:14:04 +03:00
Ihor Radchenko f6876d73b3
etc/ORG-NEWS: Fix typos
* etc/ORG-NEWS (=.avif= images are now recognized in ~org-html-inline-image-rules~):
(Blank lines after removed objects are now retained during export):
"are not" -> "are now".
2024-04-03 15:01:14 +03:00
Ihor Radchenko ce5e8ecbb8
Prioritize underline over subscript inside parenthesis
* lisp/org-element.el (org-element--object-lex): Prioritise underline
parser over subscript.  `org-element-underline-parser' is more strict
compared to `org-element-subscript-parser'.
* testing/lisp/test-org-element.el (test-org-element/underline-parser):
Add test.
* etc/ORG-NEWS (Underline syntax now takes priority over subscript
when both are applicable): Announce the breaking change.

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
Link: https://list.orgmode.org/87v8z52eom.fsf@posteo.net/T/#t
2024-04-01 15:32:14 +03:00
Ihor Radchenko a698d073a1
org-latex-to-mathml/html-convert-command: Prevent shell expansion
* lisp/org.el (org-create-math-formula):
(org-format-latex-as-html): Shell-quote LaTeX fragment text when
replacing %i placeholder.  This prevents shell expansion of
$... and similar constructs inside the code.
(org-latex-to-mathml-convert-command):
(org-latex-to-html-convert-command): Update the docstring.
* etc/ORG-NEWS (~org-latex-to-mathml-convert-command~ and
~org-latex-to-html-convert-command~ shell-escape LaTeX code): Announce
the breaking change.
* doc/org-manual.org (LaTeX math snippets): Update example.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/735645dd-1ddf-4579-a6dd-2700f3e83c94@gmail.com
2024-04-01 14:13:15 +03:00
Ihor Radchenko d3878cb6fe
Consistently combine markup and the containing element faces during fontification
* lisp/org-src.el (org-fontify-inline-src-blocks-1):
* lisp/org.el (org-fontify-macros):
* lisp/org.el (org-activate-footnote-links):
(org-set-font-lock-defaults):  Prepend faces during
activation instead of overriding.  Add a comment explaining the
general rule how we combine faces.
* etc/ORG-NEWS (Org mode faces are now consistently combined, with
markup faces taking precedence over the containing element faces):
Document the breaking change.

Reported-by: StrawberryTea <look@strawberrytea.xyz>
Link: https://orgmode.org/list/875xy21e49.fsf@localhost
2024-03-31 14:41:07 +03:00
Ross Timson 1be2f96931
lisp/ox-html.el: Add avif support for html export inline images
* lisp/ox-html.el (org-html-inline-image-rules): Add AVIF image
support for inline images on HTML export.

AVIF is well supported by browsers these days and offers similar
features and much better compression than the other image formats
commonly used for the web.

TINYCHANGE
2024-03-27 15:11:40 +03:00
Visuwesh 89b0773c3f
ob-calc.el: Add support for tables in Calc source block :var
A table with MxN dimensions is converted to a MxN matrix when given in
:var to a Calc source block.  A table with a single row is converted
to a vector (i.e., row vector).

* lisp/ob-calc.el (org-babel-execute-src-block:calc): Construct the
right data structure to pass tables as matrices to Calc.
* testing/lisp/test-ob-calc.el: Add tests for ob-calc, and this new
feature.
* etc/ORG-NEWS: Announce the feature.
* mk/default.mk (BTEST_OB_LANGUAGES): Enable ob-calc tests by default.
2024-03-16 15:15:40 +03:00
Ihor Radchenko a862ef6906
etc/ORG-NEWS: Fix typo 2024-03-16 14:31:14 +03:00
Ihor Radchenko 72b0e9ff04
org-export: Do not strip link type by default during export
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link--inline-image):
* lisp/ox-texinfo.el (org-texinfo-link): Preserve link type during
export for all the links, not just for a hard-coded subset.
* etc/ORG-NEWS (Built-in HTML, LaTeX, Man, Markdown, ODT, and Texinfo
exporters preserve the link protocol during export): Document the
breaking change.

Link: https://list.orgmode.org/orgmode/878r9nofpw.fsf@localhost/
2024-03-12 13:57:47 +03:00
Stefan Monnier b0c3c90574
ox-texinfo:: Always provide a @direntry
Until now @dircategory/@direntry entries were added only if
both TEXINFO_DIR_CATEGORY and TEXINFO_DIR_TITLE were set.
And the setting of TEXINFO_DIR_TITLE had to be careful to
provide exactly the right syntax.

This patch changes various things in this regard:
- Always generate a @dircategory/@direntry.
- Default TEXINFO_DIR_CATEGORY to "Misc".
- Use the document title by default if TEXINFO_DIR_DESC is missing.
- Rename TEXINFO_DIR_TITLE to TEXINFO_DIR_NAME.
- Use the filename by default when TEXINFO_DIR_NAME is missing.
- Try and make it harder to provide a direntry that does not
  have the right format or refers to a different filename than
  the one we're outputting to.

* lisp/ox-texinfo.el (texinfo): Add entry for TEXINFO_DIR_NAME.
(org-texinfo-template): Use sane defaults for `@direntry` and `@dircategory`.

* doc/org-manual.org (Texinfo specific export settings): Adjust accordingly.
(Info directory file, A Texinfo example, Export Setup): Update examples
to use the new syntax.
* etc/ORG-NEWS (Version 9.7 / New features): Add entry.
2024-03-08 13:45:26 +03:00
Olivier Lischer dd4d05a159
ob-tangle: Add flag to optionally remove files before writing
* lisp/ob-tangle.el: Add new custom option
`org-babel-tangle-remove-file-before-write'.
(org-babel-tangle): Remove file before writing according to the value
of `org-babel-tangle-remove-file-before-write'.

The variable `org-babel-tangle-remove-file-before-write' adds support
for the current and old behaviour of `org-babel-tangle'.

Link: https://list.orgmode.org/orgmode/877cjzhjtg.fsf@liolin.ch/
Co-authored-by: Ihor Radchenko <yantar92@posteo.net>

TINYCHANGE
2024-02-29 13:41:34 +03:00
Thierry Banel 407a55c1c0
org-table.el: Enhanced table parsing
* lisp/org-table.el (org-table-to-lisp): Refactored.
* etc/ORG-NEWS: Document changes.

`org-table-to-lisp' is significantly faster.
It no longer uses regexps, nor clobbers the global regexp state.
2024-02-25 14:30:38 +03:00
Martin Kampas 37e468cf16
org-bibtex-yank: Allow to populate existing item
Align with `org-bibtex-create'.

* lisp/ol-bibtex.el (org-bibtex-write):
* lisp/ol-bibtex.el (org-bibtex-yank): New optional argument
UPDATE-HEADING to update heading at point instead of creating a new
heading.
(org-bibtex-create): Rename NONEW argument to UPDATE-HEADING.
* etc/ORG-NEWS (~org-bibtex-yank~ accepts a prefix argument):
(New optional argument =UPDATE-HEADING= for ~org-bibtex-yank~):
Announce the change.

Link: https://list.orgmode.org/orgmode/4868155.GXAFRqVoOG@gt1/
2024-02-25 11:50:38 +03:00
Rick Lupton 95554543b9
org-id.el: Add search strings, inherit parent IDs
* lisp/ol.el (org-store-link): Refactor org-id links to use standard
`org-store-link-functions'.
(org-link-search): Create new headings at appropriate level.
(org-link-precise-link-target): New function extracting logic to
identify a precise link target, e.g. a heading, named object, or text
search.
(org-link-try-link-store-functions): Extract logic to call external
link store functions. Pass them a new `interactive?' argument.
* lisp/ol-bbdb.el (org-bbdb-store-link):
* lisp/ol-bibtex.el (org-bibtex-store-link):
* lisp/ol-docview.el (org-docview-store-link):
* lisp/ol-eshell.el (org-eshell-store-link):
* lisp/ol-eww.el (org-eww-store-link):
* lisp/ol-gnus.el (org-gnus-store-link):
* lisp/ol-info.el (org-info-store-link):
* lisp/ol-irc.el (org-irc-store-link):
* lisp/ol-man.el (org-man-store-link):
* lisp/ol-mhe.el (org-mhe-store-link):
* lisp/ol-rmail.el (org-rmail-store-link): Accept optional arg.
* lisp/org-id.el (org-id-link-consider-parent-id): New option to allow
a parent heading with an id to be considered as a link target.
(org-id-link-use-context): New option to add context to org-id links.
(org-id-get): Add optional `inherit' argument which considers parents'
IDs if the current entry does not have one.
(org-id-store-link): Consider IDs of parent headings as link targets
when current heading has no ID and `org-id-link-consider-parent-id' is
set.  Add a search string to the link when enabled.
(org-id-store-link-maybe): Function set as :store option for custom id
link property. Move logic from `org-store-link' here to determine when
an org-id link should be stored using `org-id-store-link'.
(org-id-open): Recognise search strings after "::" in org-id links.
* lisp/org-lint.el: Add checker for "::" in ID properties.
* testing/lisp/test-ol.el: Add tests for
`org-link-precise-link-target' and `org-id-store-link' functions,
testing new options.
* doc/org-manual.org: Update documentation about links.
* etc/ORG-NEWS: Document changes and new options.

These feature allows for more precise links when using org-id to link to
org headings, without requiring every single headline to have an id.

Link: https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com/
2024-02-24 15:56:44 +03:00
Rick Lupton 6e7e0b2cd3
lisp/org.el (org-insert-heading): Allow specifying heading level
* lisp/org.el (org-insert-heading): Change optional argument TOP to
LEVEL, accepting a number to force a specific heading level.
* testing/lisp/test-org.el (test-org/insert-heading): Add tests.
* etc/ORG-NEWS: Document changes.
2024-02-24 15:56:43 +03:00
Leo Butler b3b35b03ff
lisp/ox-beamer.el: customize the beamer frame environment name
* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable.  It contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer-template): Insert the `org-beamer-frame-environment'
environment definition into the beamer document.

* lisp/org-lint.el (org-lint-beamer-frame): Check the body of each
frame for an occurrence of \begin{orgframe} or \end{orgframe}, or
whatever environment name is in `org-beamer-frame-environment' [4].
The warning includes advice to see `org-beamer-frame-environment'.

* etc/ORG-NEWS (New option ~org-beamer-frame-environment~): Announce
the new option.

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
[4] https://list.orgmode.org/orgmode/87il38i5tb.fsf@localhost/T/
2024-02-21 13:46:32 +03:00
Ihor Radchenko 388ba5b5c4
org-insert-link: Do not expand path arg when `org-link-file-path-type' is a function
* lisp/ol.el (org-insert-link): Drop `expand-file-name'.
(org-link-file-path-type): Update docstring.
* etc/ORG-NEWS (When ~org-link-file-path-type~ is a function, its
argument is now a filename as it  in the link; not an absolute
path): Announce the change.

Link: https://orgmode.org/list/871qahl0un.fsf@localhost
2024-02-17 16:25:19 +01:00
Ihor Radchenko b8ee1315a1
ox-org: Do not process citations by default
* lisp/ox.el (org-export-options-alist): Add new export option
:with-cite-processors that allows disabling citation processors.
(org-export-process-citations): New customization (t by default)
defining the default value of :with-cite-processors export option.
(org-export-as):
(org-export--annotate-info): Disable citation processors when
:with-cite-processors is nil.
* lisp/ox-org.el (org-org-with-cite-processors): New custom
option (nil by default) controlling whether to use citation processors
when exporting to Org.
(org): Set :with-cite-processors according to the new option.  Declare
transcoders for citation and citation-reference objects.
* doc/org-manual.org (Summary of the export process): Update the
export flow description.
* etc/ORG-NEWS (Org export backends can now disable citation processors):
(=ox-org= disables citation processors by default):
(New option ~org-export-process-citations~):
(New option ~org-org-with-cite-processors~): Document the changes.

The change in ox-org behavior also fixes citation objects being
removed unconditionally from table src block results.

Reported-by: Stanislav Vlasov <S.Vlasov@tilburguniversity.edu>
Link: https://orgmode.org/list/87edrin6jw.fsf@localhost
2024-02-14 13:16:57 +01:00
Ihor Radchenko 6ff0de5c3e
ox-org: Export special table rows by default
* lisp/ox.el (org-export-options-alist): New internal plist option -
:with-special-rows.  Defaults to nil.
(org-export--skip-p): Do not skip special table rows when
:with-special-rows is non-nil.
* lisp/ox-org.el (org-org-with-special-rows): New custom option
controlling whether to export special table rows.  t by default.
(org): Use `org-org-with-special-rows' as the value of
:with-special-rows option.
* etc/ORG-NEWS (=ox-org= now exports special table rows by default):
(New option ~org-org-with-special-rows~): Announce the change.
2024-02-12 12:55:37 +01:00
Ihor Radchenko 8c7313d397
org-babel: New babel backend API function org-babel-session-buffer:<lang>
* lisp/ob-core.el (org-babel-session-buffer): New API function that
return session buffer, if such buffer exists and is live.
(org-babel-execute-src-block): Use `org-babel-session-buffer'.
* lisp/ob-lua.el (org-babel-session-buffer:lua):
* lisp/ob-python.el (org-babel-session-buffer:python): Provide API to
retrieve session buffer name.
(org-babel-python-initiate-session-by-key): Use
`org-babel-session-buffer:python'.
* etc/ORG-NEWS (Org babel backends are now expected to define an
additional API function ~org-babel-session-buffer:<lang>~): Declare
the API addition.

Link: https://orgmode.org/list/87r0hr9f3b.fsf@localhost
2024-02-10 21:57:52 +01:00
Ihor Radchenko cbfe1354b3
org-insert-subheading: Never insert sub-heading above current
* lisp/org.el (org-insert-subheading): When at bol, do not insert
heading above (default behavior of `org-insert-heading').  Instead,
force `org-insert-heading' to insert below.  Improve docstring,
explaining how the prefix arguments are used and the new different
with `org-insert-heading'.
* etc/ORG-NEWS (~org-insert-subheading~ no longer inserts a
sub-heading above current when point is at the beginning of line):
Document the breaking change.

Reported-by: Michael Dauer <mick.dauer@gmail.com>
Link: https://list.orgmode.org/CAP7OBx+whiB8Jo_hEcfL6MajDU1EH=E5j0ZOvHB3dPRK+Aj4mQ@mail.gmail.com/
2024-02-10 16:57:59 +01:00
Ihor Radchenko 27d6f8305c
lisp/ob-comint.el: Introduce a fallback prompt regexp
* lisp/ob-comint.el (org-babel-comint-prompt-regexp-old): New variable
storing the default value of `comint-prompt-regexp' to be used when
the prompt set by Org mode changes for some reason.
(org-babel-comint-fallback-regexp-threshold): New customization to set
the time Org babel waits for comint command to finish until trying
fallback prompt regexp.
(org-babel-comint--set-fallback-prompt): New internal function that
sets the fallback prompt regexp, if there is any available.
(org-babel-comint-with-output):
(org-babel-comint-wait-for-output): Try fallback prompt regexp when we
cannot find comint command end for too long.
* lisp/ob-haskell.el (org-babel-interpret-haskell):
* lisp/ob-ruby.el (org-babel-ruby-initiate-session):
* lisp/ob-shell.el (org-babel-sh-initiate-session):
* lisp/ob-clojure.el (ob-clojure-eval-with-inf-clojure): Set
`org-babel-comint-prompt-regexp-old' when initializing the inferior
shell.
* etc/ORG-NEWS (New option
~org-babel-comint-fallback-regexp-threshold~): Document the new
customization.

Reported-by: Jack Kamm <jackkamm@tatersworld.org>
Link: https://orgmode.org/list/87sf2q9ubd.fsf@gmail.com
2024-02-09 17:35:58 +01:00
Ihor Radchenko b26745b985
org-agenda: Fix meaning of 'repeated-after-deadline value of `org-agenda-skip-scheduled-if-deadline-is-shown'
* lisp/org-agenda.el (org-agenda-skip-scheduled-if-deadline-is-shown):
Move 'repeated-after-deadline value into a new custom option.
(org-agenda-skip-scheduled-repeats-after-deadline): Create a new
custom option to make agenda hide scheduled entries repeated past
deadline.
* lisp/org-agenda.el (org-agenda-get-scheduled): Use the new custom
option.  Do not demand deadline to be actually shown when deciding
whether to skip scheduled repeats past deadline.  This fixes a bug
when repeats continue to be displayed if past deadline is not
displayed within agenda span.
* doc/org-manual.org (Repeated tasks): Adjust manual entry, mentioning
the new custom option.
* etc/ORG-NEWS (~repeated-after-deadline~ value of
~org-agenda-skip-scheduled-repeats-after-deadline~ is moved to a new
customization): Announce the change.
*
testing/lisp/test-org-agenda.el (test-org-agenda/skip-scheduled-repeats-after-deadline):
Add new test.

Reported-by: Morgan Smith <Morgan.J.Smith@outlook.com>
Link: https://orgmode.org/list/874jft6vpj.fsf@localhost
2024-02-07 13:21:34 +01:00
Pedro A. Aranda Gutiérrez 10d2868c58
org-footnote-new: Add an option to create new anonymous labels
* lisp/org-footnote.el (org-footnote-new, org-footnote-auto-label):
Add symbol `anonymous' to `org-footnote-auto-label'.  With this,
anonymous footnotes will be created.  This is sometimes useful in long
texts.  Mimics \footnote{} in LaTeX.  Modify `org-footnote-new' to
generate anonymous footnotes directly.

* lisp/org.el (org-startup-options): Add `fnanon' to startup options.

* testing/lisp/test-org-footnote.el (test-org-footnote/new-anon): Add
a test for creation of anonymous footnotes.

* etc/ORG-NEWS:
(~org-footnote-new~ can be configured to create anonymous footnotes):
Announce new anonymous footnote support.

* doc/org-manual.org (Summary of In-Buffer Settings): Document
"fnanon" startup option.
2024-02-05 15:38:48 +01:00
Ihor Radchenko 14acf626fe
org: Fontify whole table rows with `org-table-row' face
* lisp/org-faces.el (org-table-row): New face.
* lisp/org.el (org-set-font-lock-defaults): Use ~org-table-row~ face
to fontify the whole table rows, including indentation and newlines.
* etc/ORG-NEWS (Org mode now fontifies whole table lines (including
newline) according to ~org-table~ face): Announce the change.
2024-02-01 15:30:18 +01:00
Ihor Radchenko 03b383df8b
ox-latex: Remove org-latex-line-break-safe
This reverts commit 3f60acff77 and
subsequent relevant comments.

* lisp/ox-latex.el (org-latex-line-break-safe): Remove constant.  The
\\[0pt] is actually not safe to use in some scenarios. We use a
different approach to avoid plain text [...] being interpreted as
LaTeX optional argument - we escape [ like {[}; that's what pandoc
does.
(org-latex-clock):
(org-latex-line-break):
(org-latex-plain-text):
(org-latex-planning):
(org-latex--org-table):
(org-latex--math-table):
(org-latex-table-row):
(org-latex-verse-block):
* testing/lisp/test-org-table.el (test-org-table/to-latex):
* testing/lisp/test-ox-latex.el (test-ox-latex/verse):
(test-ox-latex/longtable): Remove references to
`org-latex-line-break-safe'.
* etc/ORG-NEWS (=ox-latex=: ~org-latex-line-break-safe~ is removed):
Announce removal.
* lisp/org-compat.el (org-latex-line-break-safe): Make obsolete.

Link: https://orgmode.org/list/878r4jg37s.fsf@posteo.net
2024-01-31 12:35:29 +01:00
Andrew Hyatt f490c1548a
org-agenda: New customization `org-agenda-start-with-archives-mode'
* lisp/org-agenda.el: Add `org-agenda-start-with-archives-mode'.
(org-agenda-mode): Set value of `org-agenda-archive-mode' according to
value of new variable `org-agenda-start-with-archives-mode'.

* doc/org-manual.org: Note new variable in the documentation of
`org-agenda-archives-mode'.

* etc/ORG-NEWS: Note change to add
`org-agenda-start-with-archives-mode'.
2024-01-29 17:56:42 +01:00
Ihor Radchenko 107cbc74a9
ob-python: Set Python shell in Org edit buffer
* lisp/ob-python.el (org-babel-python-associate-session): New function
setting `python-shell-buffer-name' in *Org Src* buffer according to
source block's :session parameter.  This function will be triggered by
`org-src-associate-babel-session'.
* etc/ORG-NEWS (ob-python now sets ~python-shell-buffer-name~ in Org
edit buffers): Announce the change.

Co-authored-by: Liu Hui <liuhui1610@gmail.com>

Link: https://orgmode.org/list/CAOQTW-MdC=jiGf+3bEVtfww+izSZix7csBJ+mZ4eZ2BQHDR42w@mail.gmail.com
2024-01-29 14:29:45 +01:00
Detlef Steuer da2b61b09e lisp/ox-icalendar.el: Add time-to-live functionality to ox-icalendar
This commit adds functionality for ox-icalendar to set X-PUBLISHED-TTL
in the exported ICS, which advises a subscriber to the exported ICS
file to reload after the given time interval.

* lisp/ox-icalendar.el (org-icalendar-ttl): New option to set
X-PUBLISHED-TTL in exported ICS
(icalendar): Add ICAL-TTL export keyword
(org-icalendar--vcalendar): Add argument for TTL
(org-icalendar-template, org-icalendar-export-current-agenda,
org-icalendar--combine-files): Pass TTL to `org-icalendar--vcalendar'

Co-authored-by: Ihor Radchenko <yantar92@posteo.net>
Co-authored-by: Jack Kamm <jackkamm@gmail.com>
2024-01-28 13:45:41 -08:00
Ihor Radchenko 319563cef7
ob-R, ob-julia: Do not force-start session in Org Src buffers
* lisp/ob-R.el (org-babel-R-associate-session): Set
`ess-gen-proc-buffer-name-function' to associate the right session
buffer if user requests session interaction from inside Org Src edit
buffer.
(org-babel-edit-prep:R): Remove in favor of
`org-babel-R-associate-session'.
* lisp/ob-julia.el (org-babel-julia-associate-session): Implement
analogous functionality.
(org-babel-edit-prep:julia): Remove in favor of
`org-babel-julia-associate-session'.
* etc/ORG-NEWS (~org-edit-special~ no longer force-starts session in R
and Julia source blocks): Document the change.
* lisp/org-src.el (org-src-associate-babel-session): Run
org-babel-<lang>-associate-session even when session is not yet
initiated.

Link: https://orgmode.org/list/87r0ir2ln8.fsf@gmail.com
2024-01-28 20:04:31 +01:00
Ihor Radchenko ef23b4706b
org-babel-tangle: Do not allow tangling into self
* lisp/ob-tangle.el (org-babel-tangle): Throw an error when trying to
tangle into the org file we tangle from.
* etc/ORG-NEWS (It is no longer allowed to tangle into the same file
as Org source): Document the breaking change.
* testing/lisp/test-ob-tangle.el (ob-tangle/tangle-to-self): New test.
2024-01-26 16:54:04 +01:00
Ihor Radchenko 8ec89c53ca
ox-icalendar: Add support for multi-line SUMMARY, LOCATION, and DESCRIPTION
* lisp/ox-icalendar.el (org-icalendar-entry): Use `org-entry-get' to
account for both PROP and PROP+ in SUMMARY, LOCATION, and DESCRIPTION
properties.  Use newline as accumulated value separator.
* etc/ORG-NEWS (iCalendar export now supports multiline =SUMMARY=,
=LOCATION=, and =DESCRIPTION= properties): Announce the breaking
change.
* doc/org-manual.org (iCalendar Export): Add an example in the manual.

Reported-by: Hanno Perrey <hanno@hoowl.se>
Link: https://orgmode.org/list/87o821dv7o.fsf@localhost
2024-01-25 14:20:22 +01:00
Ihor Radchenko 46b9769a02
org-attach-store-link-p: Change default value to 'attached
* lisp/org-attach.el (org-attach-store-link-p): Change the default
value.
* etc/ORG-NEWS (The default value of ~org-attach-store-link-p~ is now
~attached~): Announce the change.
2024-01-25 13:59:58 +01:00
Ihor Radchenko 78dc58508d
Obsolete org-switch-to-buffer-other-window and org-no-popups
* lisp/org-compat.el (org-switch-to-buffer-other-window):
(org-no-popups): Move from org-macs.el and mark obsolete.
* lisp/ob-lilypond.el (org-babel-lilypond-execute-tangled-ly):
(org-babel-lilypond-mark-error-line):
* lisp/ol.el (org-insert-link):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
(org-agenda-prepare-window):
(org-agenda-goto):
(org-agenda-open-link):
(org-agenda-clock-goto):
(org-agenda-diary-entry-in-org-file):
(org-agenda-add-entry-to-org-agenda-diary-file):
(org-agenda-show-the-flagging-note):
* lisp/org-attach.el (org-attach):
* lisp/org-capture.el (org-capture-place-template):
(org-capture-fill-template):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-macs.el (org-mks):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org-table.el (org-table-edit-field):
(org-table-edit-formulas):
(org-table-show-reference):
* lisp/org.el (org-fast-todo-selection):
(org-add-log-note):
(org-fast-tag-selection):
* lisp/ox.el (org-export-stack-view):
(org-export--dispatch-ui): Use `switch-to-buffer-other-window'.
* etc/ORG-NEWS (Org mode no longer disallows configuring
~display-buffer-alist~ to open Org popups in other frame): Document
the breaking change.

Reported-by: Jan Seeger
Link: https://orgmode.org/list/87pmr3mfq3.fsf@localhost
2024-01-24 15:00:26 +01:00
Ihor Radchenko 2ade16bbc2
org-fold: Honor :extend face property in folded headings/blocks/drawers
* lisp/org-fold-core.el (org-fold-core-region): When folding, when the
fold ends at a newline, copy 'face property from the beginning of the
fold, so that the trailing newline after ellipsis does not appear
with different face.  This fixes :extend t in headlines, blocks, and
drawers not being honored when the headlines are folded.

* etc/ORG-NEWS (Folded lines can now extend their face beyond
ellipsis): Announce the change.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65896
2024-01-22 15:43:29 +01:00
Ihor Radchenko dd4fd02995
Allow per-buffer setting of org-link-descriptive via #+STARTUP options
* lisp/org.el (org-startup-options): Add new startup options to set
`org-link-descriptive'.
(org-mode): Move #+startup keyword parsing before setting up link
visibility.
* doc/org-manual.org (Link Format):
(Summary of In-Buffer Settings): Document the new startup option.
* etc/ORG-NEWS (~org-link-descriptive~ can now be set per-buffer via
=#+STARTUP= options): Announce the new feature.

Link: https://orgmode.org/list/87bkst1nfl.fsf@ucl.ac.uk
2024-01-22 13:58:30 +01:00
stardiviner dea7780d6d
org-fast-tag-selection: Limit the number of displayed tags
* lisp/org.el (org-fast-tag-selection): Do not print tags without
explicit bindings and tags outside groups when the number of displayed
tags exceeds new customization.
* lisp/org.el (org-fast-tag-selection-maximum-tags): Add new custom
option to set maximum tags number for fast tag selection.
(org--fast-tag-selection-keys): New internal variable holding keys
available for auto-assigning tag bindings.
* doc/org-manual.org (org-fast-tag-selection-maximum-tags): Add new
custom option documentation.
* etc/ORG-NEWS: Declare this new custom option.

Co-Authored-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://list.orgmode.org/orgmode/CAL1eYuK7GUx_=47e8+N5Jh+ZJnDexY+CDMUjPjJHNmcMiVVRrQ@mail.gmail.com/
2024-01-12 12:58:46 +01:00
Kyle Meyer 72a2db86d9 Merge branch 'bugfix' 2024-01-06 16:02:02 -05:00