From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Paul Wallington Newsgroups: gmane.emacs.devel Subject: Re: add read-file-name-completion-ignore-case user variable ? Date: Sun, 04 Jul 2004 04:55:12 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87hdsoe89r.fsf@indigo.shootybangbang.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1088913683 15501 80.91.224.253 (4 Jul 2004 04:01:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 4 Jul 2004 04:01:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Jul 04 06:01:16 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 1BgyBo-0005bE-00 for ; Sun, 04 Jul 2004 06:01:16 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BgyBo-0003vd-00 for ; Sun, 04 Jul 2004 06:01:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgyDh-0001Wr-QP for emacs-devel@quimby.gnus.org; Sun, 04 Jul 2004 00:03:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BgyDd-0001Uo-Nu for emacs-devel@gnu.org; Sun, 04 Jul 2004 00:03:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BgyDc-0001UN-RF for emacs-devel@gnu.org; Sun, 04 Jul 2004 00:03:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgyDc-0001UK-Nj for emacs-devel@gnu.org; Sun, 04 Jul 2004 00:03:08 -0400 Original-Received: from [81.152.169.16] (helo=indigo.shootybangbang.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BgyBd-0001WO-Ku for emacs-devel@gnu.org; Sun, 04 Jul 2004 00:01:06 -0400 Original-Received: from jpw by indigo.shootybangbang.com with local (Exim 3.36 #1 (Debian)) id 1Bgy5w-0005Eb-00 for ; Sun, 04 Jul 2004 04:55:12 +0100 Original-To: emacs-devel@gnu.org X-Mailer: Norman X-Attribution: jpw X-Face: R(_z-rF:grdKO.*u`n); p.i$Eiz=h^CO5eDYv"4:K@#\HN09*Ykx}}B{kF/KH}%f_o^Wp (John Paul Wallington's message of "Thu, 24 Jun 2004 23:24:06 +0100") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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:25432 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25432 I wrote: > Stef's change of 2004-03-17 to `read-file-name' to set > completion-ignore-case for case-insensitive systems is hard for users > to configure -- Viktor Haag pointed this out on the gnu.emacs.help > newsgroup. > > How about having a `read-file-name-completion-ignore-case' user > variable rather than hard-coding a value according to system type? > We could still set its default value according to system type. Does anyone object to the following patch? If not, I shall install it. 2004-07-04 John Paul Wallington * fileio.c (read_file_name_completion_ignore_case): New variable. (syms_of_fileio): Declare and initialise it. (Fread_file_name): Bind `completion-ignore-case' to respect it. Index: fileio.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/fileio.c,v retrieving revision 1.505 diff -u -r1.505 fileio.c --- fileio.c 22 May 2004 22:17:17 -0000 1.505 +++ fileio.c 4 Jul 2004 03:56:48 -0000 @@ -206,6 +206,9 @@ /* Current predicate used by read_file_name_internal. */ Lisp_Object Vread_file_name_predicate; +/* Nonzero means completion ignores case when reading file name. */ +int read_file_name_completion_ignore_case; + /* Nonzero means, when reading a filename in the minibuffer, start out by inserting the default directory into the minibuffer. */ int insert_default_directory; @@ -6284,10 +6287,8 @@ } count = SPECPDL_INDEX (); -#if defined VMS || defined DOS_NT || defined MAC_OSX - specbind (intern ("completion-ignore-case"), Qt); -#endif - + specbind (intern ("completion-ignore-case"), + read_file_name_completion_ignore_case ? Qt : Qnil); specbind (intern ("minibuffer-completing-file-name"), Qt); specbind (intern ("read-file-name-predicate"), (NILP (predicate) ? Qfile_exists_p : predicate)); @@ -6523,6 +6524,14 @@ doc: /* Current predicate used by `read-file-name-internal'. */); Vread_file_name_predicate = Qnil; + DEFVAR_BOOL ("read-file-name-completion-ignore-case", &read_file_name_completion_ignore_case, + doc: /* *Non-nil means when reading a file name completion ignores case. */); +#if defined VMS || defined DOS_NT || defined MAC_OSX + read_file_name_completion_ignore_case = 1; +#else + read_file_name_completion_ignore_case = 0; +#endif + DEFVAR_BOOL ("insert-default-directory", &insert_default_directory, doc: /* *Non-nil means when reading a filename start with default dir in minibuffer. If the initial minibuffer contents are non-empty, you can usually