diff options
| author | Eli Zaretskii | 2024-06-15 13:04:12 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-06-15 13:04:12 +0300 |
| commit | ffa349f983fa5c754fd7751c0757f6c704fbfe5a (patch) | |
| tree | 60c7cfe4d3431cd38dfb1a44c5d3e83e97dcdba5 | |
| parent | 6d12157fa85a12208555e291321af97a09243962 (diff) | |
| download | emacs-ffa349f983fa5c754fd7751c0757f6c704fbfe5a.tar.gz emacs-ffa349f983fa5c754fd7751c0757f6c704fbfe5a.zip | |
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)
| -rw-r--r-- | lisp/simple.el | 4 |
1 files changed, 3 insertions, 1 deletions
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. | |||
| 915 | In some text modes, where TAB inserts a tab, this indents to the | 915 | In some text modes, where TAB inserts a tab, this indents to the |
| 916 | column specified by the function `current-left-margin'." | 916 | column specified by the function `current-left-margin'." |
| 917 | (interactive "*") | 917 | (interactive "*") |
| 918 | (let ((pos (point)) | 918 | ;; Use a marker because the call to 'newline' below could insert some |
| 919 | ;; text, e.g., if 'abbrev-mode' is turned on. | ||
| 920 | (let ((pos (point-marker)) | ||
| 919 | (electric-indent-mode nil)) | 921 | (electric-indent-mode nil)) |
| 920 | ;; Be careful to insert the newline before indenting the line. | 922 | ;; Be careful to insert the newline before indenting the line. |
| 921 | ;; Otherwise, the indentation might be wrong. | 923 | ;; Otherwise, the indentation might be wrong. |