emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: completion of coding systems]


From: Glenn Morris
Subject: Re: address@hidden: completion of coding systems]
Date: Mon, 15 Oct 2007 03:16:40 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Richard Stallman wrote:

> That would work, but it would be cleaner to use 
>
>     specbind (Qcompletion_ignore_case, Qt);
>
> instead of interning it again.

I was copying the behaviour of read-file-name in fileio.c.

You mean you would rather have this:


--- coding.c    25 Jul 2007 07:49:38 -0000      1.351.2.2
+++ coding.c    15 Oct 2007 07:13:18 -0000
@@ -386,6 +386,8 @@
    decided.  */
 Lisp_Object eol_mnemonic_undecided;
 
+Lisp_Object Qcompletion_ignore_case;
+
 /* Format of end-of-line decided by system.  This is CODING_EOL_LF on
    Unix, CODING_EOL_CRLF on DOS/Windows, and CODING_EOL_CR on Mac.
    This has an effect only for external encoding (i.e. for output to
@@ -6558,16 +6560,22 @@
 
 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
        doc: /* Read a coding system from the minibuffer, prompting with string 
PROMPT.
-If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.  
*/)
+If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
+Ignores case when completing coding systems (all Emacs coding systems
+are lower-case).  */)
      (prompt, default_coding_system)
      Lisp_Object prompt, default_coding_system;
 {
   Lisp_Object val;
+  int count = SPECPDL_INDEX ();
+
   if (SYMBOLP (default_coding_system))
     default_coding_system = SYMBOL_NAME (default_coding_system);
+  specbind (Qcompletion_ignore_case, Qt);
   val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
                          Qt, Qnil, Qcoding_system_history,
                          default_coding_system, Qnil);
+  unbind_to (count, Qnil);
   return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil));
 }
 
@@ -7733,6 +7741,9 @@
   /* Target FILENAME is the third argument.  */
   Fput (Qwrite_region, Qtarget_idx, make_number (2));
 
+  Qcompletion_ignore_case = intern ("completion-ignore-case");
+  staticpro (&Qcompletion_ignore_case);
+
   Qcall_process = intern ("call-process");
   staticpro (&Qcall_process);
   /* Target PROGRAM is the first argument.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]