From 7f8ac8bf6f04045a676543862098c47bbf732f9e Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sun, 24 May 2026 11:51:38 +0000 Subject: Avoid crash in self-insert-command for peculiar arguments * src/cmds.c (internal_self_insert): Don't call auto-fill-function after inserting zero newlines. * test/src/cmds-tests.el (self-insert-zero-newlines): New. --- src/cmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cmds.c b/src/cmds.c index 99e436e65c1..e9dee5ed2e3 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -477,7 +477,8 @@ internal_self_insert (int c, EMACS_INT n) if ((CHAR_TABLE_P (Vauto_fill_chars) ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) : (c == ' ' || c == '\n')) - && !NILP (BVAR (current_buffer, auto_fill_function))) + && !NILP (BVAR (current_buffer, auto_fill_function)) + && n > 0) { Lisp_Object auto_fill_result; -- cgit v1.3