comparison src/minibuf.c @ 89483:2f877ed80fa6

*** empty log message ***
author Kenichi Handa <handa@m17n.org>
date Mon, 08 Sep 2003 12:53:41 +0000
parents 375f2633d815 288b118954ca
children 47e79133c28a
comparison
equal deleted inserted replaced
88123:375f2633d815 89483:2f877ed80fa6
24 #include <stdio.h> 24 #include <stdio.h>
25 25
26 #include "lisp.h" 26 #include "lisp.h"
27 #include "commands.h" 27 #include "commands.h"
28 #include "buffer.h" 28 #include "buffer.h"
29 #include "charset.h" 29 #include "character.h"
30 #include "dispextern.h" 30 #include "dispextern.h"
31 #include "keyboard.h" 31 #include "keyboard.h"
32 #include "frame.h" 32 #include "frame.h"
33 #include "window.h" 33 #include "window.h"
34 #include "syntax.h" 34 #include "syntax.h"
2121 } 2121 }
2122 } 2122 }
2123 2123
2124 /* Now find first word-break in the stuff found by completion. 2124 /* Now find first word-break in the stuff found by completion.
2125 i gets index in string of where to stop completing. */ 2125 i gets index in string of where to stop completing. */
2126 { 2126 while (i_byte < SBYTES (completion))
2127 int len, c; 2127 {
2128 int bytes = SBYTES (completion); 2128 int c;
2129 completion_string = SDATA (completion); 2129
2130 for (; i_byte < SBYTES (completion); i_byte += len, i++) 2130 FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, completion, i, i_byte);
2131 { 2131 if (SYNTAX (c) != Sword)
2132 c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, 2132 break;
2133 bytes - i_byte, 2133 }
2134 len);
2135 if (SYNTAX (c) != Sword)
2136 {
2137 i_byte += len;
2138 i++;
2139 break;
2140 }
2141 }
2142 }
2143 2134
2144 /* If got no characters, print help for user. */ 2135 /* If got no characters, print help for user. */
2145 2136
2146 if (i == PT - prompt_end_charpos) 2137 if (i == PT - prompt_end_charpos)
2147 { 2138 {
2377 2368
2378 DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0, 0, "", 2369 DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0, 0, "",
2379 doc: /* Terminate minibuffer input. */) 2370 doc: /* Terminate minibuffer input. */)
2380 () 2371 ()
2381 { 2372 {
2382 if (INTEGERP (last_command_char)) 2373 if (CHARACTERP (last_command_char))
2383 internal_self_insert (XINT (last_command_char), 0); 2374 internal_self_insert (XINT (last_command_char), 0);
2384 else 2375 else
2385 bitch_at_user (); 2376 bitch_at_user ();
2386 2377
2387 return Fthrow (Qexit, Qnil); 2378 return Fthrow (Qexit, Qnil);