1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-10-18 02:19:46 +00:00
Commit Graph

27733 Commits

Author SHA1 Message Date
Ihor Radchenko
ea8ed59c02
etc/ORG-NEWS (Org mode now fontifies...): Add references to manual
* etc/ORG-NEWS (Org mode now fontifies whole table lines (including
newline) according to ~org-table~ face): Add references to the manual
that explain how to set face 'inherit attribute.

Link: https://orgmode.org/list/87le4dfowy.fsf@yandex.com
2024-05-17 14:04:00 +03:00
Max Nikulin
b4d17c0629
ORG-NEWS: Reword inline image width note
* etc/ORG-NEWS: Avoid possible confusion related to
"#+attr_org: :width" example.
2024-05-13 15:40:02 +03:00
Ihor Radchenko
f326cd58ba
org-display-inline-image--width: Fix unparable non #+ATTR_ORG widths
* lisp/org.el (org-display-inline-image--width): When there are
multiple #+ATTR_BACKEND :width attributes, skip over all the
attributes that cannot be parser to a number.  This way

 #+attr_html: :alt Image width test
 #+attr_beamer: :width \linewidth
 #+attr_latex: :width +.5\textwidth
 #+attr_md: :width 75%
 [[file:~/Downloads/wallpaper.png]]

will get +.5 relative width even though #+attr_beamer does specify
some :width value (not a number).

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/875xvoshex.fsf@localhost
2024-05-13 15:36:13 +03:00
Ihor Radchenko
aa71facf6d
Respect `org-auto-align-tags' in all the editing commands
* lisp/org-mobile.el (org-mobile-edit):
* lisp/org.el (org-insert-heading):
(org-edit-headline):
(org-priority):
(org-set-tags):
(org-entry-put):
(org-self-insert-command):
(org-delete-backward-char):
(org-delete-char):
(org-kill-line): Only re-align tags when `org-auto-align-tags' is set
to non-nil.
* etc/ORG-NEWS (~org-auto-align-tags~ is now respected universally):
Announce the breaking change.

Link: https://orgmode.org/list/87msxoc3qp.fsf@localhost
2024-05-13 15:10:35 +03:00
Ihor Radchenko
62356cb44b
lisp/org.el (org-block-map): Fix mapping over nested blocks
* lisp/org.el (org-block-map): Do not bypass the whole block when
mapping.  Look inside the block body for child blocks as well.

Reported-by: mahmood sheikh <mahmod.m2015@gmail.com>
Link: https://orgmode.org/list/CAOj1L_cx9XP5fS3_=x=UJSSt3xjcfcQ68Uef6E4DTi68Kr_ABw@mail.gmail.com
2024-05-13 14:59:45 +03:00
Ihor Radchenko
fffb87174e
testing/lisp/test-ox-md.el (ox-md/headline-style): New test 2024-05-12 14:53:39 +03:00
Lee Thompson
1a7d7a5a5b
lisp/ox-md.el: New mixed-style option for `org-md-headline-style'
* lisp/ox-md.el (org-md-headline-style): New setting `mixed' allows
for mixing Setext and ATX-style headlines when exporting to Markdown.
* doc/org-manual.org (Header and sectioning structure): Document
`mixed' headline style.
* etc/ORG-NEWS (New allowed value of ~org-md-headline-style~ to mix
ATX and Setext style headlines): Document the new feature.

When exporting to Markdown, there was previously no obvious way of
mixing Setext-style and ATX-style headlines.  Via the
`org-md-headline-style' custom setting, headlines could be exported as
either all-Setext or all-ATX, but not as a mix.

With this change setting `org-md-headline-style' to `'mixed' will
export the first two headline levels as Setext-style Markdown
headlines and the rest as ATX-style.

