emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

org-open-at-point while on "normal" text


From: Rainer Dunker
Subject: org-open-at-point while on "normal" text
Date: Sun, 28 Jan 2024 17:35:34 +0100

Hello All,

typing C-c C-o to follow a link while point is on "normal" text instead of a 
link, this results in error "no link found"; okay.

Recently there was an Org Mode upgrade from version 9.4.4 to 9.6.6 on my 
machine, and since then, C-c C-o on "normal" text behaves differently: Instead 
of raising the no link error, it opens the "Select link to open" menu. As I 
understand, this behaviour should occur when point is on the section's 
headline, but not when it's just somewhere within the section.

I tracked this down to a changed behaviour of the org-element-at-point 
function. Suppose I have a buffer in Org Mode containing these two lines:

   * headline
   text

If I place point within the word "text" and evaluate the expression ...

(org-element-property :parent (org-element-property :parent 
(org-element-at-point)))

... this results in "(headline (:raw-value "headline" :begin 1 ...", apparently 
meaning that I just navigated the document structure tree from the text 
paragraph up to the section headline.

Doing the same test on another machine with Org Mode 9.4.4, the expression 
results in nil. And as far as I understand, this is the expected behaviour: 
Starting with (org-element-at-point) and following the chain of parent 
relations in the structure tree should not reach the headline. I found this 
explanation in both the Org Element API reference in section 1.1 ...

https://orgmode.org/worg/dev/org-element-api.html#local

... as well as in this mailing list post:

https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00226.html

I also noticed that, between these two Org Mode versions, the 
org-element-at-point function has been completely rewritten. Now my question 
is: Is the changed behaviour--and, as a consequence, also that of 
org-open-at-point--intended or rather a bug?

Regards,

Rainer Dunker



reply via email to

[Prev in Thread] Current Thread [Next in Thread]