在Emacs中搜索标签可以获得ido模式样式的完成吗? [英] Can I get ido-mode-style completion for searching tags in Emacs?

查看:116
本文介绍了在Emacs中搜索标签可以获得ido模式样式的完成吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用ido模式完成来查找TAGS文件中的定义吗?我怀疑自己完成阅读是答案的一部分。这是我的非工作代码,它显示了一个未填充的ido模式的微型缓冲区:

Is it possible to use ido-mode completion to find definitions in a TAGS file? I suspect that ido-completing-read is part of the answer. Here's my non-working code, which shows an unpopulated ido-mode minibuffer:

(defun ido-choose-from-tags ()
  "Use ido to select tags "
  (interactive)
    (etags-tags-apropos
     (ido-completing-read "Tags: "  nil t)))


推荐答案

这种效率低下,但是怎么样:

Kind of inefficient, but how about:

(defun my-ido-find-tag ()
  "Find a tag using ido"
  (interactive)
  (tags-completion-table)
  (let (tag-names)
    (mapc (lambda (x)
            (unless (integerp x)
              (push (prin1-to-string x t) tag-names)))
          tags-completion-table)
    (find-tag (ido-completing-read "Tag: " tag-names))))

这篇关于在Emacs中搜索标签可以获得ido模式样式的完成吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