emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [BUG] C-c C-o on headline evaluates source code blocks with links in


From: Ignacio Casso
Subject: Re: [BUG] C-c C-o on headline evaluates source code blocks with links inside [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)]
Date: Thu, 24 Mar 2022 09:02:09 +0100
User-agent: mu4e 1.6.10; emacs 27.2

> The following patch should fix it:
>
> [4. patch --- text/x-diff; 0001-fixed-bug.patch]
> From bc5092fdef512280b7d7d3aa04f1ba887360a759 Mon Sep 17 00:00:00 2001
> From: Ignacio <ignacio.decasso@imdea.org>
> Date: Thu, 24 Mar 2022 01:15:44 +0100
> Subject: [PATCH] fixed bug
>
> ---
>  lisp/org/org.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/org/org.el b/lisp/org/org.el
> index 67c8f1cedf..0fff28af81 100644
> --- a/lisp/org/org.el
> +++ b/lisp/org/org.el
> @@ -9063,7 +9063,8 @@ org-offer-links-in-entry
>        (org-back-to-heading t)
>        (setq end (save-excursion (outline-next-heading) (point)))
>        (while (re-search-forward org-link-any-re end t)
> -        (push (match-string 0) links))
> +           (when (eq (org-element-type (org-element-context)) 'link)
> +          (push (match-string 0) links)))
>        (setq links (org-uniquify (reverse links))))
>         (cond
>       ((null links)

Actually, this fix would suffer from the same problem as the fix for the
issue of org-agenda recognizing timestamps inside source code blocks,
and now links inside property drawers would no longer be opened using
C-c C-o with point on the headline.

So if we want to preserve that behavior the new lines should probably
be

 (when (memq (org-element-type (org-element-context)) '(link node-property))
   (push (match-string 0) links))

or something like that, with probably more element types in the list
beside link and node-property.



reply via email to

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