From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter Date: Wed, 11 Mar 2015 10:09:02 -0400 Message-ID: References: <54FCCC63.5080202@gmx.com> <54FD8C77.7040208@gmx.com> <54FF0EE8.5040107@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426083027 19145 80.91.229.3 (11 Mar 2015 14:10:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Mar 2015 14:10:27 +0000 (UTC) Cc: 20063@debbugs.gnu.org To: Boruch Baum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 11 15:10:14 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 1YVhKv-0007Iy-U9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Mar 2015 15:10:14 +0100 Original-Received: from localhost ([::1]:54880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhKv-00087i-80 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Mar 2015 10:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhKq-00085S-89 for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2015 10:10:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVhKl-0007uN-3O for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2015 10:10:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhKl-0007uA-0S for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2015 10:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YVhKk-0007zP-FQ for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2015 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Mar 2015 14:10: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.142608295230641 (code B ref 20063); Wed, 11 Mar 2015 14:10:02 +0000 Original-Received: (at 20063) by debbugs.gnu.org; 11 Mar 2015 14:09:12 +0000 Original-Received: from localhost ([127.0.0.1]:42876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVhJv-0007y9-MU for submit@debbugs.gnu.org; Wed, 11 Mar 2015 10:09:12 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:9190) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVhJs-0007xr-EO for 20063@debbugs.gnu.org; Wed, 11 Mar 2015 10:09:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRLd/Fx/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzAEEhQYDSSIOAjOIwEBAQEGAQEBAR6PIFgHGIQSBZR8hGOFSYpKgUUihAoigTOBQAEBAQ X-IPAS-Result: ArsTAPOG1lRLd/Fx/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzAEEhQYDSSIOAjOIwEBAQEGAQEBAR6PIFgHGIQSBZR8hGOFSYpKgUUihAoigTOBQAEBAQ X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113276498" Original-Received: from 75-119-241-113.dsl.teksavvy.com (HELO pastel.home) ([75.119.241.113]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Mar 2015 10:09:02 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 61046FEF; Wed, 11 Mar 2015 10:09:02 -0400 (EDT) In-Reply-To: <54FF0EE8.5040107@gmx.com> (Boruch Baum's message of "Tue, 10 Mar 2015 11:34:00 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:100369 Archived-At: >> That is indeed a problem, but it is more general than the case of >> HIST=nil, since even if HIST is non-nil the history may contain entries >> which are not valid according to COLLECTION. >> 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; No, I was thinking of doing it on-the-fly when navigating in the history. > but the benefit of this to the end-user is very limited, and has > a downside if done simply. If the benefit is limited, it means the problem you mention is correspondingly minor. > Once REQUIRE-MATCH=t, 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. I'm not sure exactly what you mean here, but I suspect you assume COLLECTION to be finite and small. > Using `add-to-list', starting with an empty list would avoid > the duplications and present the elements in sequence > most-recently-used. Duplicate elements in the history are yet again orthogonal. You probably want to set history-delete-duplicates to t. >> Actually, IIRC a value of t for HIST > I don't see that in the v24.4 documentation for `completing-read' or Indeed, it's not documented. It's basically a side effect of t holding a non-list value, which we've tried to make work in order for read-password to behave properly (i.e. not have history since that would be a security problem). >> does provide the option of "no history". > Which brings us full-circle to line 974 of `minibuf.c' I don't understand this, since this code checks for a nil value, not a t value. Stefan