Mercurial > emacs
comparison lisp/simple.el @ 79987:6f13ddb7d9e9
(reindent-then-newline-and-indent): Be careful about the
unusual case where indent-according-to-mode moves point.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 01 Feb 2008 04:04:51 +0000 |
parents | 73661ddc7ac7 |
children | e540c42e9741 |
comparison
equal
deleted
inserted
replaced
79986:c592638ac955 | 79987:6f13ddb7d9e9 |
---|---|
630 ;; Be careful to insert the newline before indenting the line. | 630 ;; Be careful to insert the newline before indenting the line. |
631 ;; Otherwise, the indentation might be wrong. | 631 ;; Otherwise, the indentation might be wrong. |
632 (newline) | 632 (newline) |
633 (save-excursion | 633 (save-excursion |
634 (goto-char pos) | 634 (goto-char pos) |
635 (indent-according-to-mode) | 635 ;; Usually indent-according-to-mode should "preserve" point, but it is |
636 ;; not guaranteed; e.g. indent-to-left-margin doesn't. | |
637 (save-excursion (indent-according-to-mode)) | |
636 (delete-horizontal-space t)) | 638 (delete-horizontal-space t)) |
637 (indent-according-to-mode))) | 639 (indent-according-to-mode))) |
638 | 640 |
639 (defun quoted-insert (arg) | 641 (defun quoted-insert (arg) |
640 "Read next input character and insert it. | 642 "Read next input character and insert it. |