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: Ignoring entries starting with space Date: Fri, 26 Jun 2009 12:02:02 -0700 Message-ID: <66B58375ED1A4CE39F35EBFAC4E617B9@us.oracle.com> References: <873a9p5ls2.fsf@mail.jurta.org><87fxdot5cl.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1246042951 18391 80.91.229.12 (26 Jun 2009 19:02:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jun 2009 19:02:31 +0000 (UTC) Cc: 'Juri Linkov' , 'Stefan Monnier' , emacs-devel@gnu.org To: "'Francesc Rocher'" , "'Lennart Borgman'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 26 21:02:23 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MKGgp-00056S-51 for ged-emacs-devel@m.gmane.org; Fri, 26 Jun 2009 21:02:23 +0200 Original-Received: from localhost ([127.0.0.1]:51999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKGgo-0004u9-Ig for ged-emacs-devel@m.gmane.org; Fri, 26 Jun 2009 15:02:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKGgj-0004u3-Kw for emacs-devel@gnu.org; Fri, 26 Jun 2009 15:02:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKGge-0004s6-3F for emacs-devel@gnu.org; Fri, 26 Jun 2009 15:02:16 -0400 Original-Received: from [199.232.76.173] (port=46607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKGge-0004rx-0F for emacs-devel@gnu.org; Fri, 26 Jun 2009 15:02:12 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:51839 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MKGgd-0001t9-Dl for emacs-devel@gnu.org; Fri, 26 Jun 2009 15:02:11 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n5QJ3Liw020431 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Jun 2009 19:03:23 GMT Original-Received: from abhmt009.oracle.com (abhmt009.oracle.com [141.146.116.18]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n5QJ2Dcp021399; Fri, 26 Jun 2009 19:02:13 GMT Original-Received: from dradamslap1 (/141.144.81.142) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Jun 2009 12:02:04 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acn2i6JDEMql8vHdSUOI3R4h6+eQYgAAPbYw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt009.oracle.com [141.146.116.18] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010204.4A451B2E.013A:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111752 Archived-At: It is better not to have the key that does this also exit the minibuffer. That is, it is better to have exiting be independent of this. There can be multiple ways to exit, including, with customization, multiple keys for exiting in different ways. This action is logically independent from exiting, and it should be kept independent, so that you can combine it with any possible exit behavior. My own preference for this kind of thing is to have a user option, say `save-input-in-history-flag', and then to have a simple command to toggle it, bound in a minibuffer keymap. That is, just this: (defcustom save-input-in-history-flag t "Non-nil means save minibuffer input in a history variable." :type 'boolean :group 'whatever) (defun toggle-save-input-in-history () (interactive) (setq save-input-in-history-flag (not save-input-in-history-flag))) Code can also bind the variable, to change behavior locally. The key binding for such a command need not be one that is particularly easy/quick or repeatable. This is not something that you will do very often or something that you will repeat multiple times. A key with prefix `C-x' would be fine for this. A design question is whether this action should affect only the current minibuffer input or also subsequent inputting. I would keep it simple and do as described above: a simple toggle, which affects the global state. In that case, for a one-off you would need to toggle twice. Another possibility that I'd favor is to use not a boolean flag but a regexp, to be matched against the input that is returned. If it matches, then the input is not saved. The advantage of this approach is that a command could bind the variable to a particular regexp (e.g. that matches a whitespace prefix), to save all inputs except those that match (e.g. start with a space). This approach gives the command additional control. A toggle could still work with a regexp-valued option. Turning such filtering off could be done with a nil value or a regexp that matches everything. To turn it back on, we would need to have saved the last non-match-everything value.