From: Eli Zaretskii Date: Sat, 15 Jun 2024 10:04:12 +0000 (+0300) Subject: Fix 'reindent-then-newline-and-indent' with 'abbrev-mode' X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~1026 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ffa349f983fa5c754fd7751c0757f6c704fbfe5a;p=emacs.git Fix 'reindent-then-newline-and-indent' with 'abbrev-mode' * lisp/simple.el (reindent-then-newline-and-indent): Use a marker for the initial position. (Bug#71459) --- diff --git a/lisp/simple.el b/lisp/simple.el index 74115be2778..b48f46fc711 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -915,7 +915,9 @@ In programming language modes, this is the same as TAB. In some text modes, where TAB inserts a tab, this indents to the column specified by the function `current-left-margin'." (interactive "*") - (let ((pos (point)) + ;; Use a marker because the call to 'newline' below could insert some + ;; text, e.g., if 'abbrev-mode' is turned on. + (let ((pos (point-marker)) (electric-indent-mode nil)) ;; Be careful to insert the newline before indenting the line. ;; Otherwise, the indentation might be wrong.