From cf593fad5b1bc9140203563eac8ddf0d4603fccb Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Tue, 26 Sep 2023 21:36:19 +0200 Subject: [PATCH] Fix beginning-of-defun not jumping to BOF * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Save match data around a call to `syntax-ppss'. --- lisp/emacs-lisp/lisp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 17d58b1e3c6..b49850e4ef0 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -422,7 +422,8 @@ beginning-of-defun-raw "\\(?:" defun-prompt-regexp "\\)\\s(") "^\\s(") nil 'move arg)) - (nth 8 (syntax-ppss)))) + (save-match-data + (nth 8 (syntax-ppss))))) found) (progn (goto-char (1- (match-end 0))) t))) -- 2.30.2