TINYCHANGE
2024-05-12 14:53:34 +03:00
Ihor Radchenko
bc51dfcb74
org-agenda-kill: Fix deleting wrong entry when Org buffer is narrowed
* lisp/org-agenda.el (org-agenda-kill): Use `org-with-point-at' to
jump to origin Org buffer from agenda.  It automatically widens the
buffer.
(org-remove-subtree-entries-from-agenda): Temporarily lift narrowing
when calculating the list of headings to clean up from the agenda.

Link: https://old.reddit.com/r/emacs/comments/1cog1fb/agenda_kills_wrong_item_in_orgmode_when_buffer_is/
2024-05-11 19:32:50 +03:00
Ihor Radchenko
db5478108c
org-agenda-tree-to-indirect-buffer: Obey `org-indirect-buffer-display'
* lisp/org-macs.el (org-display-buffer-in-window): New helper function
to display buffer in specific window (when it is live).
* lisp/org.el (org-tree-to-indirect-buffer): By default, reuse the
window previously used for an existing indirect buffer, if it is in
the same frame.
* lisp/org-agenda.el (org-agenda-do-tree-to-indirect-buffer): Remove.
(org-agenda-tree-to-indirect-buffer): Merge with
`org-agenda-do-tree-to-indirect-buffer' and remove special handling of
the existing indirect buffer window that overrides
`org-indirect-buffer-display'.
(org-agenda-do-context-action): Force `org-indirect-buffer-display' to
be 'other-window when displaying subtree at point in
org-agenda-follow-mode.

This patch reverts 35d6d9f50, implementing an alternative fix for
stabilizing indirect buffer window selection.  Unlike the existing
fix, it utilizes display buffer action and does not cause clashes with
custom `org-indirect-buffer-display'.

Reported-by: JV <misc@jeffvalk.com>
Link: https://orgmode.org/list/1a4c7a04-8536-40c7-899e-ba433a1252fd@jeffvalk.com
2024-05-11 16:19:52 +03:00
Ihor Radchenko
e36a4fe20e
org-html-final-function: Suppress mode hooks when indenting
* lisp/ox-html.el (org-html-final-function): When setting indentation,
use defaults, suppressing major mode hook.  If we do not, all kinds of
user code may be executed.

This fix will only work starting from Emacs 30, after bug#70671 is
fixed:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70671

Reported-by: arozbiz@gmail.com
Link: https://orgmode.org/list/87tu21hsuk.fsf@localhost
2024-05-11 13:02:10 +03:00
Ihor Radchenko
4131926984
org: New Org-wide custom option `org-sort-function'
* lisp/org-macs.el (org-sort-function): New customization defining how
Org mode should sort headlines, table lines, agenda lines, etc.
(org-string<):
(org-string<=):
(org-string>=):
(org-string>): Use the new customization.
(org-string<>): Add docstring.
(org-sort-function-fallback): New helper function to help users on
MacOS where `string-collate-lessp' is not reliable.
* lisp/oc-basic.el (org-cite-basic--field-less-p):
* lisp/org-agenda.el (org-cmp-category):
(org-cmp-alpha):
* lisp/org-list.el (org-sort-list):
* lisp/org-mouse.el (org-mouse-list-options-menu):
* lisp/org-table.el (org-table-sort-lines):
* lisp/org.el (org-tags-sort-function):
(org-sort-entries):
* lisp/ox-publish.el (org-publish-sitemap): Honor the new
customization.
* lisp/org-mouse.el (org-mouse-tag-menu):
(org-mouse-popup-global-menu):
* lisp/org-agenda.el (org-cmp-tag): Honor `org-tags-sort-function' and
falling back to `org-string<' if note set.
* etc/ORG-NEWS (New option controlling how Org mode sorts things
~org-sort-function~): Announce the change.

This change aims to standardize the way Org mode performs sorting of
user data.  In particular, it addresses issues with oddities of string
collation rules on MacOS and tricky language environments like
Turkish.

