From: Pip Cet Date: Mon, 8 Jul 2024 14:34:45 +0000 (+0000) Subject: perl-mode: fix bug introduced in bd86a6c4fde X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0a01331e84a5ee2df53f6367ff00688300d366f1;p=emacs.git perl-mode: fix bug introduced in bd86a6c4fde * lisp/progmodes/perl-mode.el (perl-calculate-indent): Use `save-excursion' around code that modifies point. (cherry picked from commit dd8d5d57df51bcd066323d068b852e9373871584) --- diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index ff71970d41b..13d5d7f9451 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -1128,8 +1128,8 @@ Returns (parse-state) if line starts inside a string." ;; Move back over whitespace before the openbrace. ;; If openbrace is not first nonwhite thing on the line, ;; add the perl-brace-imaginary-offset. - (progn (skip-chars-backward " \t") - (if (bolp) 0 perl-brace-imaginary-offset)) + (save-excursion (skip-chars-backward " \t") + (if (bolp) 0 perl-brace-imaginary-offset)) (perl-indent-new-calculate 'virtual)))))))) (defun perl-backward-to-noncomment ()