1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00
Commit Graph

27928 Commits

Author SHA1 Message Date
Ihor Radchenko
8f40da6bf6
Merge branch 'bugfix' 2024-06-13 17:31:05 +02:00
Ihor Radchenko
96113f3b59
org-export--set-variables: Fix variable assignment
* lisp/ox.el (org-export--set-variables): Assume that variables are
listed as (var value) - as a list.  Only use the second element of the
list as the value, following example in `org-export-get-environment'.
(org-export-get-environment): Use `org-export--set-variables'.
* testing/lisp/test-ox.el (test-org-export/bind-keyword): Add new
test.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87cyonhuq3.fsf@gmail.com
2024-06-13 17:26:44 +02:00
Ihor Radchenko
a13d8fe83b
org-babel-exp-process-buffer: Fix edge case when src block ends at eob
* lisp/ob-exp.el (org-babel-exp-process-buffer): When src block ends
at eob, do not leave the #+end_src behind after replacement.
2024-06-13 17:26:02 +02:00
Ihor Radchenko
a2ae069869
ob-*: Do not emit redundant messages about code block evaluation
* lisp/ob-C.el (org-babel-C-header-to-C):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-prep-session:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-screen.el (org-babel-execute:screen):
* lisp/ob-sed.el (org-babel-execute:sed):
`org-babel-execute-src-block' already emits status messages about code
block evaluation.  Doing it from inside individual babel backends is
thus redundant.
2024-06-13 15:22:28 +02:00
Ihor Radchenko
14f176246f
Merge branch 'bugfix' 2024-06-13 15:19:58 +02:00
Ihor Radchenko
e4902995a0
org-babel: Reduce verbosity when running in batch mode
* lisp/ob-C.el (org-babel-C-header-to-C):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-core.el (org-babel-execute-src-block):
(org-babel-insert-result):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-prep-session:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-screen.el (org-babel-execute:screen):
* lisp/ob-sed.el (org-babel-execute:sed): Suppress progress messages
when running noninteractively (batch export, for example).  This
change follows the existing behavior of `org-babel-exp-src-block'.

Reported-by: Eli Zaretskii <eliz@gnu.org>
Link: https://yhetil.org/emacs-devel/868qzd9hjg.fsf@gnu.org/
2024-06-13 15:16:54 +02:00
Ihor Radchenko
959534ba11
ob-sql: Quote all the shell arguments originating from Org buffer
* lisp/ob-sql.el (org-babel-sql-dbstring-mysql):
(org-babel-sql-dbstring-postgresql):
(org-babel-sql-dbstring-oracle):
(org-babel-sql-dbstring-mssql):
(org-babel-sql-dbstring-sqsh):
(org-babel-sql-dbstring-vertica):
(org-babel-sql-dbstring-saphana):
(org-babel-execute:sql): Quote all the shell arguments to avoid
unexpect shell expansion.  Do not quote port as it is a number; make
sure that port is really demanded a number in the format strings.

Reported-by: Andrea <andrea-dev@hotmail.com>
Link: https://orgmode.org/list/DU2P193MB24225F623DBF8B3D254D3C0E88FA2@DU2P193MB2422.EURP193.PROD.OUTLOOK.COM
2024-06-12 15:40:31 +02:00
Ihor Radchenko
3232cc1619
Merge branch 'bugfix' 2024-06-12 15:33:01 +02:00
Ihor Radchenko
84945f9de0
orgtbl-gather-send-defs: Fix infinite loop when table is at bob
* lisp/org-table.el (orgtbl-gather-send-defs): Avoid infinite loop
when table is at the beginning of buffer.

Reported-by: Rustom Mody <rustompmody@gmail.com>
Link: https://orgmode.org/list/CAJ+Teoehk30LKVCTwMy0uREBHkNVBvrOLDZYboUQ4wBV6Fnwzw@mail.gmail.com
2024-06-12 15:31:45 +02:00
Ihor Radchenko
a0950e9432
org-babel-execute-src-block: Handle code block moving point
* lisp/ob-core.el (org-babel-execute-src-block): Make sure that point
remain on src block after evaluation.  The function logic later
implicitly assumes that the point is on the block that has been
evaluated.
2024-06-12 12:47:48 +02:00
Ihor Radchenko
e24c2408e7
Merge branch 'bugfix' 2024-06-11 12:46:49 +02:00
Ihor Radchenko
3e4c89e556
org-image--align: Fix image alignment when image is not inside paragraph
* lisp/org.el (org-image--align): Improve docstring.  Do not try to
align when image is not inside a paragraph.

