emacs-diffs
[Top][All Lists]
Advanced

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

master 665b4e7 1/2: Proof some searches and file listings against symlin


From: Dmitry Gutov
Subject: master 665b4e7 1/2: Proof some searches and file listings against symlinks
Date: Wed, 6 Jan 2021 16:07:43 -0500 (EST)

branch: master
commit 665b4e7c4e093391a353506e7b2385f0902db70b
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Proof some searches and file listings against symlinks
    
    * lisp/progmodes/project.el (project--files-in-directory):
    Make sure the directory includes the trailing slash in case it's
    a symlink, discussed in
    https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00345.html.
    
    * lisp/progmodes/xref.el (xref-matches-in-directory): Same.
    
    * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
    Same.
---
 lisp/cedet/semantic/symref/grep.el | 3 ++-
 lisp/progmodes/project.el          | 3 ++-
 lisp/progmodes/xref.el             | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/cedet/semantic/symref/grep.el 
b/lisp/cedet/semantic/symref/grep.el
index 5f9a3fa..9f0ac38 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -168,7 +168,8 @@ This shell should support pipe redirect syntax."
       (erase-buffer)
       (setq default-directory rootdir)
       (let ((cmd (semantic-symref-grep-use-template
-                  (file-local-name rootdir) filepattern grepflags greppat)))
+                  (file-name-as-directory (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/project.el b/lisp/progmodes/project.el
index d417382..62c3cf4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -291,7 +291,8 @@ to find the list of ignores for each directory."
          (localdir (file-local-name (expand-file-name dir)))
          (command (format "%s %s %s -type f %s -print0"
                           find-program
-                          localdir
+                          ;; In case DIR is a symlink.
+                          (file-name-as-directory localdir)
                           (xref--find-ignores-arguments ignores localdir)
                           (if files
                               (concat (shell-quote-argument "(")
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 2fefc23..b393b8d 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1374,7 +1374,8 @@ IGNORES is a list of glob patterns for files to ignore."
        ;; do that reliably enough, without creating false negatives?
        (command (xref--rgrep-command (xref--regexp-to-extended regexp)
                                      files
-                                     (file-local-name (expand-file-name dir))
+                                     (file-name-as-directory
+                                      (file-local-name (expand-file-name dir)))
                                      ignores))
        (def default-directory)
        (buf (get-buffer-create " *xref-grep*"))



reply via email to

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