X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fcmds.c;h=c9020923174d7b5e5de605b2980722f50d1a70b8;hb=2811f51e2dc942e4db58ea2236d17c1338de7f29;hp=8e686403978391603148a6d8010b3f93797e40de;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/src/cmds.c b/src/cmds.c index 8e68640..c902092 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -41,6 +41,9 @@ Lisp_Object Vself_insert_face; /* This is the command that set up Vself_insert_face. */ Lisp_Object Vself_insert_face_command; + +/* A char-table for characters which may invoke auto-filling. */ +Lisp_Object Vauto_fill_chars; DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* Move point right N characters (left if N negative). @@ -327,7 +330,7 @@ internal_self_insert (Emchar c1, int noautofill) REGISTER enum syntaxcode synt; REGISTER Emchar c2; Lisp_Object overwrite; - struct Lisp_Char_Table *syntax_table; + Lisp_Char_Table *syntax_table; struct buffer *buf = current_buffer; int tab_width; @@ -396,7 +399,9 @@ internal_self_insert (Emchar c1, int noautofill) #endif /* FSFmacs */ } } - if ((c1 == ' ' || c1 == '\n') + if ((CHAR_TABLEP (Vauto_fill_chars) + ? !NILP (XCHAR_TABLE_VALUE_UNSAFE (Vauto_fill_chars, c1)) + : (c1 == ' ' || c1 == '\n')) && !noautofill && !NILP (buf->auto_fill_function)) { @@ -498,4 +503,12 @@ Function called, if non-nil, whenever a close parenthesis is inserted. More precisely, a char with closeparen syntax is self-inserted. */ ); Vblink_paren_function = Qnil; + + DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars /* +A char-table for characters which invoke auto-filling. +Such characters has value t in this table. +*/); + Vauto_fill_chars = Fmake_char_table (Qgeneric); + XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt; + XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt; }