I'd like to have find-tag
automatically accept the default option (i.e. the word at point) and jump to the tag postion without prompting.
Is this possible?
I'm also using the advised version of find-tag from Emacswiki, that in case of match re-runs ctags. So I'd like something like this:
is current word a known tag?
-> yes: jump to it without further confirmation
-> no: rerun ctags
is it known now?
-> yes: jump to it without further confirmation
-> no: prompt user for input
Thank you!
This is one of the top hits on Google for "find tags emacs no prompt." For the simple version of that - without the ctag-regeneration logic the poster mentioned - it seems the key is:
(find-tag (find-tag-default))
So, for me, this works:
(defun find-tag-no-prompt ()
"Jump to the tag at point without prompting"
(interactive)
(find-tag (find-tag-default)))
;; don't prompt when finding a tag
(global-set-key (kbd "M-.") 'find-tag-no-prompt)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With