Reported-by: Lin Sun <sunlin7.mail@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71484
2024-06-11 12:44:57 +02:00
Ihor Radchenko
331086ebec
org-capture-fill-template: Allow recursive capture while expanding template
* lisp/org-capture.el (org-capture-fill-template): Do not fix the
temporary *Capture* buffer name to be used for template expansion.
Instead, generate a throwaway buffer every time a new capture is
requested.  This way, we can nest multiple captures even when a new
capture is requested while querying a %^{prompt}.  Clear the buffer
upon completing/failing the template expansion.
(org-capture): Do not clear *Capture* buffer.
`org-capture-fill-template' not does it by itself.

Reported-by: Cletip Cletip <clement020302@gmail.com>
Link: https://orgmode.org/list/CAD6d+LUJ7St5_muvwqzE80EfHSoiMmZD+qDTAojeN0L7v+zsCQ@mail.gmail.com
2024-06-11 12:27:11 +02:00
Ihor Radchenko
ea4a690c1a
org--confirm-resource-safe: Throw an error when non-interactive
* lisp/org.el (org--confirm-resource-safe): When asking about resource
safety in non-interactive mode throw an error rather than silently not
downloading the resource.  The previous behavior may remote
 #+include's seemingly being ignored.
* etc/ORG-NEWS (Org mode may throw an error when attempting to include
remote unsafe resource): Announce the change.
2024-06-11 12:09:38 +02:00
Kyle Meyer
9419dad48a Merge branch 'km/from-emacs-master' into bugfix 2024-06-10 18:34:04 -04:00
Stefan Monnier
008e6030ac Backport commit d3524560e from Emacs
* lisp/ox.el (org-export-filters-alist): Don't define as constant.

d3524560ee3cb075125f0af158d4af01cb2ab546
Stefan Monnier
Mon Jun 10 10:58:46 2024 -0400
2024-06-10 18:30:27 -04:00
Mattias Engdegård
6eab01c580 Backport commit 331573e40 from Emacs
* lisp/org-element.el (org-element-copy-buffer):
Repair incorrect escaping.
* lisp/org-macs.el (org--line-empty-p): Fix broken skip-set.
* lisp/org.el (org-setup-yank-dnd-handlers): Fix broken regexp.

Org: fix mistakes in regexp, skip set and doc string
331573e40731d6635acd366694493c26b480c230
Mattias Engdegård
Mon Jun 10 14:07:07 2024 +0200
2024-06-10 18:29:36 -04:00
Kyle Meyer
ce350490ca ob-core: Fix indentation
* lisp/ob-core.el (org-babel-execute-src-block): Fix indentation of
line.

Emacs's bd80717d8e7 (Re-enable TTY glyph production for batch mode
frames on Android, 2024-06-10) reverted all changes from 8d1d9798f77
(Fix bootstrap of org.texi, 2024-06-10) aside from an indentation fix.
Apply the indentation fix to avoid overwriting it on sync.
2024-06-10 18:28:27 -04:00
Ihor Radchenko
9447518c75
Merge branch 'bugfix' 2024-06-10 11:16:18 +02:00
Ihor Radchenko
4d4d59874c
Fix indirect buffer tracking
* lisp/org-fold-core.el
(org-fold-core-decouple-indirect-buffer-folds): Actually, add newly
created indirect buffer to the tracked list.
2024-06-10 11:16:00 +02:00
Kyle Meyer
bb3800f904 Merge branch 'km/from-emacs-master' into bugfix 2024-06-09 20:52:14 -04:00
Stefan Kangas
2a6a0480d3 Backport commit 77d0eed74 from Emacs
; Fix typos
77d0eed74e1d934e28f364cb3adb06365e71335e
Stefan Kangas
Mon Jun 10 00:40:26 2024 +0200
2024-06-09 20:50:50 -04:00
Ihor Radchenko
dc2f270ac4
org-agenda: Fix multi-day ranges with non-nil `org-agenda-default-appointment-duration'
* lisp/org-agenda.el (org-agenda-get-blocks): Force
`org-agenda-default-appointment-duration' to be nil for time blocks -
they already have begin/end time, even if during different days.
* testing/examples/agenda-file2.org (five):
* testing/lisp/test-org-agenda.el (test-org-agenda/time-grid): New
test.

Reported-by: hrdl <git@hrdl.eu>
Link: https://orgmode.org/list/ZldNYYtvvQp0dILB@t490.localdomain
2024-06-09 14:25:58 +02:00
Ihor Radchenko
9427bdedcc
Merge branch 'bugfix' 2024-06-09 11:23:12 +02:00
Ihor Radchenko
0c06694666
etc/ORG-NEWS: Announce removal of searching inside hidden parts of links 2024-06-09 11:21:48 +02:00
Ihor Radchenko
1cea4094fc
Merge branch 'bugfix' 2024-06-08 21:08:01 +02:00
Ihor Radchenko
915e883645
org-lint-misplaced-heading: Reduce false-positive rate
* lisp/org-lint.el (org-lint-misplaced-heading): Be more strict
matching potential misplaced headings - only do it on another heading
and inside paragraphs.

Link: https://orgmode.org/list/87a5jv77qs.fsf@gmail.com
2024-06-08 21:02:40 +02:00
Ihor Radchenko
212237bdbd
Merge branch 'bugfix' 2024-06-07 16:54:13 +02:00
Ihor Radchenko
6c862699a6
org-lint: Fix heuristics introduced in 51aea4946
* lisp/org-lint.el (org-lint-misplaced-heading): Use parser to query
whether we are inside a verbatim block.  `org-at-block-p' only
triggers on the begin line of blocks.
2024-06-07 16:53:29 +02:00
Suhail
96eb9f0b4a
org-lint: Add function to remove checker(s)
* lisp/org-lint.el (org-lint-remove-checker): Remove one or more
checkers from `org-lint--checkers'.

TINYCHANGE
2024-06-06 17:30:53 +02:00
Ihor Radchenko
453cb0883a
Merge branch 'bugfix' 2024-06-06 17:23:11 +02:00
Ihor Radchenko
266bd1c4a0
org-capture-templates: New placeholder to refer to %^{prompt}X answers
* lisp/org-capture.el (org-capture-fill-template): Support new
placeholder %\*N to insert answers to all prompts - %^{prompt} and
%^{prompt}X.
(org-capture-templates):
* etc/ORG-NEWS (New =%\*N= placeholder in ~org-capture-templates~):
* doc/org-manual.org (Template expansion): Document the new
placeholder.

Link: https://orgmode.org/list/87le40puvb.fsf@gmail.com
2024-06-06 17:17:38 +02:00
Ihor Radchenko
2f184485bf
Update version number for the 9.7.3 release 2024-06-06 16:49:56 +02:00
Ihor Radchenko
5eb929a27c
lisp/ol.el (org-link--store-shortdoc): Fix typo 2024-06-06 14:50:30 +02:00
Ihor Radchenko
e6c5f25c13
org-babel-exp-code: Fix exporting src blocks with :var arguments
* lisp/ob-exp.el (org-babel-exp-code): Do not use resolved argument
values when formatting the code block.  Resolved argument values may
contain awkward data like full (long) table contents, various Elisp
data (including non-printable), etc.  Simply using verbatim src block
parameters as they appear in the original buffer is more reliable.
(org-babel-exp-inline-code-template):
(org-babel-exp-code-template): Update docstrings, drop %flags
placeholder, which is no longer supported using the current src block
syntax.
* etc/ORG-NEWS (=ox-org= preserves header arguments in src blocks):
Drop "non-default" when explaining how header arguments are formatted.
We cannot know which values are default and which not without
resolving the values - something we cannot do as it turned out.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-export/export-src-block-with-flags):
(ob-export/body-with-coderef): Update the tests.
2024-06-06 14:44:01 +02:00
bruno
55e8068d69
ol: Add support for shortdoc link type
* lisp/ol.el (org-link--open-shortdoc org-link--store-shortdoc)
(org-link--complete-shortdoc): Add support for storing and inserting links
to `shortdoc' documentation groups for Emacs Lisp functions.
* doc/org-manual.org (External Links): Add shortdoc link type
documentation.
* etc/ORG-NEWS (=ol.el=: Support for =shortdoc= link type): Document
the new feature.
2024-06-06 13:50:27 +02:00
Ihor Radchenko
bb633b6740
Merge branch 'bugfix' 2024-06-05 17:11:10 +02:00
Ihor Radchenko
51aea49462
org-lint: Improve heuristics for unknown src block language
* lisp/org-lint.el (org-lint-suspicious-language-in-src-block): Do not
complain about src block languages without execute function if there
is <lang>-mode major mode available.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/874ja7ik7h.fsf@gmail.com
2024-06-05 17:08:50 +02:00
Ihor Radchenko
d08a5abb90
Merge branch 'bugfix' 2024-06-05 16:54:29 +02:00
Ihor Radchenko
04d56f757f
mk/targets.mk (GITVERSION): Fix version string for ELPA build
* mk/targets.mk (GITVERSION): Use previous convention for the Org
version string on ELPA, where Org release tags are not available.
Instead of the new release_N/A-N/A prefix, use the Org version from
org.el file headers, as we did in Org 9.6.

