Fix beginning-of-defun not jumping to BOF
In batch mode or when font-lock and some other niceties are switched off, function `syntax-ppss' can modify match data held by function `beginning-of-defun-raw'. In that case, `beginning-of-defun' can jump to some seemingly arbitrary position, and not the actual BOF. * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Save match data around a call to `syntax-ppss'. (Bug#66218)
This commit is contained in:
parent
281258e574
commit
115a940a4b
1 changed files with 2 additions and 1 deletions
|
@ -422,7 +422,8 @@ of a defun, nil if it failed to find one."
|
|||
"\\(?:" 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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue