Re: [BUG] Got error opening existing org file in emacs 30.1 [9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)]

2025-03-15 Thread Ihor Radchenko
Steinar Bang  writes:

> ...the patch
> didn't make a difference.

So, we need to investigate further.

> I have also tried to exclude org mode files from editorconfig by adding
> ".org" to editorconfig-exclude-regexps, but that didn't help, either:
>
> (when (locate-library "editorconfig")
>   (editorconfig-mode 1)
>   (setq editorconfig-exclude-regexps '("\\.jar$" "\\.org$")))

May it be that you are using built-in version of edittorconfig?
I am afraid that the built-in version ignores
`editorconfig-exclude-regexps'.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Daan Ro
> We can use something like ;; as a separator or even compute it
> dynamically depending on the actual completion candidates (; if no
> candidates contain ;, ;;, ;;;, etc)

How does this look? I haven't known a function to reliably query all
completion candidates from a completion table of regardless of its type.

The ability to dynamically compute the crm-separator based on the
candidates sounds like a useful feature. I think it's best for Emacs
core to have that (optional) functionality built-in.

Daanturo

On Mar 15 2025, at 10:09 pm, Ihor Radchenko  wrote:
> Daan Ro  writes:
>
> > I've just recalled a limitation of CRM while testing: the separator must
> > not be part of the completion candidate strings. "," and ";" are common
> > in the authors field, other punctuations may appear in article names,
> > too. Perhaps that's reason CRM wasn't used by oc-basic.el in the first
> > place?
>
> We can use something like ;; as a separator or even compute it
> dynamically depending on the actual completion candidates (; if no
> candidates contain ;, ;;, ;;;, etc)
>
> I cannot find anything in the archives about using
> completing-read-multiple in citations.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>



0001-org-cite-basic-complete-key-crm-separator.patch
Description: Binary data


Fix org-export-dispatch variable: Missing colons (patch included in attachments)

2025-03-15 Thread Max J. Herrmann
Dear org-mode maintainers,

Being a casual org-user I am hereby submitting a small diff that fixes some 
missing colons in the variable org-export-dispatch​, as described in 
https://orgmode.org/worg/org-contribute.html#first-patch.
I have noticed missing colons in exported files when using the org-reveal 
export and traced the issue back to this variable. Checking in the source code 
I found that there were some colons missing. I tried to find all missing 
colons, but there are some languages where I was unsure whether it should be 
there. But at least for german and english I knew they were missing in my 
exports.

I hope the attached diff-file is acceptable.

Kindest regards and with much appreciation for all your hard work,

Max J. Herrmanndiff --git a/lisp/ox.el b/lisp/ox.el
index 646d09b51..e85028abc 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -6292,25 +6292,25 @@ them."
 ("Figure %d:"
  ("ar" :default "شكل %d:")
  ("cs" :default "Obrázek %d:")
- ("da" :default "Figur %d")
+ ("da" :default "Figur %d:")
  ("de" :default "Abbildung %d:")
  ("es" :default "Figura %d:")
  ("et" :default "Joonis %d:")
  ("fa" :default "شکل %d:")
- ("fr" :default "Figure %d :" :html "Figure %d :")
- ("is" :default "Mynd %d")
+ ("fr" :default "Figure %d:" :html "Figure %d :")
+ ("is" :default "Mynd %d:")
  ("it" :default "Figura %d:")
- ("ja" :default "図%d: " :html "図%d: ")
+ ("ja" :default "図%d:" :html "図%d:")
  ("nl" :default "Figuur %d:" :html "Figuur %d:")
- ("no" :default "Illustrasjon %d")
- ("nb" :default "Illustrasjon %d")
- ("nn" :default "Illustrasjon %d")
- ("pl" :default "Obrazek %d") ; alternatively "Rysunek %d"
+ ("no" :default "Illustrasjon %d:")
+ ("nb" :default "Illustrasjon %d:")
+ ("nn" :default "Illustrasjon %d:")
+ ("pl" :default "Obrazek %d:") ; alternatively "Rysunek %d"
  ("pt_BR" :default "Figura %d:")
  ("ro" :default "Imaginea %d:")
  ("ru" :html "Рис. %d.:" :utf-8 "Рис. %d.:")
- ("sl" :default "Slika %d")
- ("sv" :default "Illustration %d")
+ ("sl" :default "Slika %d:")
+ ("sv" :default "Illustration %d:")
  ("tr" :default "Şekil %d:")
  ("zh-CN" :html "图%d " :utf-8 "图%d "))
 ("Footnotes"
@@ -6418,24 +6418,24 @@ them."
 ("Listing %d:"
  ("ar" :default "برنامج %d:")
  ("cs" :default "Program %d:")
- ("da" :default "Program %d")
- ("de" :default "Programmlisting %d")
- ("es" :default "Listado de programa %d")
- ("et" :default "Loend %d")
+ ("da" :default "Program %d:")
+ ("de" :default "Programmlisting %d:")
+ ("es" :default "Listado de programa %d:")
+ ("et" :default "Loend %d:")
  ("fa" :default "برنامه‌ریزی %d:")
- ("fr" :default "Programme %d :" :html "Programme %d :")
- ("it" :default "Listato %d :")
+ ("fr" :default "Programme %d:" :html "Programme %d :")
+ ("it" :default "Listato %d:")
  ("ja" :default "ソースコード%d:")
  ("nl" :default "Programma %d:" :html "Programma %d:")
  ("nn" :default "Program %d:")
- ("no" :default "Dataprogram %d")
- ("nb" :default "Dataprogram %d")
- ("ro" :default "Lista %d")
+ ("no" :default "Dataprogram %d:")
+ ("nb" :default "Dataprogram %d:")
+ ("ro" :default "Lista %d:")
  ("pl" :default "Indeks %d:")
  ("pt_BR" :default "Listagem %d:")
  ("ru" :html "Распечатка %d.:"
   :utf-8 "Распечатка %d.:")
- ("sl" :default "Izpis programa %d")
+ ("sl" :default "Izpis programa %d:")
  ("sv" :default "Programlistning %d:")
  ("tr" :default "Program %d:")
  ("zh-CN" :html "代码%d " :utf-8 "代码%d "))
@@ -6554,27 +6554,27 @@ them."
 ("Table %d:"
  ("ar" :default "جدول %d:")
  ("cs" :default "Tabulka %d:")
- ("da" :default "Tabel %d")
- ("de" :default "Tabelle %d")
- ("es" :default "Tabla %d")
- ("et" :default "Tabel %d")
- ("fa" :default "جدول %d")
- ("fr" :default "Tableau %d :")
- ("is" :default "Tafla %d")
+ ("da" :default "Tabel %d:")
+ ("de" :default "Tabelle %d:")
+ ("es" :default "Tabla %d:")
+ ("et" :default "Tabel %d:")
+ ("fa" :default "جدول %d:")
+ ("fr" :default "Tableau %d:")
+ ("is" :default "Tafla %d:")
  ("it" :default "Tabella %d:")
  ("ja" :default "表%d:" :html "表%d:")
  ("nl" :default "Tabel %d:" :html "Tabel %d:")
- ("no" :default "Tabell %d")
- ("nb" :default "Tabell %d")
- ("nn" :default "Tabell %d")
- ("pl" :default "Tabela %d")
+ ("no" :default "Tabell %d:")
+ ("nb" :default "Tabell %d:")
+ ("nn" :default "Tabell %d:")
+ ("pl" :default "Tabela %d:")
  ("pt_BR" :default "Tabela %d:")
- ("ro" :default "Tabel %d")
+ ("ro" :default "Tabel %d:")
  ("ru" :html "Таблица %d.:"
   :utf-8 "Таблица %d.:")
- ("sl" :default "Tabela %d")
+ ("sl" :default "Tabela %d:")
  ("sv" :de

export org to latex, but do not include matlab code only the result

2025-03-15 Thread Uwe Brauer

Hi

I using GNU emacs 29.4 and org 9.7.14.
 
I swore one of the following code snippets using matlab with results
were exported to LaTeX, but only the results not the matlab code
snippets.

Not any more always the code and the result and the code is exported.

Any idea how to solve this 

Thanks

Uwe Brauer

Code follows

* First

#+begin_src matlab  :tangle annu_sol_ex23.m :padline yes :results output raw 
:exports results  :eval never-export 
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);
#+end_src


#+RESULTS:
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}

* Second
#+begin_src matlab :exports results :results output raw
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);
#+end_src

#+RESULTS:
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}


* Third
#+begin_src matlab :tangle annu_sol_ex23.m :padline yes :results output raw 
:exports code  :eval never-export
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);

#+end_src

#+RESULTS:
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}

* Fourth
#+begin_src matlab :tangle annu_sol_ex23.m :padline yes :exports both :eval 
never-export :results output latex
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);
#+end_src

#+RESULTS:
#+begin_export latex
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}
#+end_export


* Fifth
#+begin_src matlab :tangle annu_sol_ex23.m :padline yes :exports both :eval 
never-export :results output latex
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);
#+end_src

#+RESULTS:
#+begin_export latex
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}
#+end_export


* Six
#+begin_src matlab  :tangle annu_sol_ex23.m :padline yes :results output raw 
:exports results  :eval never-export 
addpath /home/oub/ALLES/HGs/Matlab-init/Routh-Hurwitz
num=[1 1];
den=[1 5 -6 0];
sys=tf(num,den);
latex_str = micaracteristic(num, den);
#+end_src

#+RESULTS:
\begin{equation}
K-6\,s+K\,s+5\,s^2+s^3=0
\end{equation}


-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 



smime.p7s
Description: S/MIME cryptographic signature


Re: [PATCH]: make ox-latex obey global export title/author settings

2025-03-15 Thread Ihor Radchenko
"Pedro A. Aranda"  writes:

> Second patch attached as promised...

Canceled.
Alternative patch has been applied.
See https://list.orgmode.org/87zfivm8qt.fsf@localhost/T/#t

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Q: Documentation question on beamer and org

2025-03-15 Thread Ihor Radchenko
David Masterson  writes:

> + What is the difference between TOC and the "Outline" slide?  Are they
>   meant to be the same thing?

Yes.

> + Why is my "Outline" slide blank?  Shouldn't it be picking up all the
>   "H:1" headings?  What am I missing?

Frames are usually not placed in TOC. Groups of frames (aka sections)
are. But it is not enabled by default.

For TOC, beamer presentation is usually structured as

#+options: toc:t h:2
* Section 1
** Frame 1.1
** Frame 1.2
* Section 2
...

> + The section on "Table of Contents" mentions the titletoc package, but
>   doesn't explain what it is or how to include it.  Is this necessary to
>   answer the previous question?

titletoc package is mentioned in the context of #+TOC keyword. It is
necessary for per-section table of contents.

   Org normally inserts the table of contents in front of the exported
document.  To move the table of contents to a different location, first
turn off the default with ‘org-export-with-toc’ variable or with
‘#+OPTIONS: toc:nil’.  Then insert ‘#+TOC: headlines N’ at the desired
location(s).

 #+OPTIONS: toc:nil
 ...
 #+TOC: headlines 2

   To adjust the table of contents depth for a specific section of the
Org document, append an additional ‘local’ parameter.  This parameter
becomes a relative depth for the current level.  The following example
inserts a local table of contents, with direct children only.

 * Section
 #+TOC: headlines 1 local

   Note that for this feature to work properly in LaTeX export, the Org
file requires the inclusion of the titletoc package.  Because of
compatibility issues, titletoc has to be loaded _before_ hyperref.
Customize the ‘org-latex-default-packages-alist’ variable.


> + I think "theme" in Beamer needs more explanation -- perhaps a link to
>   even the official Beamer place to find information and sample themes?
> + Frames and Blocks are difficult concepts -- perhaps there should be a
>   link to examples in Worg to show the possibilities?  I still don't get
>   the reason for frames and blocks.  Perhaps the reference to "Beamer's
>   sectioning elements, frames, and blocks" should also link to Beamer's
>   official docs to help.
> + Basically, I think the Org Mode doc on Exporting to Beamer should have
>   a link or two to official Beamer documentation to give new users
>   something else to jump into if they want to make really good slides.

+1. Maybe also a new section explaining TOC in beamer. Patches welcome!

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Org-contacts doesn't jump to items in the second file specified in org-contacts-files [9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)]

2025-03-15 Thread Ihor Radchenko
Garid Zorigoo  writes:

> The org-contacts maintainer has fixed this issue in the update 20250309.1659
> - For commit check:
> https://repo.or.cz/org-contacts.git/commitdiff/b06a59736800865b8a7e8d6d45774169cb31528a
>
> And please close this subject as this is resolved.

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Org manual: Confused about parentheses in "filename=(buffer-file-name)" in code block header

2025-03-15 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> Leo Butler writes on Fri  7 Mar 2025 15:59:
>  > On Fri, Mar 07 2025, alain.coch...@unistra.fr wrote:
>  > 
>  > >  #+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both
>  > >wc -w $filename
>  > >  #+END_SRC
>  > 
>  > (buffer-file-name) is evaluating the Emacs Lisp function
>  > `buffer-file-name', which returns a string with the buffer's filename.
>
> Thanks a lot for the explanations.  I hadn't realized it was elisp; I
> should have read more carefully the lines of the manual preceding those
> which I quoted.
>
> Yet, I think it would be clearer hence more helpful if the example were
> self-contained.  With my poor knowledge of elisp, I still don't know how to
> construct one...

May you elaborate? I do not understand which example you are referring
to and what you mean by "self-contained".

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org upgrade warnings from a simple package-upgrade

2025-03-15 Thread Ihor Radchenko
Ship Mints  writes:

> I ran package-upgrade cherry picking org in an Emacs session that was
> running for a week or so. I restarted it after package-upgrade and got the
> warnings below.
>
> I ran package-reinstall to force it all to be recompiled and I restarted
> Emacs with no warnings. I have a feeling what happened is that not every
> file was recompiled and perhaps there were macro expansion or something
> else that was stale. Unless there's a special step for org upgrades? Just
> guesses.

Yes, it is usually stale macros.
Unfortunately, Emacs cannot reliably detect macro changes and users keep
running into similar issues over and over.
At least, in your case, Org detected the problem, and it did not manifest
itself in cryptic failures caused by mixing old and new code.

The best I can suggest is installing Org mode from clean Emacs session
(with minimal config). Sometimes, cleaning elpa directory helps.
Not only for Org mode, but for other packages as well.

> If normal ELPA update warnings/errors are more widespread, you may get more
> noise from whatever this is due to.

FYI, both Org and Emacs devs are trying to address this problem for the
last dozen of years. But alas, it keeps appearing because library
version management is simply not there in Elisp.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



bug#48676: Arbitrary code execution in Org export macros

2025-03-15 Thread Ihor Radchenko
Stefan Kangas  writes:

>> #+macro: hello (eval (shell-command-to-string "touch /tmp/HELLO"))
>> Hello. {{{hello}}}
>>
>> Then:
>> M-x org-export-dispatch
>> t A
>>
>> -> now /tmp/HELLO exist, with no prompting.
>>
>> This seems contrary to normal Emacs practice for risky local variables,
>> and to the section "Code Evaluation and Security Issues" in the Org manual
>> (which does not mention macros).
>
> Ihor, could you please look into this bug?

This is a known problem.
I do not see it as a bug (user needs to execute a command), but indeed
code evaluation control should eventually be improved. It should just be
designed properly.

See more discussion in 
https://list.orgmode.org/orgmode/87edsd5o89.fsf@localhost/

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 





Re: Select a region and yank a URL to create a link

2025-03-15 Thread Ihor Radchenko
Ryan Prior via "General discussions about Org-mode."
 writes:

> Lately I've noticed more applications supporting a method of creating a link 
> by pasting a URL. The flow works like this:
> 1. write some text
> 2. select the text you want to linkify
> 3. paste a URL to turn the selected text into a named link
>
> This feature is supported many places (including Matrix, Zulip, GitLab, and 
> many others) and I've found it to be convenient. To that end, I've created a 
> proof of concept package called yank-dwim[1] that implements a 
> yank-dwim-org[2] command, which when used as a replacement for yank in 
> org-yank-generic, produces the effect I'm looking for.
>
> What do you think about adding this capability to org-mode? Since many 
> plain-text writing interfaces are offering it, I'm sure other users will 
> appreciate if Emacs does the same.

That looks like a good optional addition.

> If you're open to a patch, how do you like my implementation in the linked 
> package? I'm happy to take a different approach if you prefer something else.
> ...
> [2] https://github.com/ryanprior/yank-dwim/blob/main/yank-dwim.el#L85

I think that the most canonical approach to implement this would be via
`yank-transform-functions' and setting 'yank-handler text property (see
33.8.3 Yanking section of Elisp manual).

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org upgrade warnings from a simple package-upgrade

2025-03-15 Thread Ihor Radchenko
Ship Mints  writes:

> Do you have a feeling for which macro(s) are the most prominent ones that
> cause incompatibilities from release to release?

Always different. Any macro defined in a different file that is changed
after upgrade may cause issues that are hard to debug.

There is some hope though. Emacs recently added `require-with-check'
which is the next thing to try.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: export org to latex, but do not include matlab code only the result

2025-03-15 Thread General discussions about Org-mode.
>>> "UB" == Uwe Brauer  writes:

> Hi

> I using GNU emacs 29.4 and org 9.7.14.
 
> I swore one of the following code snippets using matlab with results
> were exported to LaTeX, but only the results not the matlab code
> snippets.

> Not any more always the code and the result and the code is exported.

> Any idea how to solve this 

> Thanks

> Uwe Brauer

> Code follows

I also tried to add
#+PROPERTY: header-args:matlab :exports results

#+begin_src emacs-lisp :results silent :exports none
(setq org-use-sub-superscripts nil)
(setq org-babel-default-header-args:matlab '((:exports . "results")))
#+end_src

Neither helped
-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 



smime.p7s
Description: S/MIME cryptographic signature


Re: [BUG] org-gnus-follow-link tries to select dead frame [9.8-pre (release_9.7.15-163-g3ff21c.dirty @ /home/bidar/.local/etc/emacs/lib/org/lisp/)]

2025-03-15 Thread Björn Bidar
Björn Bidar  writes:

> Ihor Radchenko  writes:
>
>> Björn Bidar  writes:
>>
 May it be that `org-link-frame-setup' is configured by the user to use
 current frame, but the user manually used gnus-other-frame and closed
 the frame? In my mind, your patch then introduced unexpected behavior.
>>>
>>> The `org-link-frame-setup' introduced the first unexpected behavior I
>>> think since `org-gnus-follow-link' unconditionally uses the previously
>>> existing frame, going with that opening Gnus outside of the
>>> gnus-other-frame-object in the frame setup function would go against
>>> that.
>>> ...
>>
>> Ok. Looks like you know what you are doing :)
>> I am a bit lost in this global state managed by gnus.
>
> I get it, I had my fare share of issues with it..
> Gnus suffered to my neglect over the years so much todo :)
>
>> In any case, given your arguments, I think that your patch is ok.
>> However, please add ORG-NEWS entry announcing new custom option.
>
> OK will do.


Here the updated patch as requested.

Please check if I put the announcement into the right sections.

>From 4114f6f02c0d2c25d95ab0ec5cbe2d23bfc9a77a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= 
Date: Tue, 21 Jan 2025 00:55:15 +0200
Subject: [PATCH] Ensure that gnus-other-frame-object is alive before selecting

* lisp/ol-gnus.el (org-gnus-follow-link): Ensure that
`gnus-other-frame-object' is active before selecting it.
Error out in case frame-object is dead, i.e. wasn't activated
by `org-link-frame-setup-function'.
(org-gnus-no-new-news): Take `gnus-other-frame-object' into account.
Call gnus-other-frame with chosen action instead without.
Ensures that previous behavior of `org-gnus-follow-link' is kept.
(org-gnus-no-new-news-other-frame): New function for users who choose
to call `gnus-other-frame' regardless if previous used or not.
* lisp/ol.el (org-link-frame-setup): Include
new `org-gnus-no-news-other-frame` function.
---
 etc/ORG-NEWS| 19 +++
 lisp/ol-gnus.el | 30 --
 lisp/ol.el  |  4 +++-
 3 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index cb2c16da8..f435dd888 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -211,6 +211,25 @@ retail 4-4-5 calendars, etc).
 # adding new customizations, or changing the interpretation of the
 # existing customizations.
 
+*** =org-link-gnus= Ensure that other frame is alive before selecting it
+Ensure that the Gnus frame is alive before selecting it if it was
+activated before.  Call ~gnus-other-frame~ in case it
+was used to call Gnus before, i.e. if ~gnus-other-frame-object~ is
+not ~nil~.  The side effect of that is that the original Gnus frame
+is reused when the frame is setup instead of being replaced
+when Gnus was activated using ~gnus~ instead ~gnus-other-frame~
+as it should when there is a Gnus frame.
+
+Existing ~org-link-frame-setup~ functions for Gnus links have
+to be adjusted to ensure that ~gnus-other-frame-object~ contains
+a frame which is alive.  Check the default ~org-gnus-no-news~
+function for more.
+
+*** ~org-link-frame-setup~ include new option to open Gnus in other frame
+Include ~org-gnus-no-new-news-other-frame~ as an option to always
+call Gnus using ~gnus-other-frame~ regardless if it had been previously
+used or not.  The function can be useful in a frame orientated setup.
+
 *** ox-odt: New export option ~org-odt-with-forbidden-chars~
 
 The new export option controls how to deal with characters that are forbidden
diff --git a/lisp/ol-gnus.el b/lisp/ol-gnus.el
index 5cddc3790..65d77ea88 100644
--- a/lisp/ol-gnus.el
+++ b/lisp/ol-gnus.el
@@ -228,7 +228,12 @@ (defun org-gnus-follow-link (&optional group article)
   "Follow a Gnus link to GROUP and ARTICLE."
   (require 'gnus)
   (funcall (org-link-frame-setup-function 'gnus))
-  (when gnus-other-frame-object (select-frame gnus-other-frame-object))
+  (when gnus-other-frame-object
+(if (not (frame-live-p gnus-other-frame-object))
+;; Error out in case org-link-frame-setup did not take care of setting up
+;; the gnus frame if was activate previously.
+(error "Couldn't select \'gnus-other-frame-object\', make sure it is active"))
+(select-frame gnus-other-frame-object))
   (let ((group (org-no-properties group))
 	(article (org-no-properties article)))
 (cond
@@ -260,11 +265,24 @@ (defun org-gnus-follow-link (&optional group article)
 	 (message "Couldn't follow Gnus link.  The linked group is empty."
  (group (gnus-group-jump-to-group group)
 
-(defun org-gnus-no-new-news ()
-  "Like `\\[gnus]' but doesn't check for new news."
-  (cond ((gnus-alive-p) nil)
-	(org-gnus-no-server (gnus-no-server))
-	(t (gnus
+(defun org-gnus-no-new-news (&optional other-frame)
+  "Like `\\[gnus]' but doesn't check for new news.
+In case of OTHER-FRAME or `gnus-other-frame-object' call `gnus-other-frame'.
+
+Ensures that `gnus-other-frame' is activated correctly if dead.

Re: [BUG] Got error opening existing org file in emacs 30.1 [9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)]

2025-03-15 Thread Steinar Bang
> Ihor Radchenko :

> Ok. So, whatever the problem is, it is not with Emacs itself.
> You may consider reporting about `editorconfig-exclude-regexps' to
> editorconfig upstream.

Will do!

> As for Org mode, may you try another version of the patch (attached)?

No change in behaviour with the patch compared to org-mode HEAD.

I rebuilt org-mode with "make autoloads" and started a fresh emacs.

When I open:
 emacs ~/git/bang-bompom/README.org
and then press TAB on the top item, the error occurs.

The README above can be found here:
 https://github.com/steinarb/bang-bompom/blob/master/README.org



Re: One big file or multiple small ones

2025-03-15 Thread General discussions about Org-mode.
Such a nice explanation. It definitely speaks of experience.

This resonates with me to some extent, surely I can feel down the line
if I continue I might pile up without managing it properly.

Categorizing is beneficial, I should utilize that more.

> If you don't apply the system well enough or user doesn't know how to
> apply it, then searching is the only option left.

This is true for me atm. A lazy man's system

> I have many Org files on my system, as for many people, meaning
> hundreds of them. When file is related to person, the file has been
> automatically opened, prepared, with some default sections, so that I
> can enter notes, tasks and transactions.
>
> When I have realized that it is not going to pass the time test, I
> have switched to database work, so all my notes are in the database,
> including Org notes as database entries and Org files as files on the
> file system.

This is giving me some realization on how to move forward, definitely
I'll think about time test.

NLP and LLM models might be truly beneficial.
Although scary, its a good idea for personal knowledge management.

> And all that in natural language manner.

That is indeed very much sophisticated. I remember using google
assisstant back then for reminding and noting which helped me alot.

This seems like a good approach and a way ahead utilizing the technology
well.

Definitely alot to take in, explore and think about it for me.

Thank you very much for writing this and sharing it here.
Your experience surely has weight and valid points, which I agree.
It was one of the comprehensive read and thought provoking matter on
note taking and management.

-- 
Zororg.




Re: Q: Documentation question on beamer and org

2025-03-15 Thread Ihor Radchenko
Sébastien Gendre  writes:

> To have these commands in the Org export dispatcher, a user first need
> to enable "org-beamer-mode".

No. One needs to load ox-beamer library.
org-beamer-mode just happens to autoload it.

This is described at the very beginning of "Exporting" section:

Org only loads backends for the following formats by default: ASCII,
HTML, iCalendar, LaTeX, and ODT.  Additional backends can be loaded
in either of two ways: by configuring the ~org-export-backends~
variable, or by requiring libraries in the Emacs init file.  For
example, to load the Markdown backend, add this to your Emacs config:

#+begin_src emacs-lisp
(require 'ox-md)
#+end_src


-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Got error opening existing org file in emacs 30.1 [9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)]

2025-03-15 Thread Steinar Bang
> Ihor Radchenko :
> This is not the first time we are getting editorconfig clashing with Org
> settings.
> May you try the attached patch?
> It should override editorconfig settings.

I did a fresh clone of org-mode, built with "make autoloads", and added
the following to .emacs:

(let ((git-org-dir (expand-file-name "~/git/org-mode")))
  (when (file-directory-p git-org-dir)
(add-to-list 'load-path (concat git-org-dir "/lisp"

I started a fresh emacs on the offending org-mode file and I still had
the problem.

I applied the patch, rebuilt org-mode with "make autoloads" and started
a fresh emacs on the file, and still had the problem.  I.e. the patch
didn't make a difference.

I have also tried to exclude org mode files from editorconfig by adding
".org" to editorconfig-exclude-regexps, but that didn't help, either:

(when (locate-library "editorconfig")
  (editorconfig-mode 1)
  (setq editorconfig-exclude-regexps '("\\.jar$" "\\.org$")))




Re: [FR] org-babel-n-tangle

2025-03-15 Thread Lei Zhe
Thanks Ihor, Phil

I updated the patch to address your comments.

>> You are dropping this logic completely in the patch. Without this part 
>> :tangle no may not work.
I restored the logic in the new patch.

>> With this change, ONLY-THIS-BLOCK = nil is ignored. This will cause problems.
I intended to remove the ONLY-THIS-BLOCK part since it will no longer
be used in the official code. However, after searching on GitHub, I
realized that org-babel-tangle-single-block is widely used by many
users, so I restored it in the new patch. However, in my opinion, it
should eventually be abandoned if the patch gets accepted.

llcc

On Wed, Mar 12, 2025 at 4:38 AM Phil Estival  wrote:
>
> References: 
> 
> 
> User-Agent: mu4e 1.12.8; emacs 30.1
> Date: Tue, 11 Mar 2025 21:38:00 +0100
>
> * [2025-03-09 15:12 +0800] Lei Zhe :
>
> Hello Lei,
>
> > It'll make the tangle system more flexible, and I would be glad to
> > see it included in the next release.
>
> I would be glad too.
>
> > I wanted to check in to see if you’re still planning to complete the
> > patch. If not, I am more than happy to take over and finish it.
>
> Yes, please, do. I don't think I will, I don't intend to at the moment.
> Sorry for this late answer. I don't have enough time to properly follow
> the list these days (there should only be a little left to provide the
> patch to ob-sql in the next weeks, as I'm using it again).
>
> > This patch is the first step in resolving the feature for tangling
> > source blocks to multiple targets.
> > I would appreciate any feedback.
>
> I'll add to Ihor answer that writing a new test suite
> (test-ob-n-tangle.el) would be useful.
>
> --
> Phil
From 99c76cdeaf232115b3d556a17b5a0ebed9151771 Mon Sep 17 00:00:00 2001
From: llcc 
Date: Sun, 9 Mar 2025 15:05:35 +0800
Subject: [PATCH] New feature: tangle org source blocks to multiple targets

1. add `:tangle-directory' to specify tangle directory.
2. `:tangle' now accepts symbols that return a path string, or a list of file path, or a single string
---
 lisp/ob-tangle.el | 79 ---
 1 file changed, 54 insertions(+), 25 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 38cad78ab..361ee521d 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -500,34 +500,30 @@ code blocks by target file."
(org-element-at-point)
'headline t))
  1)))
-	(if (eq last-heading-pos current-heading-pos) (cl-incf counter)
-	  (setq counter 1)
-	  (setq last-heading-pos current-heading-pos)))
+	(if (eq last-heading-pos current-heading-pos) (cl-incf counter)
+	  (setq counter 1)
+	  (setq last-heading-pos current-heading-pos)))
   (unless (or (org-in-commented-heading-p)
 		  (org-in-archived-heading-p))
-	(let* ((info (org-babel-get-src-block-info 'no-eval))
-	   (src-lang (nth 0 info))
-	   (src-tfile (cdr (assq :tangle (nth 2 info)
-	  (unless (or (string= src-tfile "no")
+(let* ((block (org-babel-tangle-single-block counter t))
+   (src-file (car block))
+   (src-lang (caar block)))
+  (unless (or (not src-file)
   ;; src block without lang
-  (and (not src-lang) (string= src-tfile "yes"))
-		  (and tangle-file (not (equal tangle-file src-tfile)))
+  (and (not src-lang) src-file)
+  (and tangle-file (not (equal tangle-file src-file)))
   ;; lang-re but either no lang or lang doesn't match
-		  (and lang-re
+  (and lang-re
(or (not src-lang)
(not (string-match-p lang-re src-lang)
-	;; Add the spec for this block to blocks under its tangled
-	;; file name.
-	(let* ((block (org-babel-tangle-single-block counter))
-   (src-tfile (cdr (assq :tangle (nth 4 block
-		   (file-name (org-babel-effective-tangled-filename
-   buffer-fn src-lang src-tfile))
-		   (by-fn (assoc file-name blocks)))
-	  (if by-fn (setcdr by-fn (cons (cons src-lang block) (cdr by-fn)))
-		(push (cons file-name (list (cons src-lang block))) blocks)))
+(setq blocks
+  (mapcar (lambda (group)
+(cons (car group)
+  (apply #'append (mapcar #'cdr (cdr group)
+  (seq-group-by #'car (append block blocks
 ;; Ensure blocks are in the correct order.
 (mapcar (lambda (b) (cons (car b) (nreverse (cdr b
-	(nreverse blocks
+	(nreverse blocks
 
 (defun org-babel-tangle--unbracketed-link (params)
   "Get a raw link to the src block at point, without brackets.
@@ -550,6 +546,39 @@ The PARAMS are the 3rd element of the info for the same src block."
 bare))
 
 (defvar org-outline-regexp) ; defined in lisp/org.el
+
+(defun or

Re: [FR] org-read-date-style

2025-03-15 Thread Ihor Radchenko
Zoey Hewll  writes:

> * Motivation
> The prevailing date format where I live is D/M/Y, often abbreviated to 
> D/M. While I prefer Y-M-D as a persistent storage format, I naturally 
> default to D/M and prefer it for data entry. Especially when entering 
> recent dates (with =org-read-date-prefer-future= set to nil), which 
> usually do not require the year component and therefore the unambiguous 
> ISO 8601 format (Y-M-D) is slower to input in full, and does not match 
> the locally conventional order (D/M) when abbreviated (M-D).
>
> * Proposal
> The =org-read-date= function understands slash-separated dates in the 
> "american" format (M/D/Y and M/D). This code could be modified so that 
> the parsing of slash-separated dates depends on user preference, by 
> introducing a configuration variable like =calendar-date-style=, which 
> I'm tentatively naming =org-read-date-style=. Like 
> =calendar-date-style=, this would change the parsing of slash-separated 
> dates by =org-read-date=, but it would not change the order of arguments 
> passed to date-processing functions.
>
> It would support at least =american= (M/D and M/D/Y) and =european= (D/M 
> and D/M/Y) options.

I do not mind such an addition.

> * Alternatives and Extensions
> - =org-read-date= could simply read the value of =calendar-date-style= 
> rather than introducing a new configuration item. I propose a new item 
> because of the well-documented pitfalls of =calendar-date-style=.

Maybe we can default `org-read-date-style' to the value of 
`calendar-date-style'.

> - There could be an option to entirely forbid dates in slash-separated 
> formats, if the user wishes to avoid the possibility of this kind of 
> misinterpretation. I have not proposed this as I have no use for it.

This sounds excessive. If user does not want to use /, just do not type it.

> ... side-note: I 
> have not attached a patch as I am yet to complete the copyright 
> assignment, but I thought the feature was worthwhile to request regardless.)

If you need any help with the copyright assignment process, please let me know.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] org-babel-n-tangle

2025-03-15 Thread Ihor Radchenko
Lei Zhe  writes:

>>> With this change, ONLY-THIS-BLOCK = nil is ignored. This will cause 
>>> problems.
> I intended to remove the ONLY-THIS-BLOCK part since it will no longer
> be used in the official code.

It is still used by `org-babel-tangle' itself.

> ... However, after searching on GitHub, I
> realized that org-babel-tangle-single-block is widely used by many
> users, so I restored it in the new patch. However, in my opinion, it
> should eventually be abandoned if the patch gets accepted.

Yup. `org-babel-tangle-single-block' is not an internal function, so we
cannot frivolously change its signature or change the behavior too much.

As for the patch, I tried to run it with simple example

#+begin_src emacs-lisp :tangle '("1.el" "2.el")
(+ 1 2)
#+end_src

and got an error.

Also, ob-tangle/collect-blocks test is failing.

I recommend running make test to check the patch.
It is also a good idea to add new tests into
testing/lisp/test-ob-tangle.el
See https://orgmode.org/worg/org-contribute.html#first-patch

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Language support for C# in org-babel

2025-03-15 Thread Ihor Radchenko
poverobuosodonati  writes:

>> To me, it looks like this is going into the territory of compiled
>> sources being the result of evaluation, as we discussed in
>> https://list.orgmode.org/orgmode/1819406926.505980.1701990611...@fidget.co-bxl/
>> But that's a totally new behavior we may want to discuss across backends
>> before implemeting.
> You are right: this went in exactly that direction. In fact, I was not 
> aware that there is this discussion in place and it is not intended to 
> (currently?) to let source blocks be consumers of compiled resources 
> from other source blocks.

In my mind, producing an executable file or project should be a special
:results type. But we need to discuss the exact logic in that thread
first and then actually implement it. Someone™ should do it and produce
patches ;) I can participate in the discussion, but there is little
chance that I put this particular feature ahead of other priorities.
What I can tell is that I am on favor of adding such a feature to Org
babel.

> ... So, with this review iteration, the code 
> simplified quite a bit:
>...
>   * "namespace" & "project" header arguments were removed (which also
> was needed for the said purpose)

Nitpick: readme still mentions them.

> Further, please note
>
>   * I forgot command line arguments, which was changed for this review
> as well (source blocks accept a "cmdline" header argument now)

Other standard header arguments that would be nice to support are
:prologue and :epilogue.

> https://codeberg.org/buoso/csharp-babel/src/commit/6f0c528bbdc0cd56c0639c630a11e80b25d1f74c/ob-csharp.el#L225-L230

The patch looks good in general now.
The only potential problem I noticed is that
`org-babel-execute:csharp' and `org-babel-execute:csharp' generate
NAMESPACE values independently. So, expanded body might be using
different namespace than project file.

Some other minor comments:

1. You need to add docstrings to all the functions
2. Add :package-version to all the defcustoms
3. Convert lambdas in defcustoms into proper functions. Otherwise, it
   will be inconvenient to customize them.
4. I do not recommend using gensym. It can produce the same values in
   different Emacs sessions (e.g. after restarting Emacs). Especially
   for project-name that is used to create project folder - we risk
   clashes. You may use make-temp-name to ensure unique file/directory
   name.
5. You should probably remove messages in `org-babel-execute:csharp'.
   At least, "executing ..." - it is duplicating message from
   org-babel-execute-src-block.
   Some users also dislike excessive messages, especially in batch Emacs
   (see https://yhetil.org/emacs-devel/868qzd9hjg@gnu.org/)

Next step will be writing tests.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Re: Q: Documentation question on beamer and org

2025-03-15 Thread Ihor Radchenko
David Masterson  writes:
> Ok. Patch attached that hopefully Ihor will pick up.

Applied.
https://git.sr.ht/~bzg/worg/commit/226265af

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [Feature Request] Adding custom indices for Texinfo export (and maybe unaffiliated dual-value keywords?)

2025-03-15 Thread Ihor Radchenko
Okamsn via "General discussions about Org-mode." 
writes:

> Texinfo allows one to create new named indices using `@defindex NAME`, 
> which can then be used via `@NAMEindex`.  I have been experimenting with 
> different ways of supporting this.

Looks like a reasonable addition.
CCing the new ox-texinfo maintainer. He might have better insight.

> ...
> After thinking about it, I wonder whether it would be better to have a 
> dual-valued keyword like `#+INDEX[name]: text`, which would avoid 
> needing to convert between letter cases and restricting users.  However, 
> it looks like secondary values are restricted to keywords affiliated 
> with other Org structures.  In my testing, it looks like 
> `org-element-keyword-parser` includes the dual value as part of the key 
> name.
>
> Would it be possible to allow un-affiliated keywords to also have dual 
> values?

Maybe. However, this would be a breaking change in Org syntax. I am not
sure if the proposed feature is sufficient to justify such a change.

A much simpler approach would be using a special value syntax like
  #+INDEX: [name] text

We might end up adding dual values to keywords in future (there are
other reasons to do it), but I'd like to wait until we prove that such
change is justified more.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Daan Ro
My apology for the late reply.

> An alternative could be using `completing-read-multiple' where you can
> enter, for example, comma-separated list of citations or a single
> citation as you prefer.

This is an improvement over ther current input loop, I think.
> > In Latex, \cite is also more commonly used and more asked/documented
> > compared to \cites. I think org-cite's decision to make inserting
> > citation(s) multiple by default an odd choice.

> May you elaborate? Are you talking about auctex?
\cites is just rarely used IIRC. A DDG search for "latex \cites" return
only a single results on tex.stackexchange.com asking about the
differences of \cite and \cites, all the other ones only mention \cite.
On https://www.overleaf.com/learn \cites isn't documented at all while
\cite is abundantly mentioned.

> Is it really with asking for multiple citations? Or is it about specific
> default behavior of `org-cite-basic--complete-key'? Have you tried
> alternative citation processors that provide custom completion like
> citar?

Yes looks like only `org-cite-basic--complete-key' supports inserting
citations among org-cite's built-in processors, but it is also about
`org-cite-make-insert-processor' producing a lambda that always asks for
multiple citations from the 'select-key' function in its last case.

Using citar and setting `citar-select-multiple' to nil makes it only
asks for once. But if only caring for a single command like
'org-cite-insert', installing citar seems overkill. My wish was to make
the said core command more friendly when a completion engine is enabled,
which is recommended by all Emacs starter guides/kits.

Converting `org-cite-basic--complete-key' to `completing-read-multiple',
preferrably by default looks like a sweet solution? But I'm not sure
since that may breaks some people's workflows.

(BTW my previous patch was wrong, updated for that idea.)
(Excused me for spamming, I press the wrong reply button last email)

Daanturo

On Mar 12 2025, at 12:46 am, Ihor Radchenko  wrote:
> Daan Ro  writes:
>
> > Currently org-cite-insert requires multiple  to complete. When a
> > completion engine is enabled (likely the more common case), like vertico
> > or the built-in fido-mode, etc. we must also know how to exit
> > "abnormally", usually with "M-j":
> > https://github.com/minad/vertico/issues/261, else the command will keep
> > asking non-stop.
>
> That's what `org-cite-basic--complete-key' is currently doing, yes.
> Non not-stop, but until you enter an empty input.
> Why it is so hard to enter empty input in some completion styles is a
> separate question.
>
> An alternative could be using `completing-read-multiple' where you can
> enter, for example, comma-separated list of citations or a single
> citation as you prefer.
>
> > In Latex, \cite is also more commonly used and more asked/documented
> > compared to \cites. I think org-cite's decision to make inserting
> > citation(s) multiple by default an odd choice.
>
> May you elaborate? Are you talking about auctex?
> > May we add an option to make org-cite-insert prompt only once? I
> > naively think of an option named org-cite-insert-single.
>
> Not sure. I would like to understand better what the actual problem is.
> Is it really with asking for multiple citations? Or is it about specific
> default behavior of `org-cite-basic--complete-key'? Have you tried
> alternative citation processors that provide custom completion like
> citar?
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>



0001-Defcustom-org-cite-insert-single.patch
Description: Binary data


Re: Repeater in a time-range?

2025-03-15 Thread Ihor Radchenko
David Masterson  writes:

> Is it possible to specify a repeater in a time-range in Org?  Something
> like:
>
>   <2025-03-06 Thu 16:00 +1w>--<2025-03-27 Thu 16:00>
>
> Meaning: I have appointments on Thursdays at 4pm, but only for the month
> of March in 2025.

I recommend using SCHEDULE + DEADLINE like

* appointment
SCHEDULED: <2025-03-06 Thu 16:00 +1w> DEADLINE: <2025-03-27 Thu> 

and then set
`org-agenda-skip-scheduled-repeats-after-deadline' to t.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



change to headline text overlay behaviour of org-clock-display

2025-03-15 Thread libreville
Hello everyone,

currently, if I clock some time and then do org-clock-display, the
headline text changes face to ‘default’. If I’m not mistaken, this
wasn’t the usual behavior until recently (my update to Emacs 30,
perhaps?). The face at that location is org-level-1, which, if I
remember rightly, used not to be overlaid with ‘default’. (Compare this
screencast from 2016:
https://www.youtube.com/watch?v=uVv49htxuS8&t=722.)

Can anyone help me understand where the default face is coming from
here?

With point on the headline text, calling describe-char results in Emacs
telling me that the headline text is subject to an overlay. Selecting
‘[Show]’ then reveals:

#("the headline text··  0:17 "
  0 28 (fontified t face default :org-clock-minutes-default 17) 28 58
  (face shadow) 58 69 (face org-clock-overlay))

The mechanics behind this appear to be in org-clock-put-overlay, which,
however, doesn’t explicitly apply a '(face default) to the headline (it
is responsible for the appearance of the ‘shadow’ and
‘org-clock-overlay’ faces).

Org-clock-put-overlay calls org-overlay-display and further down
make-overlay (C code that I haven’t examined). Do they explain why the
default face is getting set? What has changed?

Best,
liv



Re: Hope to improve the `org-set-property` performance

2025-03-15 Thread Ihor Radchenko
stardiviner  writes:

> The `org-set-property` [C-c C-x p] command is very slow on a big Org-mode
> buffer.
> I checked out the source code of `org-set-property`. The main slow is on
> `org-buffer-property-keys`. I think it can use the new org-mode cache
> mechanism. Instead of re-parse the whole org-mode buffer again to spend a
> lot of time.

Planned for the refactor branch.
See 
https://git.sr.ht/~yantar92/org-mode/tree/feature/refactor-deps-v2/item/lisp/org-property.el#L426

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org upgrade warnings from a simple package-upgrade

2025-03-15 Thread Ship Mints
On Sat, Mar 15, 2025 at 1:32 PM Ihor Radchenko  wrote:

> Ship Mints  writes:
>
> > I ran package-upgrade cherry picking org in an Emacs session that was
> > running for a week or so. I restarted it after package-upgrade and got
> the
> > warnings below.
> >
> > I ran package-reinstall to force it all to be recompiled and I restarted
> > Emacs with no warnings. I have a feeling what happened is that not every
> > file was recompiled and perhaps there were macro expansion or something
> > else that was stale. Unless there's a special step for org upgrades? Just
> > guesses.
>
> Yes, it is usually stale macros.
> Unfortunately, Emacs cannot reliably detect macro changes and users keep
> running into similar issues over and over.
> At least, in your case, Org detected the problem, and it did not manifest
> itself in cryptic failures caused by mixing old and new code.
>
> The best I can suggest is installing Org mode from clean Emacs session
> (with minimal config). Sometimes, cleaning elpa directory helps.
> Not only for Org mode, but for other packages as well.
>
> > If normal ELPA update warnings/errors are more widespread, you may get
> more
> > noise from whatever this is due to.
>
> FYI, both Org and Emacs devs are trying to address this problem for the
> last dozen of years. But alas, it keeps appearing because library
> version management is simply not there in Elisp.
>

Makes sense.  I wrote a lisp program to auto-populate a clean elpa tree
which I occasionally run when things get crufty.

Do you have a feeling for which macro(s) are the most prominent ones that
cause incompatibilities from release to release?


Re: [FR] [ox-html] export timestamps and durations via HTML5 element

2025-03-15 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Lukas Epple  writes:
> ...
>> If we are using HTML5 () to export, we are entitled to 
>> use the  element [1] [2] which allows attaching a machine readable 
>> date, time, datetime or duration to text. Consequently, I propose that 
>> we change the rendering to something like the following if the user sets 
>> org-html-doctype to use HTML5:
>>
>>  
>>  [2025-01-31 Fri]
>>  
>
> I see no downside doing this as long as user enables `org-html-html5-fancy'.
> ...

It has been over a month.
Lukas, are you still interested to work on the patch?
Do you need any help?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: inconsistency for the affiliated keyword of a dynamic block

2025-03-15 Thread Ihor Radchenko
pinmacs  writes:

> There is a special case that might need a clarification in the orgmode 
> implementation and/or the org-syntax [0]
>
> The affiliated keyword, when it's before a dynamic block [1] it does not 
> work.
>
> Example:
>
> #+NAME: test
> #+BEGIN: something-that-generates-a-table
> | State | ID | Task    | RESPONSIBLE |
> |---++-+-|
> | TODO  | T1 | [[file:/tmp/affiliated-keyword-dynamic-block.org::*My 
> task][My task]] | Laura   |
> | TODO  | T2 | 
> [[file:/tmp/affiliated-keyword-dynamic-block.org::*Task2][Task2]] | 
> Anna    |
> #+END:

What do you mean by "does not work"? It works just fine. You can refer
to it - it is a name for the dynamic block itself.

> It must be
>
> #+BEGIN: something-that-generates-a-table
> #+NAME: test
> | State | ID | Task    | RESPONSIBLE |
> |---++-+-|
> | TODO  | T1 | [[file:/tmp/affiliated-keyword-dynamic-block.org::*My 
> task][My task]] | Laura   |
> | TODO  | T2 | 
> [[file:/tmp/affiliated-keyword-dynamic-block.org::*Task2][Task2]] | 
> Anna    |
> #+END:

Maybe we can arrange Org to leave manually added affiliated keywords as
is when updating the dblock, similar to what colview does.

Another idea is https://list.orgmode.org/orgmode/871qaer7bo.fsf@localhost/

> I think it is reasonable to say that a NAME given before a BEGIN dynamic 
> block element, applies to the thing that the dynamic block generates
>
> The ability to clearly identify elements of exported html document is 
> nice to improve the visibility of things, for example here I experienced 
> how a table that represents a kanban might be better visualized using 
> css and js [2]

Then, it will be impossible to refer to the dynamic block itself.

> Coming back to the org syntax, I suspect that the table rows are not an 
> exception, #+NAME before table rows is specifically what I am using to 
> identify the table, and what does not work when there is in the middle 
> the dynamic block

May you elaborate?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: deltachat inbox bot

2025-03-15 Thread Ihor Radchenko
Thibaut Meyer via "General discussions about Org-mode."
 writes:

> I would like to share a program I made recently. It’s a bot for the
> Deltachat instant messenger (https://delta.chat/) that interacts with an
> org-mode file.
>
> I wrote about it on my blog here:
> https://thibaut.dev/blog/deltachat-inbox-bot.html
>
> The code for the bot can be found at:
> https://git.sr.ht/~bgtdsword/deltachat-inbox-bot
>
> I deployed it with Docker, but that’s of course optionnal. This is not
> rocket science but I’ve become quite reliant on it already. I would be
> interested to hear about any feedback or comments.

Thanks for sharing!
It sounds similar to https://elpa.gnu.org/packages/jami-bot.html and
https://elpa.gnu.org/packages/org-jami-bot.html
AFAIU, org-jami-bot provides reacher functionality for capturing.
You may use it as a source of inspiration.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[Patch] Support png overlay background transparency in a transparent frame

2025-03-15 Thread gynamics
Emacs has support frame background transparency since 29, add `:mask 
heuristic` to overlay property list to make its transparent part masked 
when displayed in a transparent frame.


There is a related thread 
[[https://emacs-china.org/t/org-latex-preview-png/29167/12]] .


This is my first time to try to contribute, if I have anything done 
wrong, please tell me!


From 814173a7d5035af2028c3c9173f6b3aa06abfee3 Mon Sep 17 00:00:00 2001
From: gynamics 
Date: Sun, 16 Mar 2025 02:22:50 +0800
Subject: [PATCH] Support png overlay background transparency in a transparent
 frame.

---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index bc61a7c46..b0f30156e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16166,7 +16166,7 @@ as a string.  It defaults to \"png\"."
 			 (delete-overlay o
 (overlay-put ov
 		 'display
-		 (list 'image :type imagetype :file image :ascent 'center
+		 (list 'image :type imagetype :file image :ascent 'center :mask heuristic
 
 (defun org-clear-latex-preview (&optional beg end)
   "Remove all overlays with LaTeX fragment images in current buffer.
-- 
2.48.1



Re: [BUG] org babel uses sh-mode with zsh indentation when i specify bash or bash-ts [9.7.11 (release_9.7.11 @ /usr/local/share/emacs/31.0.50/lisp/org/)]

2025-03-15 Thread Ihor Radchenko
the_wurfkreuz via "General discussions about Org-mode."
 writes:

> Reproduction:
> 1. emacs -Q
> 2. In the scratch buffer: M-x org-mode
> 3. M-x treesit-install-language-grammar
> Write "bash" and choose interactive installation, then all the default 
> options.
> 3. Paste this code:
>
> #+begin_src bash-ts
> [ 3 -eq 3 -a \( 2 -eq 2 -a 1 -eq 1 \) ] && echo “Parentheses can be used”
> #+end_src
>
> It creates this message: "Indentation setup for shell type zsh". And the
> code block uses the sh-mode instead of the bash-ts mode.

I cannot reproduce with system-installed tree-sitter grammar.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Daan Ro
I've just recalled a limitation of CRM while testing: the separator must
not be part of the completion candidate strings. "," and ";" are common
in the authors field, other punctuations may appear in article names,
too. Perhaps that's reason CRM wasn't used by oc-basic.el in the first
place?

Daanturo

On Mar 15 2025, at 8:01 pm, Ihor Radchenko  wrote:
> Daan Ro  writes:
>
> >> How does \cites have anything to do with interactive selection of
> >> multiple citations at once?
> >
> > An analogy, especially when exporting. Single selection of a citation
> > -> \cite, multiple selections -> \cites.
>
> This is a strange analogy. It is extremely common to cite multiple
> references via \cite{ref1, ref2, ...}.
>
> >> That's what I am leaning to - modifying oc-basic.el rather than oc.el
> >> itself.
> >
> > Thank you, I think the CRM approach is even simpler than the current
> > prompt-building one. But do we keep the latter?
>
> Yes, of course. Not keeping it would be a breaking change.
> Instead, we should make the completion function customizeable.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>



Re: [BUG] Got error opening existing org file in emacs 30.1 [9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)]

2025-03-15 Thread Ihor Radchenko
Steinar Bang  writes:

>> May it be that you are using built-in version of edittorconfig?
> ...
> Library is file ~/.emacs.d/elpa/editorconfig-20250219.1528/editorconfig.elc

Ok. So, whatever the problem is, it is not with Emacs itself.
You may consider reporting about `editorconfig-exclude-regexps' to
editorconfig upstream.

As for Org mode, may you try another version of the patch (attached)?

>From 97ded0b6a7e014e55dc437bca1330b31246e4617 Mon Sep 17 00:00:00 2001
Message-ID: <97ded0b6a7e014e55dc437bca1330b31246e4617.1742024480.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Wed, 12 Mar 2025 18:45:11 +0100
Subject: [PATCH v2] org-mode: Be more aggressive setting tab-width to 8

* lisp/org.el (org--set-tab-width): New helper to set `tab-width'.
(org-mode): Override file-local and directory-local settings for
`tab-width', if any.  With non-standard `tab-width', parser cannot
work properly.

Reported-by: Steinar Bang 
Link: https://orgmode.org/list/87msdrw5qt@dod.no
---
 lisp/org.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index bc61a7c462..70a903b0d2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4970,6 +4970,10 @@ (defvar org-mode-tags-syntax-table
 st)
   "Syntax table including \"@\" and \"_\" as word constituents.")
 
+(defun org--set-tab-width ()
+  "Set `tab-width' to be 8."
+  (setq-local tab-width 8))
+
 ;;;###autoload
 (define-derived-mode org-mode outline-mode "Org"
   "Outline-based notes management and organizer, alias
@@ -4992,7 +4996,11 @@ (define-derived-mode org-mode outline-mode "Org"
   (setq-local org-mode-loading t)
   ;; Force tab width - indentation is significant in lists, so we need
   ;; to make sure that it is consistent across configurations.
-  (setq-local tab-width 8)
+  (org--set-tab-width)
+  ;; Really force it, even if dir-locals or file-locals set it - we
+  ;; need tab-width = 8 as a part of Org syntax.
+  (add-hook 'hack-local-variables-hook
+#'org--set-tab-width -90 'local)
   (org-load-modules-maybe)
   (when org-agenda-file-menu-enabled
 (org-install-agenda-files-menu))
-- 
2.47.1


-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-03-15 Thread Ihor Radchenko
Tor-björn Claesson  writes:

> It adds om.el, which contains the start of a simple menu system, and uses
> this to define org-cite-basic-follow.
> Most of the work is done in org-menu-define.

Now a proper high-level review.

> +(org-menu-define org-cite-basic-follow
> + "Follow citation"
> + org-cite-basic-follow-actions
> + :display t
> + :default-action 'org-cite-basic-goto
> + :parameter-types ('citation 'citation-reference))
> ...
> +;;; Main macro definition
> +(cl-defmacro org-menu-define (name
> +  docstring
> +  contents
> +  &key ((:display display) nil)
> +  &key ((:default-action default-action) nil)
> +  &key ((:parameter-types types) nil))
> +  "Define an org menu."
> +  (setq org-menu-display (cons `(,name . ,display) org-menu-display))
> +  (setq org-menu-default-actions (cons `(,name . ,default-action) 
> org-menu-default-actions))
> +
> +  `(transient-define-prefix ,name (object &optional prefix)
> + ,docstring
> + [:class transient-columns
> + :setup-children
> ...
> + (interactive
> ...
> +  (list (let ((obj (org-element-context)))

I think that we need to step back and define what we want to see in this
new library, because your current version of the code limits the overall
scope of where the org-menu can be used.

I envision the general idea of org-menu commands to:
1. Either display a menu or just call a normal command depending on
   prefix argument, org-menu-mode, and user customizations
2. Provide infrastructure to define menus regardless of the display
   backend (transient or something else) and without limiting the
   command arguments.

I believe that specifically tying things to transient is limiting.
Similarly, hard-coding (object &optional prefix) arguments is limiting -
this will prevent menus from being used outside Org mode and will
severely limit the argument passed.

I imagine the following semantics of org-menu-define:

(org-menu-define menu-name (prefix argument1 argument2 ...) ;; PREFIX argument 
mandatory
 "DOCSTRING"
 :actions <(mandatory) actions or variable holding actions>
 :default-action <(optional) action or variable holding default action>
 :display <(optional) whether to display full menu by default, may be 
customized>
 :menu-system <(optional) menu system to be used, may be customized>
 :switch <(optional) switch to be used, may be customized>
 <(optional) body that may pre-process arguments arbitrarily; the body may 
contain
 interactive spec as needed (if not, the macro will define one)
)

Then, org-menu-define will:

1. Define a set of variables:
   + -actions (if actions is not already a variable)
   + -default-action (if not already a  variable)
   + -display (...)
   + -menu-system (...)
   + -switch (...)

2. Define a command named  that will honor
   org-menu-mode, keyword options passed, and generally provide unified UI

3. The  command will roughly look like
   (defun menu-name (args)
"DOCSTRING modified to indicate that is it a menu command"



(if ...
 
 ))

4. In the menu specification, rather than hard-coding
   !object and !prefix, we allow any argument from the argument list to
   be referenced.
   We should also not rely upon `transient-scope'. Instead, we should
   set things up to pass the argument values to a menu provider and only
   use `transient-scope' when the menu provider is transient.

The details in these last 4 points are mostly my brainstorming. We may
discuss specific design further. But I hope that you got my idea about
more generic design less tied to transient and the specifics of
`org-cite-basic-follow'.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Warning/Error message seen on an org file...

2025-03-15 Thread Ihor Radchenko
Ihor Radchenko  writes:

> "Rivoallon, Frederic"  writes:
>
>> The org version is 9.6.
>
> Ok. This is not the latest release.
> May you upgrade and let me know if you still see the warning?

No update for over a month.
I thus cannot proceeed and will assume that the warning will be gone
after the upgrade.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Ihor Radchenko
Daan Ro  writes:

>> > In Latex, \cite is also more commonly used and more asked/documented
>> > compared to \cites. I think org-cite's decision to make inserting
>> > citation(s) multiple by default an odd choice.
>
>> May you elaborate? Are you talking about auctex?
> \cites is just rarely used IIRC. A DDG search for "latex \cites" return
> only a single results on tex.stackexchange.com asking about the
> differences of \cite and \cites, all the other ones only mention \cite.
> On https://www.overleaf.com/learn \cites isn't documented at all while
> \cite is abundantly mentioned.

Sorry, but I am lost.
How does \cites have anything to do with interactive selection of
multiple citations at once?

> Yes looks like only `org-cite-basic--complete-key' supports inserting
> citations among org-cite's built-in processors, but it is also about
> `org-cite-make-insert-processor' producing a lambda that always asks for
> multiple citations from the 'select-key' function in its last case.

It feels wrong to try solving UI problems on oc.el level. oc.el has no
relation to UI specifics.

I think we may have some misunderstanding about how
`completing-read-multiple' works. You do not have to select multiple
keys there. `completing-read-multiple' allows entering a single citation
key. By default `completing-read-multiple' simply allows you entering
key1, key2, key3 for multiple keys or just key1 for one.
In such scenario, the problem you described is not a problem - you may
always enter a single key1 if you wish to.

> Converting `org-cite-basic--complete-key' to `completing-read-multiple',
> preferrably by default looks like a sweet solution? But I'm not sure
> since that may breaks some people's workflows.

That's what I am leaning to - modifying oc-basic.el rather than oc.el
itself.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Ihor Radchenko
Daan Ro  writes:

>> How does \cites have anything to do with interactive selection of
>> multiple citations at once?
>
> An analogy, especially when exporting. Single selection of a citation
> -> \cite, multiple selections -> \cites.

This is a strange analogy. It is extremely common to cite multiple
references via \cite{ref1, ref2, ...}.

>> That's what I am leaning to - modifying oc-basic.el rather than oc.el
>> itself.
>
> Thank you, I think the CRM approach is even simpler than the current
> prompt-building one. But do we keep the latter?

Yes, of course. Not keeping it would be a breaking change.
Instead, we should make the completion function customizeable.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Daan Ro
> How does \cites have anything to do with interactive selection of
> multiple citations at once?

An analogy, especially when exporting. Single selection of a citation
-> \cite, multiple selections -> \cites.

> That's what I am leaning to - modifying oc-basic.el rather than oc.el
> itself.

Thank you, I think the CRM approach is even simpler than the current
prompt-building one. But do we keep the latter?

Daanturo

On Mar 15 2025, at 4:02 pm, Ihor Radchenko  wrote:
> Daan Ro  writes:
>
> >> > In Latex, \cite is also more commonly used and more asked/documented
> >> > compared to \cites. I think org-cite's decision to make inserting
> >> > citation(s) multiple by default an odd choice.
> >
> >> May you elaborate? Are you talking about auctex?
> > \cites is just rarely used IIRC. A DDG search for "latex \cites" return
> > only a single results on tex.stackexchange.com asking about the
> > differences of \cite and \cites, all the other ones only mention \cite.
> > On https://www.overleaf.com/learn \cites isn't documented at all while
> > \cite is abundantly mentioned.
>
> Sorry, but I am lost.
> How does \cites have anything to do with interactive selection of
> multiple citations at once?
>
> > Yes looks like only `org-cite-basic--complete-key' supports inserting
> > citations among org-cite's built-in processors, but it is also about
> > `org-cite-make-insert-processor' producing a lambda that always asks for
> > multiple citations from the 'select-key' function in its last case.
>
> It feels wrong to try solving UI problems on oc.el level. oc.el has no
> relation to UI specifics.
>
> I think we may have some misunderstanding about how
> `completing-read-multiple' works. You do not have to select multiple
> keys there. `completing-read-multiple' allows entering a single citation
> key. By default `completing-read-multiple' simply allows you entering
> key1, key2, key3 for multiple keys or just key1 for one.
> In such scenario, the problem you described is not a problem - you may
> always enter a single key1 if you wish to.
>
> > Converting `org-cite-basic--complete-key' to `completing-read-multiple',
> > preferrably by default looks like a sweet solution? But I'm not sure
> > since that may breaks some people's workflows.
>
> That's what I am leaning to - modifying oc-basic.el rather than oc.el
> itself.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>



0001-org-cite-basic-complete-key-use-completing-read-multiple.patch
Description: Binary data


Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-15 Thread Ihor Radchenko
Daan Ro  writes:

> I've just recalled a limitation of CRM while testing: the separator must
> not be part of the completion candidate strings. "," and ";" are common
> in the authors field, other punctuations may appear in article names,
> too. Perhaps that's reason CRM wasn't used by oc-basic.el in the first
> place?

We can use something like ;; as a separator or even compute it
dynamically depending on the actual completion candidates (; if no
candidates contain ;, ;;, ;;;, etc)

I cannot find anything in the archives about using
completing-read-multiple in citations.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-log-reschedule does not respect LOGGING property as advertised

2025-03-15 Thread Ihor Radchenko
Aaron Zeng  writes:

> org-log-reschedule's docstring says that the org-schedule and
> org-agenda-schedule commands respect the LOGGING property for a
> subtree, but the behavior I observe seems to indicate the LOGGING
> property has in fact no effect.
>
> ## Reproduction steps
> ...

Confirmed.
Not urgent.
Same for org-log-redeadline.

The attached diff is showing what should potentially be done, except
that `org-local-logging' is not called from org-schedule/deadline, and
does not work unless the user changes a todo state in the buffer.

The general design of this feature is prone to bugs because it is
juggling dynamic state.  I have a rewrite of this logic on refactor
branch. May better look after that one is finalized.

diff --git a/lisp/org.el b/lisp/org.el
index bc61a7c462..1ab86e961f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10057,12 +10057,13 @@ (defun org-local-logging (value)
   ;; Directly set the variables, they are already local.
   (setq org-log-done nil
 org-log-repeat nil
-org-todo-log-states nil)
+org-todo-log-states nil
+org-log-reschedule nil)
   (dolist (w (split-string value))
 (let (a)
   (cond
((setq a (assoc w org-startup-options))
-(and (member (nth 1 a) '(org-log-done org-log-repeat))
+(and (member (nth 1 a) '(org-log-done org-log-repeat org-log-reschedule))
  (set (nth 1 a) (nth 2 a
((setq a (org-extract-log-state-settings w))
 (and (member (car a) org-todo-keywords-1)

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: [BUG] org-persist--refresh-gc-lock now showing up after update to 30.1 [9.7.24 (9.7.24-7fa7a5 @ /Users/cchoi/.config/emacs/elpa/org-9.7.24/)]

2025-03-15 Thread Ihor Radchenko
Charles Choi  writes:

> After updating to Emacs 30.1, I now see the error message in *Messages*
>
> Error running timer ‘org-persist--refresh-gc-lock’: (wrong-type-argument
> listp \...)
>
>
> So far running Org seems nominal, but thought I'd report this error
> message anyways.

Sounds like a duplicate of https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75209

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG] Unable to use Completions buffer with org-goto-interface set to outline-path-completion [9.7.25 (9.7.25-bdf9f94 @ /home/martin/emacs-work/elpa/org-9.7.25/)]

2025-03-15 Thread Martin Marshall
Hello, I'm noticing a problem with the `org-goto` command when used with
`org-goto-interface` set to `outline-path-completion`.

I use the standard "*Completions*" buffer for completion, so I would
like to leave the setting of `org-outline-path-complete-in-steps` at its
default (t).

But I've found that I'm unable to complete with `org-goto` if I select
an item in the Completions buffer.  This is because as soon as I
select a heading in the Completions buffer, the text that I entered
in the minibuffer is duplicated, so the Completion doesn't match.

Steps to reproduce:
1. Start Emacs with "emacs -Q"
2. In the scratch buffer, evaluate:
   (setopt org-goto-interface 'outline-path-completion)
3. Open an Org-mode file that has multiple headings with the same
   starting character(s).
4. Enter "C-c C-j" to invoke `org-goto`
5. Enter some text that matches multiple headings, and press "TAB"
6. Attempt to complete from the Completions buffer with "M-"
7. Notice that as soon as you highlight any of the headings listed in
   the Completions buffer, the text you typed in the minibuffer
   appears twice.

For example, if you type "Emacs", press TAB and attempt to select the
heading "Emacs Usage" in the Completions buffer by pressing
"M-", the text after the minibuffer prompt will be
"EmacsEmacs Usage", which doesn't match any headings.

You will not be able to complete without manually deleting the
duplicated text.

With warm regards and gratitude,
Martin Marshall





Emacs  : GNU Emacs 30.1 (build 2, x86_64-pc-linux-gnu, X toolkit,
cairo version 1.16.0, Xaw3d scroll bars)
 of 2025-02-27, modified by Debian
Package: Org mode version 9.7.25 (9.7.25-bdf9f94 @
/home/martin/emacs-work/elpa/org-9.7.25/)

current state:
==
(setq
 org-special-ctrl-a/e '(reversed . t)
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-log-into-drawer t
 org-list-demote-modify-bullet '(("-" . "+") ("+" . "*") ("*" . "-")
("a." . "1.") ("1." . "A.") ("A." . "a.") ("a)" . "1)") ("1)" . "A)")
("A)" . "a)"))
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-log-done 'time
 org-blank-before-new-entry '((heading) (plain-list-item))
 org-mode-hook '(org-tempo-setup
 #[0
   "\305\306
 >\203\0\307\n\310\311#\210\307 \312\313#\210\307 \314\315#\210\306
 >\203,\0\307\n\316\317#\210\307\n\320\321#\210\322
 >\203>\0\307 \323\324#\210\307 \325\324#\210\326
 >\203P\0\307\n\327\317#\210\307\n\330\321#\210\331
 >\203_\0\332\311\f\333BC\334#\210\335
 >\203k\0\332\311\336\334#\210\337
 >\203w\0\332\311\340\334#\210\341\342\343\344#\207"

 [org-mouse-context-menu-function
  org-mouse-features org-mouse-map org-mode-map org-outline-regexp
 org-mouse-context-menu context-menu org-defkey [mouse-3] nil
 [mouse-3]
  org-mouse-show-context-menu [down-mouse-1] org-mouse-down-mouse
 [C-drag-mouse-1] org-mouse-move-tree [C-down-mouse-1]
 org-mouse-move-tree-start yank-link
  [S-mouse-2] org-mouse-yank-link [drag-mouse-3] move-tree
 [drag-mouse-3] [down-mouse-3] activate-stars font-lock-add-keywords
  (0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
 'prepend) t activate-bullets
  (("^[ ]*\\([-+*]\\|[0-9]+[.)]\\) +" (1 `(face org-link
 keymap ,org-mouse-map mouse-face highlight) 'prepend)))
 activate-checkboxes
  (("^[ ]*\\(?:[-+*]\\|[0-9]+[.)]\\)[
 ]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][   ]*\\)?\\(\\[[- X]\\]\\)"
(1 `(face nil keymap ,org-mouse-map mouse-face highlight)
 prepend))
   )
  advice-add org-open-at-point :around org--mouse-open-at-point] 4]
 #[0 "\300\301\302\303\304$\207" [add-hook
  change-major-mode-hook org-fold-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook
  change-major-mode-hook org-babel-show-result-all append local] 5]
  org-babel-result-hide-spec
 org-babel-hide-all-hashes variable-pitch-mode
abbrev-mode flyspell-mode)
 org-hide-emphasis-markers t
 org-use-speed-commands t
 org-support-shift-select 'always
 org-refile-targets '((org-agenda-files :maxlevel . 2))
 org-confirm-shell-link-function 'yes-or-no-p
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-special-ctrl-k t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-occur-hook '(org-first-headline-recenter)
 org-enforce-todo-dependencies t
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 org-link-parameters '(("attachment" :follow org-attach-follow
  :complete org-attach-complete-link)
   ("id" :follow org-id-open :store
  org-id-store-link-maybe) ("eww" :follow org-eww-open :store
  org-eww-store-li