Link: https://orgmode.org/list/87jzleptcs.fsf@localhost
2024-05-11 12:34:30 +03:00
Ihor Radchenko
4deb06ea0a
org-manual: Clarify what :results drawer does for inline code blocks
* doc/org-manual.org (Format): Move :results raw description up.
Adapt :results drawer description from the docstring of
`org-babel-insert-result', mentioning what it means in inline src
blocks.

Link: https://orgmode.org/list/87v8dfnwcp.fsf@localhost
2024-05-11 10:43:38 +03:00
Ihor Radchenko
f64c8a5a5b
org-insert-heading: Prevent 0-blanks after heading when there is blank before
* lisp/org.el (org-insert-heading): When creating a new heading with
blank lines before results in the _next_ heading to have no blank
lines, add them.

Reported-by: gusbrs <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/877cjl67z6.fsf@localhost
2024-05-10 12:15:40 +03:00
Ihor Radchenko
071c6e986c
Update version number for the 9.6.30 release 2024-05-10 10:30:48 +03:00
Ihor Radchenko
3bf33c0d7b
org-clock-get-table-data: Fix error when :match uses LEVEL
* lisp/org-clock.el (org-clock-get-table-data): Pass headline level to
the clock table matcher.

Link: https://orgmode.org/list/8acdd46f-4137-4957-bb52-827d817eb5e7@uberco.de
2024-05-09 14:33:24 +03:00
Ihor Radchenko
e380684c1a
doc/org-manual.org (The clock table): Fix too wide table in Texinfo output
* doc/org-manual.org (The clock table):
(Footnotes): Use numbered footnote to avoid too wide table columns.

Reported-by: Morgan Smith <Morgan.J.Smith@outlook.com>
Link: https://orgmode.org/list/CH3PR84MB34245E5ED43AA9A59D38E732C5E52@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM
2024-05-09 14:07:52 +03:00
Ihor Radchenko
31748e67f0
doc/org-manual.org (Summary of the export process): Fix inaccuracies
* doc/org-manual.org (Summary of the export process): Mention that
some export backends may retain table rows with alignment markers.
Clarify that exporting parent nodes with children uses exported child
text.
2024-05-09 13:55:40 +03:00
Ihor Radchenko
c6849a2bc8
org-store-link-functions: Fix the docstring
* lisp/ol.el (org-store-link-functions): Describe the actual sequence
of calling store functions.
2024-05-09 13:41:58 +03:00
Ihor Radchenko
96b3129265
org-create-file-search-functions: Allow to provide link description
* lisp/ol.el (org-create-file-search-functions): Fix the docstring,
replacing old broken way to set link description with
`org-link-store-props'.
(org-store-link): Allow the new behavior; get rid of redundant CPLTXT
internal variable - every time it is used, LINK is also set to it.

Reported-by: Magnus Therning <magnus@therning.org>
Link: https://orgmode.org/list/87wn9pppkl.fsf@localhost
2024-05-09 13:34:58 +03:00
Ihor Radchenko
bd5665e017
org-table-make-reference: Address compiler warning
* lisp/org-table.el (org-table-make-reference): Drop branch of `if'
unused during runtime.  This preserves _interactive_ behavior.
* testing/lisp/test-org-table.el (test-org-table/org-table-make-reference/mode-string-none):
(test-org-table/org-table-make-reference/mode-string-N): Fix tests to
check for the existing _interactive_ behavior.  When running make
test (eq "" "") happens to return t and tests were passing previously
by accident despite actual behavior during user session being
different. Fix the tests to avoid breaking changes in the user
experience.

Link: https://list.orgmode.org/orgmode/20230827214320.46754-1-salutis@me.com/
2024-05-09 11:55:29 +03:00
Ihor Radchenko
24c4a40f79
org-fold-core-region: Fix isearch when fold style is overlays
* lisp/org-fold-core.el (org-fold-core--isearch-show): Only delete
overlay, when overlay is supplied.
(org-fold-core-region): Do not use custom "open temporarily" function
for overlay style.

Reported-by: Paul Stansell <paulstansell@gmail.com>
Link: https://orgmode.org/list/CAMJKaZy2Mt1_NeoP3nG3Uv68372H3rHHU1fcmSgO4xLpRQZi5Q@mail.gmail.com
2024-05-09 11:34:23 +03:00
Ihor Radchenko
773bba92a8
doc/org-manual.org: Improve example of publishing configuration
* doc/org-manual.org (Example: complex publishing configuration): Show
how to use evaluated expression with backquotes and `rx' macro in the
example.

