From 0a01331e84a5ee2df53f6367ff00688300d366f1 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Mon, 8 Jul 2024 14:34:45 +0000 Subject: [PATCH] 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) --- lisp/progmodes/perl-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 () -- 2.39.2