From: Juri Linkov Date: Wed, 30 Apr 2025 17:34:52 +0000 (+0300) Subject: Fix the match data in elisp-outline-search. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8fe836acc0609fe0921b1c5251dec397e9b5aafd;p=emacs.git Fix the match data in elisp-outline-search. * lisp/progmodes/elisp-mode.el (elisp-outline-search): Add 'save-match-data' since 'syntax-ppss' garbles the match data. (cherry picked from commit b06046edcfceb6ba426880444894373f21ea4a79) --- diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 74aa644d8f9..18e051eb75e 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -299,10 +299,13 @@ Comments in the form will be lost." (save-excursion (not (nth 8 (syntax-ppss (match-beginning 0)))))) (let ((search-success nil)) (while (and (setq search-success - (funcall (if backward #'re-search-backward #'re-search-forward) + (funcall (if backward #'re-search-backward + #'re-search-forward) (concat "^\\(?:" outline-regexp "\\)") bound (if move 'move t))) - (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))))) + (save-excursion + (save-match-data + (nth 8 (syntax-ppss (match-beginning 0))))))) search-success))) (defcustom emacs-lisp-mode-hook nil