Link: https://orgmode.org/list/LV8P223MB0920398F1619C446752BB1E1A2E42@LV8P223MB0920.NAMP223.PROD.OUTLOOK.COM
2024-05-07 12:21:46 +03:00
Max Nikulin
51aff8a11b
test-org-macro.el: Add test for CVE-2024-30202
* testing/lisp/test-org-macro.el (test-org-macro/initialize-templates):
A new test that no code is evaluated when an Org file is opened
(CVE-2024-30202).

Ihor Radchenko [ANN] Emergency bugfix release: Org mode 9.6.23.
Sun, 24 Mar 2024 17:16:50 +0000.
<https://list.orgmode.org/871q7zbldp.fsf@localhost>
2024-05-06 15:55:00 +03:00
Ihor Radchenko
48169da265
lisp/org.el (org-make-tags-matcher): Suppress compiler warning 2024-05-06 12:57:45 +03:00
Ihor Radchenko
c8bd2092b1
org-agenda-mode: Honor hidden link descriptions
* lisp/org-agenda.el (org-agenda-mode): Hide 'org-link invisibility
spec, as in Org mode.

Reported-by: Bastien <bzg@gnu.org>
Link: https://orgmode.org/list/87seyww65g.fsf@gnu.org
2024-05-05 20:27:13 +03:00
Ihor Radchenko
56992b221e
Merge branch 'bugfix' 2024-05-05 20:26:17 +03:00
Ihor Radchenko
24feef95e4
ox-md: Fix exporting numbered items >=100
* lisp/ox-md.el (org-md-item): Always put at least one space after
item number.
* testing/lisp/test-ox-md.el (ox-md/item): New test.

Reported-by: Bastien <bzg@gnu.org>
Link: https://orgmode.org/list/87wmo8qll7.fsf@gnu.org
2024-05-05 20:25:22 +03:00
Andras Simonyi
288e0a11c2 oc-csl: Remove spaces before citations in superscript
* lisp/oc-csl.el (org-cite-csl--create-structure): Remove spaces before citation
if it is in superscript.
(org-cite-csl--style-cite-superscript-p): New function to check whether the used
CSL style produces citations in superscript.
2024-05-05 15:58:01 +02:00
Ihor Radchenko
43ba00b2b1
ob-latex: New custom option `org-babel-latex-process-alist'
* lisp/ob-latex.el (org-babel-latex-process-alist): New variable.
(org-babel-execute:latex): Override `org-preview-latex-process-alist'
when generating png output, making sure that the process yields an
actual png image, even when `org-preview-latex-default-process' is
non-default.
* etc/ORG-NEWS (=ob-latex= now uses a new option
~org-babel-latex-process-alist~ to generate png output): Announce the
change.

Reported-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://orgmode.org/list/87cyretut7.fsf@localhost
2024-05-05 13:39:43 +03:00
Ihor Radchenko
e09ad15a71
org-babel-read: Avoid `save-match-data'
* lisp/ob-core.el (org-babel-read): Avoid fiddling with match data -
it is not used.
2024-05-04 22:20:09 +03:00
Ihor Radchenko
0227e12605
org-babel-read: Read quotes strings ignoring leading/trailing newlines
* lisp/ob-core.el (org-babel-read): When reading "string", ignore
leading/trailing newlines in addition to spaces.
* testing/lisp/test-ob.el (test-ob/org-babel-read): Add more tests.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/v15lva$hhl$1@ciao.gmane.io
2024-05-04 22:19:45 +03:00
Ihor Radchenko
105dedd0d9
ox-html: Fix exporting inlinetasks without contents
* lisp/ox-html.el (org-html-format-inlinetask-default-function): Do
not export no-contents as string "nil".  Just use empty string.
2024-05-04 15:26:10 +03:00
Ihor Radchenko
edb5eaaac3
org-babel-read: Allow reading multi-line strings
* lisp/ob-core.el (org-babel-read): Fix regexp for detecting
string-like CELLs.  Avoid calling `read' twice.  Recover gracefully if
`read' errs.
* testing/lisp/test-ob.el (test-ob/org-babel-read): Add more tests.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/v155g2$ncm$1@ciao.gmane.io
2024-05-04 14:46:46 +03:00
Ihor Radchenko
1523e21d82
org-babel-expand-noweb-references: Add trialing newline after comments
* lisp/ob-core.el (org-babel-expand-noweb-references): After closing
comment, when using :comments noweb, leave trailing newline after the
closing comment.
* testing/lisp/test-ob-tangle.el (ob-tangle/comment-noweb-relative):
Modify test to check for the newline.

