From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Why do apropos commands match only pairs of words in a word-list pattern? Date: Mon, 11 May 2015 07:06:01 -0700 (PDT) Message-ID: References: <87pp671ygs.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1431353872 20711 80.91.229.3 (11 May 2015 14:17:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 May 2015 14:17:52 +0000 (UTC) Cc: "Emacs-Devel \(emacs-devel@gnu.org\)" To: Nicolas Richard Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 11 16:17:39 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YroWY-0005VE-9z for ged-emacs-devel@m.gmane.org; Mon, 11 May 2015 16:17:38 +0200 Original-Received: from localhost ([::1]:37781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroWX-0006yq-KC for ged-emacs-devel@m.gmane.org; Mon, 11 May 2015 10:17:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroLS-00051V-08 for emacs-devel@gnu.org; Mon, 11 May 2015 10:06:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YroLL-0008Sn-79 for emacs-devel@gnu.org; Mon, 11 May 2015 10:06:09 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:35507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroLK-0008Sf-Ms for emacs-devel@gnu.org; Mon, 11 May 2015 10:06:03 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t4BE61mU003696 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 May 2015 14:06:02 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t4BE61nV002301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 11 May 2015 14:06:01 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t4BE61L6013960; Mon, 11 May 2015 14:06:01 GMT In-Reply-To: <87pp671ygs.fsf@yahoo.fr> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186401 Archived-At: > > Instead of matching each word in the list you provide it, apropos > > commands match each pair of words from the list. >=20 > > Why is this the design? Wouldn't users more typically want *each* > > of the words they type to be matched? >=20 > My own experience is that I both sometimes liked and sometimes hated > the behaviour. Often the latter, though. I think it would be nice to > sort by relevance (e.g. the number of words that matched). How > easy/difficult would that be ? That's not the answer, IMO. Better is to give users control over the behavior. A user option is one approach. (I've done that in my library `apu.el': `apu-match-word-pairs-only-flag',= =20 http://www.emacswiki.org/emacs/download/apu.el). Another possibility is to have an option to define the default behavior, but to let users decide immediately which behavior to get when they use the command. That is the approach taken by apropos commands for DO-ALL. That's the way to go, I think. It's not just about ordering things. Order is a separate choice axis, and yes, users should be able to order the output in different ways. But simply always combining the two matching approaches mentioned, and relegating the "looser" pair-matching candidates to the end of the buffer is not a good design. (IMHO.) But I would still like to hear from someone who gives a good reason for the current design. You've said that you sometimes like it, but that doesn't tell why. And why pairs and not triplets or...? My guess so far is that this is just historical - a vestige of the fact that apropos was implemented to use a regexp, so we cobbled together a regexp that, while not doing what one would expect for keyword matching, at least covers all of the true positives, even if it also throws in a lot of false positives. But I would like to hear arguments of why this is TRT for apropos.