From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Ignoring entries starting with space Date: Thu, 25 Jun 2009 23:45:16 +0300 Organization: JURTA Message-ID: <87fxdot5cl.fsf@mail.jurta.org> References: <873a9p5ls2.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245962839 9321 80.91.229.12 (25 Jun 2009 20:47:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2009 20:47:19 +0000 (UTC) Cc: Francesc Rocher , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 25 22:47:12 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 1MJvqh-0003CO-H9 for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2009 22:47:12 +0200 Original-Received: from localhost ([127.0.0.1]:37352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJvqg-00027H-Op for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2009 16:47:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJvqb-000272-1K for emacs-devel@gnu.org; Thu, 25 Jun 2009 16:47:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJvqV-00026l-PP for emacs-devel@gnu.org; Thu, 25 Jun 2009 16:47:04 -0400 Original-Received: from [199.232.76.173] (port=38651 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJvqV-00026i-MF for emacs-devel@gnu.org; Thu, 25 Jun 2009 16:46:59 -0400 Original-Received: from smtp-out3.starman.ee ([85.253.0.5]:54588 helo=smtp-gw1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJvqV-0007wN-2B for emacs-devel@gnu.org; Thu, 25 Jun 2009 16:46:59 -0400 Original-Received: from mx1.starman.ee (mx1.starman.ee [62.65.192.16]) by smtp-gw1.starman.ee (Postfix) with ESMTP id 0F697A21500; Thu, 25 Jun 2009 23:47:10 +0300 (EEST) X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.54.75.cable.starman.ee [82.131.54.75]) by mx1.starman.ee (Postfix) with ESMTP id 492743F4048; Thu, 25 Jun 2009 23:46:50 +0300 (EEST) In-Reply-To: (Stefan Monnier's message of "Thu, 25 Jun 2009 14:44:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:111730 Archived-At: > Most minibuffer input is not commands but just "data" (e.g. file names). > So maybe, you should write something more specific that only applies to > those cases where the input takes the form of a (shell) command. > > Having a blanket "throw away anything startign with a space for any > minibufffer input" sounds a bit too radical to me. After all, bash only > applies this rule to the history of commands, doesn't it? This feature is useful not only for commands, but also for other minibuffer history variables. I use the minibuffer history lists as "bookmarks" saved in .emacs.desktop to keep most often used items (shell/compile/grep commands and Emacs commands, file and directory names, search and replace strings) that can be quickly retrieved via minibuffer history search commands. However, this have one problem: history lists become polluted with one-off items that are unlikely to be reused later. So periodically I have to purge manually the history lists using a special command `delete-history-element' (http://thread.gmane.org/gmane.emacs.devel/24353/focus=25269). But this cleaning takes too much time. Much better would be to have a special feature to not add undesirable items to the history at all. I am not saying that a leading space is the best way to do this. For example, I use C-RET to quit Isearch without adding the search string to the search ring: (define-key isearch-mode-map [(control return)] 'isearch-exit) (add-hook 'isearch-mode-end-hook (lambda () ;; On typing C-RET (when (eq last-input-char 'C-return) ;; Don't add the search string to the search ring (if isearch-regexp (setq regexp-search-ring (cdr regexp-search-ring)) (setq search-ring (cdr search-ring)))))) So maybe a configurable key like C-RET, M-RET or S-RET could exit the minibuffer without adding the minibuffer contents to the history as an alternative to the leading space if typing a space character poses a problem with completion or with file names. -- Juri Linkov http://www.jurta.org/emacs/