diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 180d779a78..b7d08409aa 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -150,15 +150,22 @@ semantic-symref-perform-search "-l ") ((eq (oref tool searchtype) 'regexp) "-nE ") - (t "-n "))) + (t (if (equal grep-program "rg") + ;; TODO: remove this after ripgrep is fixed (bug#49836) + (unless (string-search "rg -nH" grep-find-template) + "-n ") + "-n ")))) (greppat (cond ((eq (oref tool searchtype) 'regexp) (oref tool searchfor)) (t ;; Can't use the word boundaries: Grep ;; doesn't always agree with the language ;; syntax on those. - (format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)" - (oref tool searchfor))))) + (if (equal grep-program "rg") + (format "(^|\\W)%s(\\W|$)" + (oref tool searchfor)) + (format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)" + (oref tool searchfor)))))) ;; Misc (b (get-buffer-create "*Semantic SymRef*")) (ans nil)