* org-ctags-find-tag should not prompt inside org-open-at-point
@ 2023-09-25 4:28 Joseph Turner
2023-09-26 9:44 ` Ihor Radchenko
2023-09-28 15:59 ` Rudolf Adamkovič
0 siblings, 2 replies; 6+ messages in thread
From: Joseph Turner @ 2023-09-25 4:28 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Adam Porter
Hello!
When org-ctags-find-tag is a member of org-open-link-functions, fuzzy
links and custom-id links are broken. Instead of following those links,
Emacs prompts for a filename with "Visit tags table (default TAGS)".
To reproduce this issue with emacs -Q:
(require 'org-ctags)
Then open an org-mode buffer with the following:
--8<---------------cut here---------------start------------->8---
[[*header]]
* Header
--8<---------------cut here---------------end--------------->8---
Put point on the link and run org-open-at-point (C-c C-o).
Instead of jumping to the header, Emacs opens a prompt.
One potential solution is to avoid calling xref-find-definitions inside
org-ctags-find-tag, since xref-find-definitions prompts when there’s no
identifier at point.
I'm sure how org-ctags is getting required in my Emacs, but I think
(require 'org-ctags) probably shouldn't call org-ctags-enable.
Until this issue is fixed, a workaround for now is to set
org-ctags-open-link-functions to nil so that org-ctags-find-tag is never
added to org-open-link-functions. Add the following to init.el:
(setopt org-ctags-open-link-functions nil)
This may break some ctags functionality.
Thanks!
Joseph Turner
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-ctags-find-tag should not prompt inside org-open-at-point
2023-09-25 4:28 org-ctags-find-tag should not prompt inside org-open-at-point Joseph Turner
@ 2023-09-26 9:44 ` Ihor Radchenko
2023-09-27 1:27 ` Joseph Turner
2023-09-28 15:59 ` Rudolf Adamkovič
1 sibling, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2023-09-26 9:44 UTC (permalink / raw)
To: Joseph Turner; +Cc: emacs-orgmode, Adam Porter
Joseph Turner <joseph@breatheoutbreathe.in> writes:
> When org-ctags-find-tag is a member of org-open-link-functions, fuzzy
> links and custom-id links are broken. Instead of following those links,
> Emacs prompts for a filename with "Visit tags table (default TAGS)".
This is expected. As per org-ctags documentation:
;; By default, with org-ctags loaded, org will first try and visit the tag
;; with the same name as the link; then, if unsuccessful, ask the user if
;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
;; the user wishes to append 'tag' as a new toplevel heading at the end of
;; the buffer; and finally, defer to org's default behavior which is to
;; search the entire text of the current buffer for 'tag'.
;;
;; This behavior can be modified by changing the value of
;; ORG-CTAGS-OPEN-LINK-FUNCTIONS.
> I'm sure how org-ctags is getting required in my Emacs, but I think
> (require 'org-ctags) probably shouldn't call org-ctags-enable.
Check out
https://list.orgmode.org/orgmode/87o7omg4ie.fsf@alphaville.usersys.redhat.com/
We generally agree that (require 'org-ctags) should ideally not have
side effects, but do not want to introduce too breaking changes either.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-ctags-find-tag should not prompt inside org-open-at-point
2023-09-26 9:44 ` Ihor Radchenko
@ 2023-09-27 1:27 ` Joseph Turner
2023-10-05 13:45 ` Ihor Radchenko
0 siblings, 1 reply; 6+ messages in thread
From: Joseph Turner @ 2023-09-27 1:27 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode, Adam Porter
Ihor Radchenko <yantar92@posteo.net> writes:
> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> When org-ctags-find-tag is a member of org-open-link-functions, fuzzy
>> links and custom-id links are broken. Instead of following those links,
>> Emacs prompts for a filename with "Visit tags table (default TAGS)".
>
> This is expected. As per org-ctags documentation:
>
> ;; By default, with org-ctags loaded, org will first try and visit the tag
> ;; with the same name as the link; then, if unsuccessful, ask the user if
> ;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
> ;; the user wishes to append 'tag' as a new toplevel heading at the end of
> ;; the buffer; and finally, defer to org's default behavior which is to
> ;; search the entire text of the current buffer for 'tag'.
> ;;
> ;; This behavior can be modified by changing the value of
> ;; ORG-CTAGS-OPEN-LINK-FUNCTIONS.
>
>> I'm sure how org-ctags is getting required in my Emacs, but I think
>> (require 'org-ctags) probably shouldn't call org-ctags-enable.
>
> Check out
> https://list.orgmode.org/orgmode/87o7omg4ie.fsf@alphaville.usersys.redhat.com/
Thank you!! I'm glad to see such care taken in considering this issue!
> We generally agree that (require 'org-ctags) should ideally not have
> side effects, but do not want to introduce too breaking changes either.
Does this mean that org-ctag's disruptive behavior will be fixed?
Thanks!!
Joseph
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-ctags-find-tag should not prompt inside org-open-at-point
2023-09-25 4:28 org-ctags-find-tag should not prompt inside org-open-at-point Joseph Turner
2023-09-26 9:44 ` Ihor Radchenko
@ 2023-09-28 15:59 ` Rudolf Adamkovič
2023-09-28 19:25 ` Joseph Turner
1 sibling, 1 reply; 6+ messages in thread
From: Rudolf Adamkovič @ 2023-09-28 15:59 UTC (permalink / raw)
To: Joseph Turner, emacs-orgmode; +Cc: Adam Porter
Joseph Turner <joseph@breatheoutbreathe.in> writes:
> (setopt org-ctags-open-link-functions nil)
Oh, thank you! This regularly drives me crazy.
I added the following to my Emacs/Org configuration:
#+BEGIN_SRC emacs-lisp :results none
(eval-after-load 'org-ctags
(setq org-ctags-open-link-functions nil))
#+END_SRC
Rudy
--
"I love deadlines. I love the whooshing noise they make as they go by."
-- Douglas Adams, The Salmon of Doubt, 2002
Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-ctags-find-tag should not prompt inside org-open-at-point
2023-09-28 15:59 ` Rudolf Adamkovič
@ 2023-09-28 19:25 ` Joseph Turner
0 siblings, 0 replies; 6+ messages in thread
From: Joseph Turner @ 2023-09-28 19:25 UTC (permalink / raw)
To: Rudolf Adamkovič; +Cc: emacs-orgmode, Adam Porter
Rudolf Adamkovič <salutis@me.com> writes:
> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> (setopt org-ctags-open-link-functions nil)
>
> Oh, thank you! This regularly drives me crazy.
You're welcome!
> I added the following to my Emacs/Org configuration:
>
> #+BEGIN_SRC emacs-lisp :results none
> (eval-after-load 'org-ctags
> (setq org-ctags-open-link-functions nil))
> #+END_SRC
Yes, eval-after-load makes sense.
Joseph
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-05 13:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 4:28 org-ctags-find-tag should not prompt inside org-open-at-point Joseph Turner
2023-09-26 9:44 ` Ihor Radchenko
2023-09-27 1:27 ` Joseph Turner
2023-10-05 13:45 ` Ihor Radchenko
2023-09-28 15:59 ` Rudolf Adamkovič
2023-09-28 19:25 ` Joseph Turner
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).