From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Substring matching for info index command Date: Sun, 07 Dec 2014 11:02:55 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417968224 17776 80.91.229.3 (7 Dec 2014 16:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2014 16:03:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 07 17:03:37 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XxeJ6-0002IJ-UK for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 17:03:37 +0100 Original-Received: from localhost ([::1]:58317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxeJ6-0005kf-Cp for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 11:03:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxeIm-0005kZ-HN for help-gnu-emacs@gnu.org; Sun, 07 Dec 2014 11:03:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxeIf-00069f-1y for help-gnu-emacs@gnu.org; Sun, 07 Dec 2014 11:03:16 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:51346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxeIe-00069Q-Qs for help-gnu-emacs@gnu.org; Sun, 07 Dec 2014 11:03:08 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XxeId-000248-Mn for help-gnu-emacs@gnu.org; Sun, 07 Dec 2014 17:03:07 +0100 Original-Received: from 76-10-164-234.dsl.teksavvy.com ([76.10.164.234]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Dec 2014 17:03:07 +0100 Original-Received: from monnier by 76-10-164-234.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Dec 2014 17:03:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 76-10-164-234.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:6IAQoz05OFgQstfH2EB18ppQl2M= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101474 Archived-At: > 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