From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.bugs Subject: bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter Date: Tue, 10 Mar 2015 11:34:00 -0400 Message-ID: <54FF0EE8.5040107@gmx.com> References: <54FCCC63.5080202@gmx.com> <54FD8C77.7040208@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mJWD4dqqHEQVhEkD1prE0gUckG4QsCAd3" X-Trace: ger.gmane.org 1426002211 24609 80.91.229.3 (10 Mar 2015 15:43:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2015 15:43:31 +0000 (UTC) Cc: 20063@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 10 16:43:19 2015 Return-path: Envelope-to: geb-bug-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 1YVMJS-00015u-EL for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2015 16:43:18 +0100 Original-Received: from localhost ([::1]:49727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVMJR-0005K7-Pn for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2015 11:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVMBZ-0008Lu-5A for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2015 11:35:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVMBS-0000OX-TF for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2015 11:35:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVMBS-0000NW-R8 for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2015 11:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YVMBS-0000wh-35 for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2015 11:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boruch Baum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Mar 2015 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20063 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20063-submit@debbugs.gnu.org id=B20063.14260016973620 (code B ref 20063); Tue, 10 Mar 2015 15:35:02 +0000 Original-Received: (at 20063) by debbugs.gnu.org; 10 Mar 2015 15:34:57 +0000 Original-Received: from localhost ([127.0.0.1]:41850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVMBM-0000wK-Pi for submit@debbugs.gnu.org; Tue, 10 Mar 2015 11:34:57 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:60265) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVMBL-0000w4-00 for 20063@debbugs.gnu.org; Tue, 10 Mar 2015 11:34:55 -0400 Original-Received: from [192.168.1.9] ([96.232.130.59]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Meh8S-1Y7EgX3hJg-00OGAX; Tue, 10 Mar 2015 16:34:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: OpenPGP: url=hkp://keys.gnupg.net X-Provags-ID: V03:K0:w0qhoXIxSFLUIumKExs57qRtEjm1DRRUUHaLxm5yUE2pC+1W/xr QeVuvNpZk0VoXnIBgzbpVc4PW05kVPIRgO1Qh6W2Quo3u5j48d2TPzcSGEUPgKApMPNGrDO Av7un20McUyWxZRzOveO0w3qaYXQKLWeAmf7QCaBADNYkMNCuX7LXh8VGNaquzXYJhDG2EP /2LfeS1Ib9qZ92Y7Ilq3A== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100347 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mJWD4dqqHEQVhEkD1prE0gUckG4QsCAd3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/09/2015 02:14 PM, Stefan Monnier wrote: >> 1] From a programmer's perspective, forcing a HIST when the programmer= >> asks for COLLECTION =3D !nil and HIST =3D nil, creates a conflict when= >> parameter REQUIRE-MATCH is set to `t', because the mini-buffer will >> offer entries, from HIST, that are not in COLLECTION, and those entrie= s >> will then just be rejected due to REQUIRE-MATCH. >=20 > That is indeed a problem, but it is more general than the case of > HIST=3Dnil, since even if HIST is non-nil the history may contain entri= es > which are not valid according to COLLECTION. >=20 > So what we need to do is to filter out those entries dynamically. Yes, if you mean once, at the time the function is invoked; but the benefit of this to the end-user is very limited, and has a downside if done simply. Once REQUIRE-MATCH=3Dt, nothing but elements of COLLECTION will ever be accepted, so `concat'-ing the filtered elements of HIST would present only legitimate options, in the sequence most recently used, but with potentially a lot of duplicate entries. Using `add-to-list', starting with an empty list would avoid the duplications and present the elements in sequence most-recently-used. >> 2] From a programmer's perspective, there are four legitimate >> combinations of COLLECTION and HIST, and the current state denies a >> programmer the freedom to offer a specific COLLECTION without some >> general HIST. >=20 > Actually, IIRC a value of t for HIST I don't see that in the v24.4 documentation for `completing-read' or 'read-from-minibuffer'. Both descriptions are a bit vague, saying "... if non-nil ... It can be a symbol, which is the history list variable to use, or it can be a cons cell (HISTVAR . HISTPOS) ...". It would be clearer to change "It can be" to "Otherwise it must be either" > does provide the option of "no history". Which brings us full-circle to line 974 of `minibuf.c' --=20 hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --mJWD4dqqHEQVhEkD1prE0gUckG4QsCAd3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU/w7oAAoJEDvrUfDmCx9LNkcP/imWoM/pnTw+skNlHnxQJdi2 v8NquOe0PGD0mPCWHgNgsOYIbfmgEdUj2O4sTEeVuCUkWOFReRQNa+7C2U2m+cGF 9TsMcToFmWC7wGZ3uO2MLwQuHCyPGw7wvw0QuO2M11RuMl22g6yowLykHl56odMD IYopOklbIyUIUx3ITxuKtHk5GxM135jwoGtS3pgz4CPgbFMEapiv3y4qr+ppiZIB Dyt7Pgif2vqHxdz57fb/vb3yTQyXh3y2P9EoMV2OXzSjyGAfHhoqgPeft/Kz58pU IekRbxDqlU9atB6v+R9GZ0mjz+65658l5X2glRiyBhuCotvPvjev4UIcYy0IYf3k 4nv7lPysDYkCkmKar+8mgaVQawPNbpEIg5RwKTSVgkFuXMjZVmAkbFSqSMfyjOgo 7X93dbaZmFxmy46ME9qDdHcIlzon7Vj9sLw1x5zBWV2/vRmDguPYTFzt68SCbfTV 4XLRV1g8u+pyHnOPIwv1wTsXj44AJo/ZbMmjQNaPTDxlclNyZ8LJrqsUVlngRHNF wXmX2I/Tq98JO4kR2cmy97Ssv3dWiXx0cKLztIJC9mnioLsRDKtUcn7MdsNw8C/M jlkVTR6923NlRLA7rZVbAsdrKuyyoUKt0jGC7UMPIwZHcg4hsTjFFL9j3W3rRmkB d3vbugF8yeDkLWgrpkZs =5DiF -----END PGP SIGNATURE----- --mJWD4dqqHEQVhEkD1prE0gUckG4QsCAd3--