[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Substring matching for info index command
From: |
Stefan Monnier |
Subject: |
Re: Substring matching for info index command |
Date: |
Sun, 07 Dec 2014 11:02:55 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> I've never used the builtin completion-styles, because I
> use other completion packages, but I thought I give it a try
> and try substring matching for the info index command.
Info should setup a "completion category" so you could configure this
via `completion-category-overrides'. Please M-x report-emacs-bug.
> I added this advice to the command which wraps it in a
> let and sets completion-styles to substring:
> (defadvice Info-index (around my-Info-index activate)
> (let ((completion-styles '(substring)))
> ad-do-it))
That affects the body of the function (i.e. the code that, given
a query, will look for the corresponding place in the index), whereas
you want to tweak the way the interactive-spec works.
You might like to try something like (guaranteed 100% untested):
(advice-add 'Info-index :before
(lambda (&rest _)
(interactive
(lambda (spec)
(let ((completion-styles '(substring)))
(advice-eval-interactive-spec spec))))
nil))
-- Stefan