From: Dmitry Gutov Date: Fri, 26 Aug 2022 22:09:47 +0000 (+0300) Subject: xref-matches-in-files: Use with-connection-local-variables X-Git-Tag: emacs-29.0.90~1893^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6edff5ac331236f817032d6744a0855e5cc3d48d;p=emacs.git xref-matches-in-files: Use with-connection-local-variables * lisp/progmodes/xref.el (xref-matches-in-files): Use with-connection-local-variables (bug#57385). --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index f3db971bcf2..a7e372c2ac6 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1764,6 +1764,12 @@ utility function used by commands like `dired-do-find-regexp' and :version "28.1" :package-version '(xref . "1.0.4")) +(defmacro xref--with-connection-local-variables (&rest body) + (declare (debug t)) + (if (>= emacs-major-version 27) + `(with-connection-local-variables ,@body) + `(progn ,@body))) + ;;;###autoload (defun xref-matches-in-files (regexp files) "Find all matches for REGEXP in FILES. @@ -1810,13 +1816,14 @@ to control which program to use when looking for matches." (insert (mapconcat #'identity files "\0")) (setq default-directory dir) (setq status - (xref--process-file-region (point-min) - (point-max) - shell-file-name - output - nil - shell-command-switch - command))) + (xref--with-connection-local-variables + (xref--process-file-region (point-min) + (point-max) + shell-file-name + output + nil + shell-command-switch + command)))) (goto-char (point-min)) (when (and (/= (point-min) (point-max)) (not (looking-at grep-re))