emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6edff5ac33: xref-matches-in-files: Use with-connection-local-vari


From: Dmitry Gutov
Subject: master 6edff5ac33: xref-matches-in-files: Use with-connection-local-variables
Date: Fri, 26 Aug 2022 18:09:57 -0400 (EDT)

branch: master
commit 6edff5ac331236f817032d6744a0855e5cc3d48d
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    xref-matches-in-files: Use with-connection-local-variables
    
    * lisp/progmodes/xref.el (xref-matches-in-files):
    Use with-connection-local-variables (bug#57385).
---
 lisp/progmodes/xref.el | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index f3db971bcf..a7e372c2ac 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]