1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Fix point movement when indenting in sieve-mode

* lisp/net/sieve-mode.el (sieve-mode-indent-function): Fix point
movement when point is at the start of the line (bug#58202).
This commit is contained in:
Lars Ingebrigtsen 2022-10-02 14:05:53 +02:00
parent b14f049f00
commit ef6f16da2f

View file

@ -200,7 +200,13 @@ Turning on Sieve mode runs `sieve-mode-hook'."
(let ((depth (car (syntax-ppss))))
(when (looking-at "[ \t]*}")
(setq depth (1- depth)))
(indent-line-to (* 2 depth)))))
(indent-line-to (* 2 depth))))
;; Skip to the end of the indentation if at the beginning of the
;; line.
(when (save-excursion
(skip-chars-backward " \t")
(bolp))
(skip-chars-forward " \t")))
(provide 'sieve-mode)