From: Lars Ingebrigtsen Date: Sun, 2 Oct 2022 12:05:53 +0000 (+0200) Subject: Fix point movement when indenting in sieve-mode X-Git-Tag: emacs-29.0.90~1856^2~84 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef6f16da2f36278706ae787131062dee088f76ee;p=emacs.git 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). --- diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index f62af03534a..695a3235a7b 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -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)