From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Default via M-n for M-x occur Date: 09 Jul 2004 18:09:52 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <3769.217.194.34.123.1089300821.squirrel@wwws.franken.de> <87acyas80r.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1089389429 29279 80.91.224.253 (9 Jul 2004 16:10:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Jul 2004 16:10:29 +0000 (UTC) Cc: Juri Linkov , stahl@eos.franken.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jul 09 18:10:23 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 1Bixx9-0000jY-00 for ; Fri, 09 Jul 2004 18:10:23 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bixx8-0004Si-00 for ; Fri, 09 Jul 2004 18:10:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BixzJ-0007Wq-J6 for emacs-devel@quimby.gnus.org; Fri, 09 Jul 2004 12:12:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BixzC-0007Wk-40 for emacs-devel@gnu.org; Fri, 09 Jul 2004 12:12:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BixzB-0007WY-L3 for emacs-devel@gnu.org; Fri, 09 Jul 2004 12:12:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BixzB-0007WV-IX for emacs-devel@gnu.org; Fri, 09 Jul 2004 12:12:29 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bixwo-0003Y6-GE for emacs-devel@gnu.org; Fri, 09 Jul 2004 12:10:02 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Bixwg-00030G-Gg; Fri, 09 Jul 2004 12:09:55 -0400 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 58 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25559 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25559 Richard Stallman writes: > Currently `occur-read-primary-args' sets the default value to the > last element of the regexp history. But the whole history list is > available by M-p. It makes no sense to duplicate the last history > element as a default value available by M-n. > > Since it does have a default, that default should (for consistency) > be available through M-n. > > What I have in mind is this change. > > *************** > *** 757,776 **** > (nreverse result)))) > > (defun occur-read-primary-args () > ! (list (let* ((default (car regexp-history)) > ! (input > ! (read-from-minibuffer > ! (if default > ! (format "List lines matching regexp (default `%s'): " > ! default) > ! "List lines matching regexp: ") > ! nil > ! nil > ! nil > ! 'regexp-history))) > ! (if (equal input "") > ! default > ! input)) > (when current-prefix-arg > (prefix-numeric-value current-prefix-arg)))) > > --- 776,792 ---- > (nreverse result)))) > > (defun occur-read-primary-args () > ! (list (let ((default (car regexp-history))) > ! (read-from-minibuffer > ! (if default > ! (format "List lines matching regexp (default `%s'): " > ! default) > ! "List lines matching regexp: ") > ! nil > ! nil > ! nil > ! 'regexp-history > ! default)) > (when current-prefix-arg > (prefix-numeric-value current-prefix-arg)))) It is not a good idea to mention the default in the prompt then: this will lead people to think that just typing RET would provide them with the default. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum