[BUG] org-contrib: org-eldoc has an autload, but is incompatible with modern emacs. [9.6.8 (release_9.6.8-3-g21171d @ /usr/share/emacs/30.0.50/lisp/org/)]

2023-10-19 Thread Vladimir Nikishkin
Dear Org developers,

org-contrib has the following lines 206 and 207 in org-eldoc:
#+begin_src elisp
;;;###autoload
(add-hook 'org-mode-hook #'org-eldoc-load)
#+end_src

which set up that hook automatically when the package org-contrib is
installed.

that hook is, seemingly, incompatible with the recent org-element,
and in general it seems dubious to automatically add features from a
deprecated repo.

Could those lines be removed? If someone is interested in
patching/using/maintaining that code, he can probably try to refactor it
in a better way.

(In any case, it is probably better to add such hooks in the :hook
clause of use-package.)

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)



Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Po Lu
Ihor Radchenko  writes:

> Ideally, we should ask Emacs devs to provide OS-independent interface
> for uri-list handling. I am not a big fan of adding special OS handling
> to Org mode, unless absolutely necessary.

Inasmuch as I had previously interposed myself into this conversation,
it should have been clear that its subject is of interest to me.  So
herein lies the question: why was I removed from its carbon copy list,
from nothing less than a follow-up to my reply itself?  It is common
courtesy for some advance notice to be given to a participant who is
about to be subject to such treatment; and was I not, I would have be
made aware of your plight earlier -- but I digress.

How about enabling programs to receive drops of multiple files instead?
Since not all window systems supply drops of multiple files in the form
of text/uri-lists, I account that a more robust and versatile interface.



Re: [BUG] Search leaves draws open [9.7-pre (release_9.6.10-835-gf3de4c @ ~/.emacs.d/org-mode-git/lisp/)]

2023-10-19 Thread Paul Stansell
Hello Ihor,

In the meantime, is there a command that will close all drawers, even those
that are open in sections (headings) that are closed?  I searched but
didn't find anything.

Thanks,

Paul


Re: [BUG] emacs-lisp source blocks do not implement :prologue and :epilogue [9.6.9 ( @ /home/jet/.config/emacs/elpa/org-9.6.9/)]

2023-10-19 Thread Jeff Trull
Thanks for the quick fix! If my bash one-liner is right there are another
12:

grep -L :prologue `fgrep -Rl --include=\*.el '(defun
org-babel-expand-body:' ~/.config/emacs/elpa/org-9.6.9/` | xargs -n 1
basename
ob-C.el
ob-awk.el
ob-lilypond.el
ob-sqlite.el
ob-java.el
ob-org.el
ob-calc.el
ob-latex.el
ob-dot.el
ob-fortran.el
ob-emacs-lisp.el
ob-lisp.el
ob-clojure.el


On Thu, Oct 19, 2023 at 2:04 AM Ihor Radchenko  wrote:

> Jeff Trull  writes:
>
> > The manual page "Environment of a Code Block" describes :prologue and
> > :epilogue header arguments, which are useful for applications like unit
> > tests and boilerplate code. No suggestion is made that these arguments
> > are only available for some languages.
>
> If they are not available, it is a bug.
>
> > In fact, any language that provides its own org-babel-expand-body needs
> > special code to handle these arguments - and emacs-lisp lacks it.
>
> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=936290fe1
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: [PATCH] org-fold: (org-fold-hide-drawer-all): Make interactive

2023-10-19 Thread Ivan Necas
Oh nice, thanks!

-- Ivan

On Thu, 19 Oct 2023 at 11:32, Ihor Radchenko  wrote:

> Ivan Necas  writes:
>
> > Sometimes, I want to unfold all the drawers using `org-fold-show-all',
> > and then I want to hide them all back. I've noticed, there is a function
> > `org-fold-hide-drawer-all' does just that, but it's not marked
> > as a command, so the patch is as simple as adding `(interactive)` there,
> > as I don't see a reason it shouldn't be one.
>
> Makes sense.
> I applied an alternative version of the patch onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=13353f1fa
> Handled.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: [BUG] CI jobs do not appear to be running

2023-10-19 Thread Bastien Guerry
Ihor Radchenko  writes:

> Still nothing, even though I did not address some recent
> failures, like "FAILED ob-octave/session-multiline".

I've pushed a fix, it should be okay now.

I've also updated the script which mirrors the main Org repository to
GitHub and Sourcehut, things are kept in sync every 3 hours.

-- 
 Bastien Guerry



Re: Case insensitivity of simple [[links]]

2023-10-19 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

>>> Note that there is generally no guarantee that [[name]] link will be
>>> exported as "name" by any particular backend. Your workaround with
>>> num:nil is just a workaround that may or may not work in future.
>>
>> I did not know this is considered a workaround!  I have always thought
>> this is how Org is specified to work (as in tests).

