From: Juri Linkov Date: Wed, 18 Aug 2021 17:02:39 +0000 (+0300) Subject: * lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily. X-Git-Tag: emacs-28.0.90~1448 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b31ad36094666da6b3281025adc163829d89de8;p=emacs.git * lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily. --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 69378a561ea..d3780d571fc 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1729,12 +1729,14 @@ Such as the current syntax table and the applied syntax properties." (if buf (with-current-buffer buf (save-excursion - (goto-char (point-min)) - (forward-line (1- line)) - (xref--collect-matches-1 regexp file line - (line-beginning-position) - (line-end-position) - syntax-needed))) + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- line)) + (xref--collect-matches-1 regexp file line + (line-beginning-position) + (line-end-position) + syntax-needed)))) ;; Using the temporary buffer is both a performance and a buffer ;; management optimization. (with-current-buffer tmp-buffer