Reported-by: Sharon Kimble <boudiccas@skimble09.plus.com>
Link: https://orgmode.org/list/87ikynyggt.fsf@skimble09.plus.com
2024-06-05 16:51:28 +02:00
Ihor Radchenko
e804de88e4
Merge branch 'bugfix' 2024-06-05 16:08:55 +02:00
Ihor Radchenko
223cc31ec7
org-log-beginning: Fix regression in c0b66bf
* lisp/org.el (org-log-beginning): Re-implement the bugfix attempted
in c0b66bf differently to avoid slurping blank lines when creating a
new logbook drawer.  Add more commentary to the function.

Reported-by: Christopher M. Miles <numbchild@gmail.com>

The reproducer:

* headline1
(point here)
* headline 2

(setq org-log-into-drawer t)

Press [C-c C-z] become bellowing content:

* headline1
:LOGBOOK:
- Note taken on [2024-06-05 Wed 12:49] \\
  kkk
:END:(point here)
* headline 2
2024-06-05 16:08:35 +02:00
Ihor Radchenko
589e1f38c1
Revert "org-log-beginning: Fix error creating LOGBOOK drawer at end of buffer"
This reverts commit c0b66bf9c1.

This itself caused a regression when inserting a new logbook drawer -
blank line is slurped.
2024-06-05 16:07:31 +02:00
Ihor Radchenko
9d70929fd7
Merge branch 'bugfix' 2024-06-05 15:14:03 +02:00
Ihor Radchenko
b8497aa7fe
org-lint: Do not warn about trailing *** lines inside blocks
* lisp/org-lint.el (org-lint-misplaced-heading): The chances that
there is a heading between #+begin... #+end lines is generally low.
So *** text instances are likely intended.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87r0dc35ya.fsf@gmail.com
2024-06-05 15:13:44 +02:00
Ihor Radchenko
466c180a47
Merge branch 'bugfix' 2024-06-05 14:37:09 +02:00
Ihor Radchenko
ac1d58477a
org-element-cache: Fix indirect buffer tracking
* lisp/org-element.el (org-element--cache-setup-change-functions):
Make sure that indirect buffers are registered to be traversed in
`org-fold-core-cycle-over-indirect-buffers' in
`org-element--cache-active-p'.
`org-fold-core-decouple-indirect-buffer-folds' may not be called in
some scenarios when Org mode is active.

The reproducer that revealed the problem is in
https://orgmode.org/list/CAD6d+LUJ7St5_muvwqzE80EfHSoiMmZD+qDTAojeN0L7v+zsCQ@mail.gmail.com
2024-06-05 14:34:46 +02:00
Ihor Radchenko
654a68dc51
org-agenda-format-item: Refactor, adding readable variable names
* lisp/org-agenda.el (org-agenda-format-item): Rename internal
variables to clarify their meaning.
2024-06-05 13:51:43 +02:00
Rens Oliemans
a62f75c841
org-capture: Allow table-line entry to start without |
* lisp/org-capture.el (org-capture-place-table-line): Prepend
table-line begin ('|') if the template does not start with it.

* testing/lisp/test-org-capture.el (test-org-capture/table-line):
Verify that a template gets prepended with a '|' if it does not start
with it.
2024-06-04 15:17:12 +02:00
Rens Oliemans
0c8fba93fe
org-capture: Allow entry template to start without heading
* lisp/org-capture.el (org-capture-place-entry): Prepend heading to
template if the template does not yet start with a heading.

* testing/lisp/test-org-capture.el (test-org-capture/entry): Add two
tests: no error is raised when org-capture is called with a template
that does not start with a heading; and org-capture should error with
a template with a lower heading after a higher heading.

Link: https://list.orgmode.org/877chnc0lr.fsf@localhost/
2024-06-04 15:17:11 +02:00