From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stephan Stahl Newsgroups: gmane.emacs.devel Subject: Default value in previous-matching-history-element Date: 29 May 2004 03:13:37 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87k6yw827y.fsf@eos.franken.de> References: <44068.217.194.34.123.1085657656.squirrel@wwws.franken.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085809686 1541 80.91.224.253 (29 May 2004 05:48:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 29 May 2004 05:48:06 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 29 07:47:59 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTwhL-0000wf-00 for ; Sat, 29 May 2004 07:47:59 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTwhL-0004Le-00 for ; Sat, 29 May 2004 07:47:59 +0200 Original-Received: from [127.0.0.1] (helo=mailman.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTwhP-0005FF-JX for emacs-devel@quimby.gnus.org; Sat, 29 May 2004 01:48:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BTwh3-00056x-NU for emacs-devel@gnu.org; Sat, 29 May 2004 01:47:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BTwh1-000566-Vc for emacs-devel@gnu.org; Sat, 29 May 2004 01:47:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTwh1-000561-Nj for emacs-devel@gnu.org; Sat, 29 May 2004 01:47:39 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BTw3W-0001bW-R5 for emacs-devel@gnu.org; Sat, 29 May 2004 01:06:56 -0400 Original-Received: from [193.175.24.27] (helo=ilsa.franken.de) by mx20.gnu.org with esmtp (Exim 4.34) id 1BTscL-0006UN-RG for emacs-devel@gnu.org; Fri, 28 May 2004 21:26:34 -0400 Original-Received: from router (eos.franken.de [194.95.226.87]) by ilsa.franken.de (Postfix) with ESMTP id 9C789245C5 for ; Sat, 29 May 2004 03:11:02 +0200 (CEST) Original-To: emacs-devel@gnu.org In-Reply-To: <44068.217.194.34.123.1085657656.squirrel@wwws.franken.de> Original-Lines: 57 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24138 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24138 Hi. ----- I'm sorry. I have sent a message about this without a subject so i suppose no one read the first one.. I have changed the patch a little bit since the time. ----- Since i learned that M-n while doing completing-read and friends brings up the default value and lets you edit it, i used that feature very often. However it does not work in previous-matching-history-element (M-r while the minibuffer is active). The following very simple patch will do the trick.. Maybe someone wants to include that in emacs. *** simple.1.645.el Sat May 29 02:47:35 2004 --- simple.new.el Sat May 29 02:47:15 2004 *************** *** 949,963 **** See also `minibuffer-history-case-insensitive-variables'." (interactive (let* ((enable-recursive-minibuffers t) (regexp (read-from-minibuffer "Previous element matching (regexp): " nil minibuffer-local-map nil ! 'minibuffer-history-search-history))) ;; Use the last regexp specified, by default, if input is empty. (list (if (string= regexp "") (if minibuffer-history-search-history ! (car minibuffer-history-search-history) (error "No previous history search regexp")) regexp) (prefix-numeric-value current-prefix-arg)))) --- 949,965 ---- See also `minibuffer-history-case-insensitive-variables'." (interactive (let* ((enable-recursive-minibuffers t) + (default (car minibuffer-history-search-history)) (regexp (read-from-minibuffer "Previous element matching (regexp): " nil minibuffer-local-map nil ! 'minibuffer-history-search-history ! default))) ;; Use the last regexp specified, by default, if input is empty. (list (if (string= regexp "") (if minibuffer-history-search-history ! default (error "No previous history search regexp")) regexp) (prefix-numeric-value current-prefix-arg)))) -- Stephan Stahl