all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jpw@pobox.com (John Paul Wallington)
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: New `read-buffer-completion-ignore-case' variable? [was Re: Release plans]
Date: Thu, 31 Jul 2008 01:56:44 +0100	[thread overview]
Message-ID: <usktq27n7.fsf_-_@FILTH.SHOOTYBANGBANG.COM> (raw)
In-Reply-To: <87prp7vo3k.fsf@stupidchicken.com> (Chong Yidong's message of "Mon\, 21 Jul 2008 00\:49\:03 -0400")

Chong Yidong <cyd@stupidchicken.com> 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  <jpw@pobox.com>

        * 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);
 }
 \f
 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;




  parent reply	other threads:[~2008-07-31  0:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 15:07 Release plans Chong Yidong
2008-07-17  0:27 ` Juri Linkov
2008-07-17  6:41   ` David Kastrup
2008-07-21  4:49 ` Chong Yidong
2008-07-21  8:06   ` Thien-Thi Nguyen
2008-07-21 13:32     ` Chong Yidong
2008-07-21 14:19       ` Thien-Thi Nguyen
2008-07-23 20:52   ` Michael Albinus
2008-07-23 21:42     ` Chong Yidong
2008-07-24 22:07       ` xesam.el (was: Release plans) Michael Albinus
2008-07-26  7:39   ` Release plans Eli Zaretskii
2008-07-26 21:33     ` Richard M Stallman
2008-07-27  3:22       ` Eli Zaretskii
2008-07-27 17:14         ` Richard M Stallman
2008-07-27 19:14           ` Eli Zaretskii
2008-07-28 21:46             ` Richard M Stallman
2008-07-29  3:12               ` Eli Zaretskii
2008-07-30  3:47                 ` Richard M Stallman
2008-07-30 17:33                   ` Eli Zaretskii
2008-07-28 13:43     ` Juri Linkov
2008-07-28 14:10       ` Chong Yidong
2008-07-28 14:33         ` Juri Linkov
2008-07-29 17:11           ` Chong Yidong
2008-07-29 17:54             ` Stefan Monnier
2008-07-29 15:21     ` Roland Winkler
2008-08-02 17:34     ` Eli Zaretskii
2008-08-09 18:29       ` Eli Zaretskii
2008-08-09 18:34         ` Juanma Barranquero
2008-08-09 19:06           ` Eli Zaretskii
2008-07-31  0:56   ` John Paul Wallington [this message]
2008-07-30 15:36     ` New `read-buffer-completion-ignore-case' variable? Chong Yidong
2008-08-01  0:51       ` John Paul Wallington
2008-07-31  2:10   ` Release plans Bastien
2008-07-31  2:43     ` Chong Yidong
2008-07-31  8:06       ` Lennart Borgman (gmail)
2008-08-01  2:53         ` Bastien
2008-08-01 19:26 ` Jay Belanger
2008-08-01 19:32   ` Chong Yidong
2008-08-02 16:12     ` Jay Belanger
2008-08-02  4:08   ` Stephen J. Turnbull
2008-08-02 17:30   ` Richard M Stallman
2008-08-05  4:04   ` Bill Wohler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=usktq27n7.fsf_-_@FILTH.SHOOTYBANGBANG.COM \
    --to=jpw@pobox.com \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.