Reported-by: João Pedro <jpedrodeamorim@gmail.com>
Link: https://orgmode.org/list/87fruy2rw6.fsf@ergo
2024-05-04 14:30:25 +03:00
Ihor Radchenko
0d24857ccf
ox-html: Fix exporting inlinetasks without contents
* lisp/ox-html.el (org-html-format-inlinetask-default-function): Do
not export no-contents as string "nil".  Just use empty string.
2024-05-04 13:37:46 +03:00
Ihor Radchenko
dbea900d60
test-ob/org-babel-read: Fix for Emacs 27
* testing/lisp/test-ob.el (test-ob/org-babel-read): Do not use `dlet'
that is not yet available in Emacs 27.
2024-05-03 16:25:00 +03:00
Cook, Malcolm
09520a056c
org-manual: Document command line installation
* doc/org-manual.org (Using Emacs packaging system): Document how to
upgrade Org mode without risking version conflicts.

TINYCHANGE
2024-05-03 15:23:06 +03:00
Ihor Radchenko
2028bb15cd
org-babel-read: Fix reading multiple quoted strings
* lisp/ob-core.el (org-babel-read): Fix naive regexp for matching
escaped quotes.  Instead, check if `read' can read the whole CELL in
one go.
* testing/lisp/test-ob.el (test-ob/org-babel-read): Add tests.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/v10k4s$et9$1@ciao.gmane.io
2024-05-03 15:04:52 +03:00
Ihor Radchenko
5da0eb6ea7
org-element-timestamp-parser: Allow time in diary sexp timestamps
* lisp/org-agenda.el (org-agenda-get-timestamps):
* lisp/org-element.el (org-element--timestamp-regexp): Adjust
timestamp regexp.
(org-element-timestamp-parser): Support the new syntax for diary sexp
timestamps.  The diary sexp is now stored in :diary-sexp property and
the time/time range is stored as usual.
(org-element-timestamp-interpreter): Interpret diary timestamp
according to its building blocks rather than raw value.
* testing/lisp/test-org-agenda.el (test-org-agenda/diary-timestamp):
New test checking for agenda support of times in diary timestamps.
*
testing/lisp/test-org-element.el (test-org-element/timestamp-interpreter):
Add parser tests.
* doc/org-manual.org (Timestamps): Add an example of the new syntax to
the manual.
* etc/ORG-NEWS (Diary type timestamps now support optional
time/timerange): Document the Org syntax addition.

This syntax modification is fixing an omission in org-element.el.  In
the past, org-agenda had explicit support for diary timestamps with
time/timerange, but that support was ad-hoc.  Now, after org-agenda
switched to use parser, we must modify Org syntax to fix the feature
regression.
2024-05-03 13:42:06 +03:00
Ihor Radchenko
3d0deadf41
Update version number for the 9.6.29 release 2024-05-03 10:32:09 +03:00
Ihor Radchenko
1cafe3e8e4
org-indent-line: Do not err in src blocks when there is no language mode
* lisp/org.el (org-indent-line): When attempting to indent as in major
mode, ignore any errors, like errors arising when the major mode is
not available.
2024-05-02 19:47:26 +03:00
Rudolf Adamkovič
7cdf835c71
Auto-complete PRINT_BIBLIOGRAPHY with a trailing colon
* lisp/org.el (org-options-keywords): Add a trailing colon to the
'PRINT_BIBLIOGRAPHY' keyword to avoid unnecessary user confusion.
2024-05-02 19:31:54 +03:00
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
Ihor Radchenko
55795376b6
org-indent-line: Do not rely upon TAB being bound to indentation
* lisp/org.el (org-indent-line): When indenting natively in src
blocks, call `indent-line-function' instead of relying upon "TAB"
binding doing indentation.
2024-05-02 18:18:49 +03:00
Ihor Radchenko
d8ac958836
ob-calc/matrix-inversion: Force `calc-float-format' in the test
* testing/lisp/test-ob-calc.el (ob-calc/matrix-inversion): When
testing, make sure that calc output follows the expected format.
This is needed on MacOS where Emacs defaults are not exactly the same.

