Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get ido-mode-style completion for searching tags in Emacs?

Tags:

emacs

tags

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)))
like image 952
James Sulak Avatar asked Jan 24 '09 23:01

James Sulak


2 Answers

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))))
like image 76
scottfrazer Avatar answered Nov 15 '22 09:11

scottfrazer


To find definitions i use CEDET's command semantic-ia-fast-jump, that together with gtags from GNU Global gives proper and quick navigation through source files.

like image 20
Alex Ott Avatar answered Nov 15 '22 10:11

Alex Ott