(erase-buffer)
(setq default-directory rootdir)
(let ((cmd (semantic-symref-grep-use-template
- (file-name-as-directory (file-local-name rootdir))
+ (directory-file-name (file-local-name rootdir))
filepattern grepflags greppat)))
(process-file semantic-symref-grep-shell nil b nil
shell-command-switch cmd)))
(let ((gcmd (format "%s <C> %s <R>"
grep-program grep-options))
(null (if grep-use-null-device
- (format "%s " (null-device))
- "")))
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
- find-program xargs-program gcmd))
- ((eq grep-find-use-xargs 'gnu-sort)
- (format "%s <D> <X> -type f <F> -print0 | sort -z | \"%s\" -0 %s"
- find-program xargs-program gcmd))
- ((eq grep-find-use-xargs 'exec)
- (format "%s <D> <X> -type f <F> -exec %s %s %s%s"
- find-program gcmd quot-braces null quot-scolon))
- ((eq grep-find-use-xargs 'exec-plus)
- (format "%s <D> <X> -type f <F> -exec %s %s%s +"
- find-program gcmd null quot-braces))
- (t
- (format "%s <D> <X> -type f <F> -print | \"%s\" %s"
- find-program xargs-program gcmd))))))))
-
- ;; Save defaults for this host.
+ (format "%s " (null-device))
+ "")))
+ (cond ((eq grep-find-use-xargs 'gnu)
+ (format "%s -H <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
+ find-program xargs-program gcmd))
+ ((eq grep-find-use-xargs 'gnu-sort)
+ (format "%s -H <D> <X> -type f <F> -print0 | sort -z | \"%s\" -0 %s"
+ find-program xargs-program gcmd))
+ ((eq grep-find-use-xargs 'exec)
+ (format "%s -H <D> <X> -type f <F> -exec %s %s %s%s"
+ find-program gcmd quot-braces null quot-scolon))
+ ((eq grep-find-use-xargs 'exec-plus)
+ (format "%s -H <D> <X> -type f <F> -exec %s %s%s +"
+ find-program gcmd null quot-braces))
+ (t
+ (format "%s -H <D> <X> -type f <F> -print | \"%s\" %s"
+ find-program xargs-program gcmd))))))))
+ ;; Save defaults for this host.
(setq grep-host-defaults-alist
(delete (assq host-id grep-host-defaults-alist)
grep-host-defaults-alist))
;; do that reliably enough, without creating false negatives?
(command (xref--rgrep-command (xref--regexp-to-extended regexp)
files
- (file-name-as-directory
+ (directory-file-name
(file-name-unquote
(file-local-name (expand-file-name dir))))
ignores))
(should (null (marker-position (cdr (nth 0 (cdr cons2))))))))
(ert-deftest xref--xref-file-name-display-is-abs ()
- (let* ((xref-file-name-display 'abs)
- ;; Some older BSD find versions can produce '//' in the output.
- (expected (list
- (concat xref-tests--data-dir "/?file1.txt")
- (concat xref-tests--data-dir "/?file2.txt")))
- (actual (delete-dups
- (mapcar 'xref-location-group
- (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))))
- (should (= (length expected) (length actual)))
- (should (cl-every (lambda (e1 e2)
- (string-match-p e1 e2))
- expected actual))))
+ (let ((xref-file-name-display 'abs))
+ (should (equal
+ (delete-dups
+ (mapcar 'xref-location-group
+ (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+ (list
+ (concat xref-tests--data-dir "file1.txt")
+ (concat xref-tests--data-dir "file2.txt"))))))
(ert-deftest xref--xref-file-name-display-is-nondirectory ()
(let ((xref-file-name-display 'nondirectory))
(file-name-directory (directory-file-name xref-tests--data-dir)))
(project-find-functions
(lambda (_) (cons 'transient data-parent-dir)))
- (xref-file-name-display 'project-relative)
- ;; Some older BSD find versions can produce '//' in the output.
- (expected (list
- "xref-resources//?file1.txt"
- "xref-resources//?file2.txt"))
- (actual (delete-dups
- (mapcar 'xref-location-group
- (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))))
- (should (and (= (length expected) (length actual))
- (cl-every (lambda (e1 e2)
- (string-match-p e1 e2))
- expected actual)))))
+ (xref-file-name-display 'project-relative))
+ (should (equal
+ (delete-dups
+ (mapcar 'xref-location-group
+ (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+ (list
+ "xref-resources/file1.txt"
+ "xref-resources/file2.txt")))))
;;; xref-tests.el ends here