emacs-devel
[Top][All Lists]
Advanced

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

Re: completing-read case problem


From: Markus Rost
Subject: Re: completing-read case problem
Date: Mon, 15 Nov 2004 14:43:34 -0500

[I suggest to keep this thread on emacs-devel.]

> > (let ((completion-ignore-case t))
> >   (completing-read "Give me ABC: "
> >                (list "abc")
> >                (lambda (string)
> >                  (string= string "abc"))
> >                t
> >                ))
> 
> > With input "ABC" it returns "ABC", which I think is incorrect -- at
> > least it may lead to surprises in programs which assume that the
> > output of completing-read is always an exact member of TABLE,
> > restricted by PREDICATE.
> 
> Yes, we pretty much agreed to that in an earlier discussion this year.
> Nobody has stepped forward with a patch for it, tho.
> 

I guess you mean the discussion started with
<URL:http://lists.gnu.org/archive/html/emacs-devel/2003-12/msg00459.html>.

I think it would be definitely better to fix completing-read than to
make changes elsewhere in code using completing-read, but I can't do
that (I am not a C programmer).

The mentioned problem with "M-x customize-group Mouse" is rather
minor, and one could just leave it as it is.

One possibility for a change would be the patch below, but I don't
like it, and it would have to be applied also to
customize-group-other-window and perhaps also at other places in
cus-edit.el.

===Buffer *vc-diff*=========================================
*** cus-edit.el 02 Nov 2004 09:17:44 -0500      1.196
--- cus-edit.el 15 Nov 2004 14:32:55 -0500      
***************
*** 866,871 ****
--- 866,875 ----
                                          (or (get symbol 'custom-loads)
                                              (get symbol 'custom-group)))
                                        t))))
+   ;; If we got the wrong case, give it another try.
+   (unless (or (get (intern group) 'custom-loads)
+             (get (intern group) 'custom-group))
+     (setq group (downcase group)))
    (when (stringp group)
      (if (string-equal "" group)
        (setq group 'emacs)
============================================================




reply via email to

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