People often recommend on emacs.stackexchange.com
and stackoverflow.com
(in the Emacs tag) that we should learn to "ask Emacs". The built-in Info-mode
is not capable of performing a recursive regexp
search that can compete with the likes of grep
.
Q: How can I recursively grep the Emacs manual (i.e., all .info
files) with a regexp search?
[Keep in mind that some .info
files may be gzipped, whereas others will be unzipped. This largely depends upon the install options specified at the time Emacs is built from source.]
In a related thread on reddit.com
, @kaushalmodi made an excellent suggestion to use the ag
(aka The Silver Searcher) command-line utility in conjunction with the counsel
/ ivy
/ swiper
packages, and the following function was provided by said author:
(defun counsel-ag-emacs-info (&optional initial-input)
"Search for a pattern in emacs 'info/' directory using ag.
INITIAL-INPUT can be given as the initial minibuffer input."
(interactive)
(counsel-ag initial-input (car Info-default-directory-list)
" -z" "Search emacs/elisp info"))