]> git.eshelyaron.com Git - emacs.git/commitdiff
Proof some searches and file listings against symlinks
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 6 Jan 2021 17:41:55 +0000 (19:41 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 6 Jan 2021 21:07:22 +0000 (23:07 +0200)
* 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
lisp/progmodes/project.el
lisp/progmodes/xref.el

index 5f9a3fa352ec1e037ed9311123fee0236d2e142c..9f0ac38ec7579a85dac239e2aca6ac3088df392f 100644 (file)
@@ -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))
index d417382c0dfcbfffcbfcc87e6171c7299eaa7c7a..62c3cf44cb6cdf8cd709cf601c733e85fa7a5b6f 100644 (file)
@@ -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 "(")
index 2fefc23e1992a15769f00fd2f9de83ea943e8a2a..b393b8d0f1a7a4bdf07412d115b5fae46064d8d1 100644 (file)
@@ -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*"))