:group 'semantic
:type 'string)
+(defun semantic-symref-grep--quote-extended (string)
+ "Quote STRING as an extended-syntax regexp."
+ (replace-regexp-in-string (rx (in ".^$*+?|{}[]()|\\"))
+ (lambda (s) (concat "\\" s))
+ string nil t))
+
(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep))
"Perform a search with Grep."
;; Grep doesn't support some types of searches.
((eq (oref tool searchtype) 'regexp)
"-nE ")
(t "-nw ")))
- (greppat (oref tool searchfor))
+ (searchfor (oref tool searchfor))
+ (greppat (if (eq (oref tool searchtype) 'regexp)
+ searchfor
+ (semantic-symref-grep--quote-extended searchfor)))
;; Misc
(b (get-buffer-create "*Semantic SymRef*"))
(ans nil)