Commit Graph

19747 Commits

Author SHA1 Message Date
Ihor Radchenko 4bb0719374
org-capture-templates: Remove no-longer-supported variants from :type spec
* lisp/org-capture.el (org-capture-templates): Remove "sexp" type from
allowed values of capture targets.  S-exp support has been removed in
f5645675a3.
2024-06-14 13:48:10 +02:00
Ihor Radchenko d7b5c19daa
DnD: Create directory when `org-yank-image-save-method' is a directory
* lisp/org.el (org--dnd-attach-file): Make sure that target directory
is created before copying file when `org-yank-image-save-method' is
set to specific directory (not 'attach).

Reported-by: ISouthRain <isouthrain@qq.com>
Link: https://orgmode.org/list/tencent_AABB2DEBF7ABFBC795348C288E0EBFCFDD0A@qq.com
2024-06-13 18:03:50 +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 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 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 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
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 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 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 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
Ihor Radchenko 2f184485bf
Update version number for the 9.7.3 release 2024-06-06 16:49:56 +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
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 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 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 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 2ee94bb065
Reapply "lisp/ox-html.el: Restore org-svg class."
This reverts commit 895a367a67.
2024-06-03 11:16:15 +02:00
Ihor Radchenko 77e77f051c
Reapply "ox-html: Use <img> tags for svgs, not <object>"
This reverts commit 302bc6393a.

It turns out that <object ...> tags with data pointing outside the
website are not rendered by the modern
qtwebengine (linked svgs in https://orgmode.org/tools.html are not
rendered). Even though Firefox does render the same page, it no longer
appears safe to use <object ...> for svg.  So, we have to use <img...>
with its limitations.
2024-06-03 11:14:41 +02:00
Ihor Radchenko 8e8e635eba
Revert "lisp/ox-html.el: Convert :alt to :aria-label attribute in svg images"
This reverts commit 0e5ac43324.
2024-06-03 11:14:31 +02:00
Ihor Radchenko 5f050580d8
lisp/org.el (org--dnd-attach-file): Load org-attach
This is necessary to make sure that `org-attach-method' variable is
available.
2024-06-03 11:10:07 +02:00
Ihor Radchenko 0477df8aab
org-setup-yank-dnd-handlers: Support MacOS dnd URIs
* lisp/org.el (org-setup-yank-dnd-handlers): MacOS uses
"file:/Users/juergenfenn/Desktop/test-file.jpeg" instead of file:///
stype URIs in DND data.  Handle this URI style.

We do not need to worry about converting the URI -
`org--dnd-local-file-handler' uses `dnd-get-local-file-name' that
takes care about URI-to-path conversion.

Reported-by: Juergen Fenn <jfenn@gmx.net>
Link: https://orgmode.org/list/875xur1aql.fsf@localhost
2024-06-03 11:10:06 +02:00
Ihor Radchenko 88dd2cea35
Update version number for the 9.7.2 release 2024-06-01 14:49:45 +02:00
Ihor Radchenko 0ea4dc166c
org-html-latex-environment: Fix error when environment is non-math
* lisp/ox-html.el (org-html-latex-environment): Do not try to compute
caption for non-math environments.
2024-06-01 14:47:43 +02:00
Ihor Radchenko f737e7213d
Update version number for the 9.7.1 release 2024-06-01 11:14:24 +02:00
Ihor Radchenko 5fe70f2d66
Update version number for the 9.7 release 2024-06-01 10:59:57 +02:00
Ihor Radchenko dc485a6590
lisp/org-persist.el: Ignore lock files when writing cache
* lisp/org-persist.el (org-persist--write-elisp-file): Ignore locks.

Reported-by: Greg Minshall <minshall@umich.edu>
Link: https://orgmode.org/list/574109.1715751441@archlinux
2024-05-30 15:31:20 +02:00
Kyle Meyer 64bb80b982 Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.7 to
Emacs 30.1.
2024-05-28 23:43:46 -04:00
Kyle Meyer 53c39a494f org-ctags: Don't assume ctags-program-name is bound
* lisp/org-ctags.el (org-ctags-path-to-ctags): Fall back to "ctags" if
ctags-program-name isn't bound because that wasn't introduced until
Emacs 30.

This is a follow-up commit to the port of Emacs's 9082b4e6e.
2024-05-28 23:23:39 -04:00
Kyle Meyer 377addb5b2 Merge branch 'km/from-emacs-master' 2024-05-28 23:01:23 -04:00
Tim Landscheidt d12f8b8624 Backport commit 6d1c1fca0 from Emacs
* lisp/ob-calc.el: (org-babel-execute:calc):
* lisp/org-agenda.el (org-agenda-use-sticky-p):
Replace (with-current-buffer (get-buffer ...) ...) with
(with-current-buffer ...).

; Simplify (with-current-buffer (get-buffer ...) ...)
6d1c1fca0aa7c5a1ff0254af3f89a34d5309ea0d
Tim Landscheidt
Thu Mar 14 12:40:26 2024 +0200
2024-05-28 22:58:43 -04:00
Basil L. Contovounesios 014f85f55f Backport commit 6dacb60bb from Emacs
; Fix last major-mode-remap-defaults change.
6dacb60bb135dbb002c2ce1c70f70430c5d1bbff
Basil L. Contovounesios
Mon Mar 4 07:19:22 2024 +0100
2024-05-28 22:58:43 -04:00
Stefan Monnier ab62bdd79f Backport commit 2b5d43081 from Emacs
* lisp/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/ox-latex.el (org-latex-export-as-latex):
* lisp/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.

(major-mode-remap(-defaults)): New var and function (bug#69191)
2b5d43081a30f816dd38a16c7b5bfbad712a779b
Stefan Monnier
Sun Mar 3 23:58:18 2024 -0500
2024-05-28 22:58:43 -04:00
Stefan Monnier e8fe9642b0 Backport commit 445f376e4 from Emacs
Revert "ox-texinfo:: Require only TEXINFO_DIR_CATEGORY"
445f376e4e613ebee94d2844926269bfa8793858
Stefan Monnier
Sun Mar 3 22:09:24 2024 -0500
2024-05-28 22:58:43 -04:00
Stefan Monnier 5dc2b6ee75 Backport commit 1a37fe3a6 from Emacs
Revert "Set org-macro-templates more lazily"
1a37fe3a66930bb8151a29c722dbe3bebc20d033
Stefan Monnier
Sun Mar 3 22:09:19 2024 -0500
2024-05-28 22:58:43 -04:00
Stefan Monnier fb4d2b96dc Backport commit 99483e214 from Emacs
Set org-macro-templates more lazily
99483e214fdafa76e8001c7009dff13a76c33f32
Stefan Monnier
Sun Mar 3 16:57:56 2024 -0500
2024-05-28 22:58:43 -04:00
Stefan Monnier 338ff105c5 Backport commit 5254c582e from Emacs
* lisp/ox-texinfo.el: Remove redundant `:group` arguments.
Prefer #' to quote function names.
(org-texinfo-template): Use sane defaults for `@direntry`.

* doc/org.org (Texinfo specific export settings): Adjust accordingly.

ox-texinfo:: Require only TEXINFO_DIR_CATEGORY
5254c582efb3e7171e955dde653e7530d2d3ffef
Stefan Monnier
Sun Mar 3 16:57:56 2024 -0500
2024-05-28 22:58:43 -04:00
Robert Pluim 5a176d76ad Backport commit 862dfef88 from Emacs
* lisp/org-macs.el (org-split-string): Escape control chars.
* lisp/ox-latex.el (org-latex-guess-babel-language): And here.

Pacify more docstring control char warnings
862dfef88d8e62d12bac3ca2e44e035a2ff5b298
Robert Pluim
Thu Feb 29 09:31:41 2024 +0100
2024-05-28 22:58:43 -04:00
Stefan Kangas 6c34fd374c Backport commit 9364c2895 from Emacs
; Fix typos in symbol names
9364c28959a5b00e8ffd5d0d283ff0c0042f1bb0
Stefan Kangas
Sun Jan 21 15:28:06 2024 +0100
2024-05-28 22:58:43 -04:00
Stefan Kangas 7564dfd968 Backport commit 0f3be9596 from Emacs
; Prefer finder keyword "text" to deprecated keyword "wp"
0f3be9596fb3cf2f5e8f10fe2b3ef59546de98bb
Stefan Kangas
Sat Dec 30 18:14:40 2023 +0100
2024-05-28 22:58:43 -04:00
Stefan Monnier 68f9abe0cd Backport commit 40dafa9af from Emacs
* lisp/org-src.el (org-src-font-lock-fontify-block): Fix point-min /= 1
40dafa9af0ae3b1826409ebed80cb65f56591ffb
Stefan Monnier
Wed Dec 20 17:50:09 2023 -0500
2024-05-28 22:58:43 -04:00
Mattias Engdegård 1bff87bdb7 Backport commit 67977ae59 from Emacs
* lisp/org/org.el (org-make-tags-matcher):
Apply the transform (A+B*)+ -> A(A|B)*

Eliminate some nested repetitions in regexps
67977ae5974e54d34034aa7990cf22dd162c179b
Mattias Engdegård
Sun Oct 29 17:40:36 2023 +0100
2024-05-28 22:58:43 -04:00
Stefan Kangas 5e9a60aaae Backport commit 2e19e1163 from Emacs
* lisp/ob-lua.el (org-babel-lua-evaluate-session):
* lisp/ob-python.el (org-babel-python-initiate-session-by-key):
(org-babel-python-evaluate-session): Don't use obsolete 'sleep-for'
argument.
2024-05-28 22:58:43 -04:00