X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d4aa48db8ed36b1fc7e7b0e6bd35049353f7f96e..0e2501ed344f5c8e251bcdca981f5d81dd78f663:/src/minibuf.c diff --git a/src/minibuf.c b/src/minibuf.c index 5cd821e517..86dd095fa2 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1,7 +1,7 @@ /* Minibuffer input and completion. Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */ #include "lisp.h" #include "commands.h" #include "buffer.h" -#include "charset.h" +#include "character.h" #include "dispextern.h" #include "keyboard.h" #include "frame.h" @@ -2432,23 +2432,14 @@ Return nil if there is no valid completion, else t. */) /* Now find first word-break in the stuff found by completion. i gets index in string of where to stop completing. */ - { - int len, c; - int bytes = SBYTES (completion); - register const unsigned char *completion_string = SDATA (completion); - for (; i_byte < SBYTES (completion); i_byte += len, i++) - { - c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, - bytes - i_byte, - len); - if (SYNTAX (c) != Sword) - { - i_byte += len; - i++; - break; - } - } - } + while (i_byte < SBYTES (completion)) + { + int c; + + FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, completion, i, i_byte); + if (SYNTAX (c) != Sword) + break; + } /* If got no characters, print help for user. */ @@ -2728,7 +2719,7 @@ DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0, doc: /* Terminate minibuffer input. */) () { - if (INTEGERP (last_command_char)) + if (CHARACTERP (last_command_char)) internal_self_insert (XINT (last_command_char), 0); else bitch_at_user ();