Actually, dang!  I spoke too soon.  While links now work consistently
before and after exports, their description matches the destination
heading, not the source link.  But if we case-fold now, it would make a
lot more sense to match the case of the source link, as it enables one
to link [[capitalized heading]]s.  Otherwise, we case-fold with no
significant benefits, as far as I can see.

Without also fixing this part, my problem with Org remains. :(

>> [...] call to 'org-toggle-link-display' does nothing.

> It does nothing because it is one of the options that must be set before
> Org mode is loaded. Resolving buffer-local variables happens after the
> major mode is loaded.

I have noticed that 'org-use-extra-keys', for example, is documented as
"must set it before loading Org", but there is nothing similar in the
'org-link-descriptive' docstring.  So perhaps this is a bug, not a
feature?

Upon a quick look, 'org-toggle-link-display' does exactly two things:

  1. (setq org-link-descriptive (not org-link-descriptive)) and
  2. (org-link-descriptive-ensure),

where 'org-link-descriptive-ensure' wraps exactly one expression:

  (org-fold-core-set-folding-spec-property
 (car org-link--link-folding-spec)
 :visible (not org-link-descriptive))

Could Org execute this expression after loading a document, given the
buffer-local value of 'org-link-descriptive' necessitates it?

Rudy
-- 
"It is far better to have a question that can't be answered than an answer that
can't be questioned."
--- Carl Sagan

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: Re: [FR] org-num-mode inverse defaults

2023-10-19 Thread Pedro Andres Aranda Gutierrez
Yes, very helpful. Thanks a ton!
/PA

On Thu, 19 Oct 2023 at 11:07, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > I feel the explanation in
> >
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b223a3cc7
> is
> > a bit fuzzy and may not be correctly understood by newcomers. A pointer
> to
> > a more detailed explanation could help a lot.
>
> I added reference to the manual. Is it better now?
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c77e7f9c8
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: [BUG] Search leaves draws open [9.7-pre (release_9.6.10-835-gf3de4c @ ~/.emacs.d/org-mode-git/lisp/)]

2023-10-19 Thread Ihor Radchenko
Paul Stansell  writes:

> Using Ctrl-S to search an org file leaves drawers open after the search.
> For example, open the attached org file, search_bug.org, and, with the
> cursor initially at the first line of the file, search for "text" with
> - Ctrl-s text
> This finds the first occurrence of "text" in "Subsection 1".  Then press
> Ctrl-a to go to the beginning of the line.  At this point all the drawers
> in "Subsection 1" are opened and left open.  They are not closed by
> Shift-tab visibility cycling.
>
> This doesn't happen with Org mode version 9.5.5 (release_9.5.5).

Confirmed.
This is a bit difficult to debug and may take some time.

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



Re: svg file from tikz picture

2023-10-19 Thread Ihor Radchenko
Akira Kyle  writes:

>> I've just checked and Akira's is a registered FSF contributor 
>> since
>> last may.
>
> Unfortunately I was informed that I am only allowed to make 
> "small" contributions. I wasn't given any explicit metric of what 
> qualifies as a "small" contribution, but was informed that patches 
> such as this one are okay for me to contribute.

(...after some checking with FSF off-list)
We have confirmation that the discussed patch should be OK.
Thus, we have no legal obstacles accepting the patches in this thread.

> ...
> It's been five years since I initially wrote this patch and two 
> years since I started my assignment processes so I haven't really 
> had the time or motivation to get this patch into a merge-able 
> state. I still use this code quite regularly myself so I'll 
> probably get around to working on it again and some point in the 
> future.

It has been a while since the last message in this thread.
Let us know if you are still interested to work on this patch.
In needed, we can provide help on the code or answer any questions.

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



Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Ihor Radchenko
Visuwesh  writes:

>>> Is there any particular reason why you insert a newline after the image
>>> link?
>>
>> It is for when you drop multiple files onto a frame.  AFAIU/AFAICT
>> there's no way to know beforehand if multiple files will be dropped or
>> not.  I will look into it in bit more detail in the coming days and drop
>> the newline if only one file is dropped.
>
> OK, seems like the actual handling is done by x-dnd-handle-uri-list
> where the URI list is split and each URI is handled separately.  We can
> override this function by our own by changing the entry in
> x-dnd-types-alist but we need to do the same for pgtk-dnd-types-alist
> and from what I can tell there are no such facilities for MS Windows and
> NS?  I think we need to accept that we will have sub-optimal interface
> for multi file drops.  WDYT?

Ideally, we should ask Emacs devs to provide OS-independent interface
for uri-list handling. I am not a big fan of adding special OS handling
to Org mode, unless absolutely necessary.

And the discussed _minor_ problem is not so big deal that we should
complicate the code and, more importantly, maintenance so much.

> Also, can I know what you think about using a popup-menu instead of a
> dialog box for prompting as Liu Hui suggests in
> https://yhetil.org/orgmode/caoqtw-mas6b2uh9z52ejn7ebwni+suhq9dwe0fky_rzvhox...@mail.gmail.com
> ?  If you're okay with it, I will write a function to use rmc or
> popup-menu for prompting as per what use-dialog-box-p returns.

I have no objections.

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



Re: [PATCH] org-fold: (org-fold-hide-drawer-all): Make interactive

2023-10-19 Thread Ihor Radchenko
Ivan Necas  writes:

> Sometimes, I want to unfold all the drawers using `org-fold-show-all',
> and then I want to hide them all back. I've noticed, there is a function
> `org-fold-hide-drawer-all' does just that, but it's not marked
> as a command, so the patch is as simple as adding `(interactive)` there,
> as I don't see a reason it shouldn't be one.

Makes sense.
I applied an alternative version of the patch onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=13353f1fa
Handled.

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



RE: Re: [FR] org-num-mode inverse defaults

2023-10-19 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> I feel the explanation in
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b223a3cc7 is
> a bit fuzzy and may not be correctly understood by newcomers. A pointer to
> a more detailed explanation could help a lot.

I added reference to the manual. Is it better now?
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c77e7f9c8

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



Re: [BUG] emacs-lisp source blocks do not implement :prologue and :epilogue [9.6.9 ( @ /home/jet/.config/emacs/elpa/org-9.6.9/)]

2023-10-19 Thread Ihor Radchenko
Jeff Trull  writes:

> The manual page "Environment of a Code Block" describes :prologue and
> :epilogue header arguments, which are useful for applications like unit
> tests and boilerplate code. No suggestion is made that these arguments
> are only available for some languages.

If they are not available, it is a bug.

> In fact, any language that provides its own org-babel-expand-body needs
> special code to handle these arguments - and emacs-lisp lacks it.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=936290fe1

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



Re: Incorrect quantity of en-spaces

2023-10-19 Thread Ihor Radchenko
"Tom Alexander"  writes:

>> This appears to be a special case, not documented on org-syntax page.
>
> Sounds good, thanks! 

Updated org-syntax document:
https://git.sr.ht/~bzg/worg/commit/71077014

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



Re: [BUG] CI jobs do not appear to be running

2023-10-19 Thread Ihor Radchenko
Bastien Guerry  writes:

>> https://lists.sr.ht/~bzg/org-build-failures ran the tests right after
>> ,
>> but my recent Org commits did not trigger anything.
>
> Perhaps your email was sent less than three hours after the last
> checks (I didn't check).
>
> Can you check again after the next commits?  The cron job on the
> machine is configured correctly and should run.  I'll see what's 
> wrong if it does not run.

Still nothing, even though I did not address some recent
failures, like "FAILED ob-octave/session-multiline".

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



Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Visuwesh
[திங்கள் அக்டோபர் 09, 2023] Visuwesh wrote:

> [திங்கள் அக்டோபர் 09, 2023] Ihor Radchenko wrote:
>
>> Thanks!
>>
>>> +(defun org--dnd-attach-file (url action)
>>> ...
>>> +(insert
>>> + (org-link-make-string
>>> +  (concat (if separatep
>>> +  "file:"
>>> +"attachment:")
>>> +  (if separatep
>>> +  (expand-file-name (file-name-nondirectory filename)
>>> +org-yank-image-save-type)
>>> +(file-name-nondirectory filename
>>> + "\n")
>>> +'private))
>>
>>> +(pcase org--dnd-xds-method
>>> +  (`attach (insert (org-link-make-string
>>> +(concat "attachment:" (file-name-nondirectory 
>>> filename)))
>>
>>> +  (`file-link (insert (org-link-make-string (concat "file:" filename))
>>> +  "\n"))
>>
>> Is there any particular reason why you insert a newline after the image
>> link?
>
> It is for when you drop multiple files onto a frame.  AFAIU/AFAICT
> there's no way to know beforehand if multiple files will be dropped or
> not.  I will look into it in bit more detail in the coming days and drop
> the newline if only one file is dropped.

OK, seems like the actual handling is done by x-dnd-handle-uri-list
where the URI list is split and each URI is handled separately.  We can
override this function by our own by changing the entry in
x-dnd-types-alist but we need to do the same for pgtk-dnd-types-alist
and from what I can tell there are no such facilities for MS Windows and
NS?  I think we need to accept that we will have sub-optimal interface
for multi file drops.  WDYT?

Also, can I know what you think about using a popup-menu instead of a
dialog box for prompting as Liu Hui suggests in
https://yhetil.org/orgmode/caoqtw-mas6b2uh9z52ejn7ebwni+suhq9dwe0fky_rzvhox...@mail.gmail.com
?  If you're okay with it, I will write a function to use rmc or
popup-menu for prompting as per what use-dialog-box-p returns.



RE: Re: [FR] org-num-mode inverse defaults

2023-10-19 Thread Pedro Andres Aranda Gutierrez
Hi

I feel the explanation in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b223a3cc7 is
a bit fuzzy and may not be correctly understood by newcomers. A pointer to
a more detailed explanation could help a lot.

Best, /PA

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet