diff options
Diffstat (limited to 'src/minibuf.c')
-rw-r--r-- | src/minibuf.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index a6b44ad4c62..e1939339ce8 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -26,7 +26,7 @@ Boston, MA 02111-1307, 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" @@ -2144,7 +2144,6 @@ Return nil if there is no valid completion, else t. */) { Lisp_Object completion, tem, tem1; register int i, i_byte; - register const unsigned char *completion_string; struct gcpro gcpro1, gcpro2; int prompt_end_charpos = XINT (Fminibuffer_prompt_end ()); @@ -2272,23 +2271,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); - 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. */ @@ -2532,7 +2522,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 (); |