summaryrefslogtreecommitdiff
path: root/lisp/progmodes/xref.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2022-08-27 01:09:47 +0300
committerDmitry Gutov <dgutov@yandex.ru>2022-08-27 01:09:47 +0300
commit6edff5ac331236f817032d6744a0855e5cc3d48d (patch)
treebc9c2bd1f53ff7f3b242edd4604f70bb67f611cc /lisp/progmodes/xref.el
parentc1442f96db64d545007f25995596b399f638e399 (diff)
downloademacs-6edff5ac331236f817032d6744a0855e5cc3d48d.tar.gz
xref-matches-in-files: Use with-connection-local-variables
* lisp/progmodes/xref.el (xref-matches-in-files): Use with-connection-local-variables (bug#57385).
Diffstat (limited to 'lisp/progmodes/xref.el')
-rw-r--r--lisp/progmodes/xref.el21
1 files changed, 14 insertions, 7 deletions
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))