From: Stefan Monnier Date: Tue, 10 Jun 2008 18:41:01 +0000 (+0000) Subject: * dired.c (file_name_completion): Don't return t if the match is exact X-Git-Tag: emacs-pretest-23.0.90~4917 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=928b5acc5e1e370d98a73d65ea13df4a67a82c4b;p=emacs.git * dired.c (file_name_completion): Don't return t if the match is exact but with different capitalization. * minibuf.c (Ftry_completion): Simplify. --- diff --git a/src/ChangeLog b/src/ChangeLog index 23189ad9cf9..fe097c2cc41 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2008-06-10 Stefan Monnier + * dired.c (file_name_completion): Don't return t if the match is exact + but with different capitalization. + * minibuf.c (Ftry_completion): Simplify. + * window.c (Vwindow_point_insertion_type): New var. (set_window_buffer): Use it. (syms_of_window): Init and export it to Lisp. diff --git a/src/dired.c b/src/dired.c index 7de334bb876..2d82c4bfdc3 100644 --- a/src/dired.c +++ b/src/dired.c @@ -768,7 +768,9 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) if (all_flag || NILP (bestmatch)) return bestmatch; - if (matchcount == 1 && bestmatchsize == SCHARS (file)) + /* Return t if the supplied string is an exact match (counting case); + it does not require any change to be made. */ + if (matchcount == 1 && !NILP (Fequal (bestmatch, file))) return Qt; bestmatch = Fsubstring (bestmatch, make_number (0), make_number (bestmatchsize)); diff --git a/src/minibuf.c b/src/minibuf.c index 7c22b6b5b99..168c6ab0b26 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1508,13 +1508,7 @@ is used to further constrain the set of candidates. */) /* Return t if the supplied string is an exact match (counting case); it does not require any change to be made. */ - if (matchcount == 1 && bestmatchsize == SCHARS (string) - && (tem = Fcompare_strings (bestmatch, make_number (0), - make_number (bestmatchsize), - string, make_number (0), - make_number (bestmatchsize), - Qnil), - EQ (Qt, tem))) + if (matchcount == 1 && !NILP (Fequal (bestmatch, string))) return Qt; XSETFASTINT (zero, 0); /* Else extract the part in which */