|
From: | Dmitry Gutov |
Subject: | bug#23179: 25.0.92; Restore `M-,' to continue etags search |
Date: | Sun, 3 Apr 2016 02:39:47 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
On 04/02/2016 09:58 AM, Eli Zaretskii wrote:
But we could have a tags-only command that presented an xref UI, I think. (Its name could be "tags-search" ;-)
Probably not tags-search; we're only deprecating some etags commands, but not removing them (yet?). And why is etags so special that it needs its own find-regexp command, but other backends don't?
Anyway, this should get you going: (defun tags-find-regexp (regexp) (interactive "sTags search (regexp): ") (let* ((files (save-excursion (let ((enable-recursive-minibuffers t)) (visit-tags-table-buffer)) (mapcar #'expand-file-name (tags-table-files)))) (xrefs (cl-mapcan (lambda (file) (xref-collect-matches regexp "*" file nil)) files))) (unless xrefs (user-error "No matches for: %s" regexp)) (xref--show-xrefs xrefs nil t)))(I don't know if calling 'find' once per file is an actual problem, but it's likely suboptimal; we'll fix that in a unified fashion later).
[Prev in Thread] | Current Thread | [Next in Thread] |