#include "syntax.h"
#include "window.h"
#include "keyboard.h"
+#include "dispextern.h"
Lisp_Object Qkill_forward_chars, Qkill_backward_chars, Vblink_paren_function;
else
CHECK_NUMBER (n, 0);
- SET_PT (XINT (Fline_beginning_position (n)));
+ {
+ int pos = XFASTINT (Fline_beginning_position (n));
+ if (INTEGERP (current_buffer->minibuffer_prompt_length)
+ && pos < XFASTINT (current_buffer->minibuffer_prompt_length))
+ pos = XFASTINT (current_buffer->minibuffer_prompt_length);
+ SET_PT (pos);
+ }
+
return Qnil;
}
return 0. A value of 1 indicates this *might* not have been simple.
A value of 2 means this did things that call for an undo boundary. */
+int
internal_self_insert (c, noautofill)
int c;
int noautofill;
{
c = unibyte_char_to_multibyte (c);
len = CHAR_STRING (c, workbuf, str);
+ if (len == 1)
+ /* If C has modifier bits, this makes C an appropriate
+ one-byte char. */
+ c = *str;
}
else
- workbuf[0] = c, str = workbuf, len = 1;
-
+ {
+ workbuf[0] = (SINGLE_BYTE_CHAR_P (c)
+ ? c
+ : multibyte_char_to_unibyte (c, Qnil));
+ str = workbuf;
+ len = 1;
+ }
if (!NILP (overwrite)
&& PT < ZV)
{
&& XINT (current_buffer->tab_width) > 0
&& XFASTINT (current_buffer->tab_width) < 20
&& (target_clm = (current_column ()
- + XINT (Fchar_width (make_number (c2)))),
+ + XINT (Fchar_width (make_number (c)))),
target_clm % XFASTINT (current_buffer->tab_width)))))
{
int pos = PT;
if (chars_to_delete)
{
- string = make_multibyte_string (str, 1, len);
+ string = make_string_from_bytes (str, 1, len);
if (spaces_to_insert)
{
tem = Fmake_string (make_number (spaces_to_insert),
string = concat2 (tem, string);
}
- replace_range (PT, PT + chars_to_delete, string, 1, 1, 0);
+ replace_range (PT, PT + chars_to_delete, string, 1, 1, 1);
Fforward_char (make_number (1 + spaces_to_insert));
}
else
insert_and_inherit (str, len);
- if ((c == ' ' || c == '\n')
+ if ((CHAR_TABLE_P (Vauto_fill_chars)
+ ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c))
+ : (c == ' ' || c == '\n'))
&& !noautofill
&& !NILP (current_buffer->auto_fill_function))
{
\f
/* module initialization */
+void
syms_of_cmds ()
{
Qkill_backward_chars = intern ("kill-backward-chars");
defsubr (&Sself_insert_command);
}
+void
keys_of_cmds ()
{
int n;