From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jpw@pobox.com (John Paul Wallington) Newsgroups: gmane.emacs.devel Subject: New `read-buffer-completion-ignore-case' variable? [was Re: Release plans] Date: Thu, 31 Jul 2008 01:56:44 +0100 Message-ID: References: <87r69wcxn7.fsf@stupidchicken.com> <87prp7vo3k.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217379453 19713 80.91.229.12 (30 Jul 2008 00:57:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2008 00:57:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 30 02:58:22 2008 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 1KO01F-0000iR-RH for ged-emacs-devel@m.gmane.org; Wed, 30 Jul 2008 02:58:22 +0200 Original-Received: from localhost ([127.0.0.1]:47850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KO00L-0005hv-KI for ged-emacs-devel@m.gmane.org; Tue, 29 Jul 2008 20:57:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KO00H-0005hT-Et for emacs-devel@gnu.org; Tue, 29 Jul 2008 20:57:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KO00G-0005hE-TO for emacs-devel@gnu.org; Tue, 29 Jul 2008 20:57:21 -0400 Original-Received: from [199.232.76.173] (port=41959 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KO00G-0005hB-Pe for emacs-devel@gnu.org; Tue, 29 Jul 2008 20:57:20 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:41454 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KO00F-000538-RG for emacs-devel@gnu.org; Tue, 29 Jul 2008 20:57:20 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 145E44B91A; Tue, 29 Jul 2008 20:57:03 -0400 (EDT) Original-Received: from FILTH (host86-137-21-209.range86-137.btcentralplus.com [86.137.21.209]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 5599E4B919; Tue, 29 Jul 2008 20:57:01 -0400 (EDT) Original-Received: from localhost (HELO FILTH.SHOOTYBANGBANG.COM) [127.0.0.1] by FILTH (192.168.1.64) with ESMTP (Classic Hamster Vr. 2.1 Build 2.1.0.11) ; Thu, 31 Jul 2008 01:56:44 +0100 X-URL: http://www.shootybangbang.com/ X-Attribution: JPW In-Reply-To: <87prp7vo3k.fsf@stupidchicken.com> (Chong Yidong's message of "Mon\, 21 Jul 2008 00\:49\:03 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (windows-nt) X-Pobox-Relay-ID: 6C3118FE-5DD2-11DD-B524-CE28B26B55AE-02562057!a-sasl-fastnet.pobox.com X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) 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:101727 Archived-At: Chong Yidong writes: >> Just a reminder: we will begin the feature freeze for Emacs 23.1 at the >> end of this month. > > If anyone on this list has a patch that is still waiting for approval or > further comments, now would be a good time to ping. Rats. I wish I had noticed this earlier:- I'm just catching up with my emacs-devel backlog. How about this patch? I've been running with it for awhile. Maybe the default value should be t for Windows systems? 2008-07-30 John Paul Wallington * minibuf.c (read_buffer_completion_ignore_case): New variable. (syms_of_minibuf): Declare and initialise it. (Fread_buffer): Bind `completion-ignore-case' to respect it. Index: src/minibuf.c =================================================================== RCS file: /sources/emacs/emacs/src/minibuf.c,v retrieving revision 1.354 diff -u -r1.354 minibuf.c --- src/minibuf.c 10 Jun 2008 18:41:01 -0000 1.354 +++ src/minibuf.c 30 Jul 2008 00:34:44 -0000 @@ -109,6 +109,9 @@ /* Function to call to read a buffer name. */ Lisp_Object Vread_buffer_function; +/* Nonzero means completion ignores case when reading buffer name. */ +int read_buffer_completion_ignore_case; + /* Nonzero means completion ignores case. */ int completion_ignore_case; @@ -1178,17 +1181,25 @@ If DEF is a list of default values, return its first element. If optional third arg REQUIRE-MATCH is non-nil, only existing buffer names are allowed. -The argument PROMPT should be a string ending with a colon and a space. */) +The argument PROMPT should be a string ending with a colon and a space. + +See also `read-buffer-completion-ignore-case' and `read-buffer-function'. */) (prompt, def, require_match) Lisp_Object prompt, def, require_match; { Lisp_Object args[4]; + Lisp_Object tem; unsigned char *s; int len; + int count = SPECPDL_INDEX (); + if (BUFFERP (def)) def = XBUFFER (def)->name; - + + specbind (Qcompletion_ignore_case, + read_buffer_completion_ignore_case ? Qt : Qnil); + if (NILP (Vread_buffer_function)) { if (!NILP (def)) @@ -1218,9 +1229,9 @@ prompt = Fformat (3, args); } - return Fcompleting_read (prompt, intern ("internal-complete-buffer"), - Qnil, require_match, Qnil, Qbuffer_name_history, - def, Qnil); + tem = Fcompleting_read (prompt, intern ("internal-complete-buffer"), + Qnil, require_match, Qnil, Qbuffer_name_history, + def, Qnil); } else { @@ -1228,8 +1239,9 @@ args[1] = prompt; args[2] = def; args[3] = require_match; - return Ffuncall(4, args); + tem = Ffuncall(4, args); } + return unbind_to (count, tem); } static Lisp_Object @@ -2111,6 +2123,10 @@ doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); Vread_buffer_function = Qnil; + DEFVAR_BOOL ("read-buffer-completion-ignore-case", &read_buffer_completion_ignore_case, + doc: /* *Non-nil means when reading a buffer name completion ignores case. */); + read_buffer_completion_ignore_case = 0; + DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, doc: /* Normal hook run just after entry to minibuffer. */); Vminibuffer_setup_hook = Qnil;