emacs - 在 Emacs 中自动跳转到标签

标签 emacs ctags etag

我想要 find-tag自动接受默认选项(即点的词)并在没有提示的情况下跳转到标签位置。

这可能吗?

我还使用了 Emacswiki 中推荐的 find-tag 版本,在匹配的情况下会重新运行 ctags。所以我想要这样的东西:

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

谢谢!

最佳答案

这是 Google 上“查找标签 emacs 无提示”的热门搜索词之一。对于简单版本 - 没有海报提到的 ctag-regeneration 逻辑 - 似乎关键是:

(find-tag (find-tag-default))

所以,对我来说,这有效:
(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)

关于emacs - 在 Emacs 中自动跳转到标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12074897/

相关文章:

node.js - 如何使用 Express.js 返回 304 Unmodified 状态?

ubuntu - emacs 中的交换控制和大写锁定键,操作系统 : ubuntu 14. 04

python - 如何突出显示 Emacs 中未使用的 Python 模块

Vim:设置 ctag 很困难。子目录中的源代码在项目根目录中看不到标签文件

c++ - 如何为其他目录中的所有 C++ 文件生成标签文件?

nginx - 当使用从上游返回的 etag 时禁用 gzip

retrofit - 在 okhttp 中,我想处理 Last-Modified 和 ETags,但不缓存整个响应

emacs - 如何检查缓冲区是否为空?

emacs - 史莱姆检查员评估 : how to get bindings in the inspector?

vim - .cu (CUDA) 文件的 ctags+taglist