Reported-by: Alexander Adolf <alexander.adolf@condition-alpha.com>
Link: https://list.orgmode.org/orgmode/91dfeb0fed1a1fe0564e5eb9b95a409d@condition-alpha.com/
2024-05-02 15:58:19 +03:00
Max Nikulin
ac7c5c5d88
test-ob-shell.el: Skip based on feature detection
* testing/lisp/test-ob-shell.el (test-ob-shell/bash-uses-assoc-arrays)
(test-ob-shell/bash-uses-assoc-arrays-with-lists): Use feature detection
shell command instead of version comparison to skip tests for
associative arrays.

It affects macOS since Apple ships BASH 3.2 licensed as GPLv2.
2024-05-02 15:56:16 +03:00
Ihor Radchenko
dd12e9c763
ob-calc.el: Fix assigning floating point numbers
* lisp/ob-calc.el (org-babel-execute:calc): Use internal calc format
when assigning variable values that are numbers.
* testing/lisp/test-ob-calc.el (ob-calc/float-var): New test.

Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://orgmode.org/list/87edbu4kdh.fsf@gmail.com
2024-05-02 15:24:15 +03:00
Ihor Radchenko
a2e5685e49
Do not use org-fold to hide link parts
* lisp/ol.el (org-link--link-folding-spec):
(org-link--description-folding-spec):
(org-link-descriptive-ensure): Remove.
(org-toggle-link-display): Rely upon font-lock to update link display.
* lisp/org-agenda.el (org-agenda-mode): Remove no-longer-necessary
org-fold initializer.
* lisp/org-fold.el (org-fold-initialize): Remove link-related fold
types.
(org-fold-show-set-visibility):
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org.el (org-do-emphasis-faces):
(org-unfontify-region): Remove special handling of link folds.
* lisp/org.el (org-mode): Remove folding setup for links.
(org-activate-links--text-properties): Remove.
(org-activate-links): Honor `org-link-descriptive' dynamically.

This change reflects de-facto situation where we cannot use folding
system to hide links reliably.  Even though we promise in Org 9.6 that
hidden parts of the link can be searched, the way it can be
implemented is not reliable and is working around upstream mechanisms.
Upstream changes are necessary to properly support isearch in text
hidden using text properties; workarounds attempted in org-fold-core
do not cut it because too many built-in Emacs libraries and also
third-party libraries rely upon internal implementation details of
isearch (due to limitations of its API).
2024-05-02 12:29:27 +03:00
Morgan Smith
646f6ec133
Obsolete org-cached-entry-get' in favor of org-entry-get'
We have a better performing cache mechanism in `org-entry-get'.

* lisp/org.el (org-make-tags-matcher): Replace uses of
`org-cached-entry-get' with `org-entry-get'.
(org-cached-entry-get): Move to ...
* lisp/org-compat.el (org-cached-entry-get): ... here.  Obsolete in
favor of `org-entry-get'.
2024-05-01 21:41:07 +03:00
Max Nikulin
c6bbde4c78
test-org-ctags: Fix CI failures
* testing/lisp/test-org-ctags.el (test-org-ctags/with-fake-ctags): Do
not use function name not compatible with dash.
2024-04-30 16:41:01 +03:00