emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master b9c6020: Fix Bug#33006


From: Michael Albinus
Subject: [Emacs-diffs] master b9c6020: Fix Bug#33006
Date: Mon, 29 Oct 2018 09:10:01 -0400 (EDT)

branch: master
commit b9c60200259a562f4762e8debf4646319d7a9332
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Bug#33006
    
    * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
    * lisp/progmodes/xref.el (xref-collect-matches)
    (xref--collect-matches): Handle remote files.  (Bug#33006)
---
 lisp/cedet/semantic/symref/grep.el | 10 ++++++----
 lisp/progmodes/xref.el             |  5 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/cedet/semantic/symref/grep.el 
b/lisp/cedet/semantic/symref/grep.el
index 93bda6a..661e101 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -173,14 +173,16 @@ This shell should support pipe redirect syntax."
          ;; find . -type f -print0 | xargs -0 -e grep -nH -e
          ;; Note : I removed -e as it is not posix, nor necessary it seems.
 
-         (let ((cmd (concat "find " default-directory " -type f " filepattern 
" -print0 "
+         (let ((cmd (concat "find " (file-local-name rootdir)
+                             " -type f " filepattern " -print0 "
                             "| xargs -0 grep -H " grepflags "-e " greppat)))
            ;;(message "Old command: %s" cmd)
-           (call-process semantic-symref-grep-shell nil b nil
+           (process-file semantic-symref-grep-shell nil b nil
                           shell-command-switch cmd)
            )
-       (let ((cmd (semantic-symref-grep-use-template rootdir filepattern 
grepflags greppat)))
-         (call-process semantic-symref-grep-shell nil b nil
+       (let ((cmd (semantic-symref-grep-use-template
+                    (file-local-name rootdir) filepattern grepflags greppat)))
+         (process-file semantic-symref-grep-shell nil b nil
                         shell-command-switch cmd))
        ))
     (setq ans (semantic-symref-parse-tool-output tool b))
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index c7ae40e..6b1421a 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -992,7 +992,7 @@ IGNORES is a list of glob patterns."
        ;; do that reliably enough, without creating false negatives?
        (command (xref--rgrep-command (xref--regexp-to-extended regexp)
                                      files
-                                     (expand-file-name dir)
+                                     (file-local-name (expand-file-name dir))
                                      ignores))
        (def default-directory)
        (buf (get-buffer-create " *xref-grep*"))
@@ -1003,7 +1003,7 @@ IGNORES is a list of glob patterns."
       (erase-buffer)
       (setq default-directory def)
       (setq status
-            (call-process-shell-command command nil t))
+            (process-file-shell-command command nil t))
       (goto-char (point-min))
       ;; Can't use the exit status: Grep exits with 1 to mean "no
       ;; matches found".  Find exits with 1 if any of the invocations
@@ -1105,6 +1105,7 @@ Such as the current syntax table and the applied syntax 
properties."
 
 (defun xref--collect-matches (hit regexp tmp-buffer)
   (pcase-let* ((`(,line ,file ,text) hit)
+               (file (and file (concat (file-remote-p default-directory) 
file)))
                (buf (xref--find-buffer-visiting file))
                (syntax-needed (xref--regexp-syntax-dependent-p regexp)))
     (if buf



reply via email to

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