diff options
author | Tom Tromey <tom@tromey.com> | 2017-08-05 18:30:52 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-08-05 18:31:39 -0600 |
commit | 9b463fa8648b7baed95a44f4317cb7402fd8bf1c (patch) | |
tree | c7134b781617519f14256c5126a766673a01c7dd /src/cmds.c | |
parent | 0bd08c00751a9deee66d304d3f18aa45ef1276db (diff) | |
download | emacs-9b463fa8648b7baed95a44f4317cb7402fd8bf1c.tar.gz |
Respect comment-auto-fill-only-comments
Respect comment-auto-fill-only-comments when auto-filling and a
comment syntax is defined.
* lisp/newcomment.el (comment-indent-new-line): Do not check
comment-auto-fill-only-comments.
* lisp/simple.el (internal-auto-fill): New defun.
* src/cmds.c (internal_self_insert): Call Qinternal_auto_fill, not
auto_fill_function.
(syms_of_cmds): Define Qinternal_auto_fill.
Diffstat (limited to 'src/cmds.c')
-rw-r--r-- | src/cmds.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmds.c b/src/cmds.c index 51652d542a8..6f2db8696e9 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -268,9 +268,10 @@ Whichever character you type to run this command is inserted. The numeric prefix argument N says how many times to repeat the insertion. Before insertion, `expand-abbrev' is executed if the inserted character does not have word syntax and the previous character in the buffer does. -After insertion, the value of `auto-fill-function' is called if the -`auto-fill-chars' table has a non-nil value for the inserted character. -At the end, it runs `post-self-insert-hook'. */) +After insertion, `internal-auto-fill' is called if +`auto-fill-function' is non-nil and if the `auto-fill-chars' table has +a non-nil value for the inserted character. At the end, it runs +`post-self-insert-hook'. */) (Lisp_Object n) { CHECK_NUMBER (n); @@ -475,7 +476,7 @@ internal_self_insert (int c, EMACS_INT n) that. Must have the newline in place already so filling and justification, if any, know where the end is going to be. */ SET_PT_BOTH (PT - 1, PT_BYTE - 1); - auto_fill_result = call0 (BVAR (current_buffer, auto_fill_function)); + auto_fill_result = call0 (Qinternal_auto_fill); /* Test PT < ZV in case the auto-fill-function is strange. */ if (c == '\n' && PT < ZV) SET_PT_BOTH (PT + 1, PT_BYTE + 1); @@ -494,6 +495,8 @@ internal_self_insert (int c, EMACS_INT n) void syms_of_cmds (void) { + DEFSYM (Qinternal_auto_fill, "internal-auto-fill"); + DEFSYM (Qundo_auto_amalgamate, "undo-auto-amalgamate"); DEFSYM (Qundo_auto__this_command_amalgamating, "undo-auto--this-command-amalgamating"); |