(goto-char (point-min))
(forward-line (1- line))
- ;; Search forward for the matching text
- (when (re-search-forward (regexp-quote searchtxt)
+ ;; Search forward for the matching text.
+ ;; FIXME: This still fails if the regexp uses something specific
+ ;; to the extended syntax, like grouping.
+ (when (re-search-forward (if (memq searchtype '(regexp tagregexp))
+ searchtxt
+ (regexp-quote searchtxt))
(point-at-eol)
t)
(goto-char (match-beginning 0))
"Perform a search with Grep."
;; Grep doesn't support some types of searches.
(let ((st (oref tool :searchtype)))
- (when (not (eq st 'symbol))
+ (when (not (memq st '(symbol regexp)))
(error "Symref impl GREP does not support searchtype of %s" st))
)
;; Find the root of the project, and do a find-grep...
(filepattern (semantic-symref-derive-find-filepatterns))
;; Grep based flags.
(grepflags (cond ((eq (oref tool :resulttype) 'file)
- "-l ")
- (t "-n ")))
- (greppat (cond ((eq (oref tool :searchtype) 'regexp)
- (oref tool searchfor))
- (t
- (shell-quote-argument
+ "-l ")
+ ((eq (oref tool :searchtype) 'regexp)
+ "-nE ")
+ (t "-n ")))
+ (greppat (shell-quote-argument
+ (cond ((eq (oref tool :searchtype) 'regexp)
+ (oref tool searchfor))
+ (t
(concat "\\<" (oref tool searchfor) "\\>")))))
;; Misc
(b (get-buffer-create "*Semantic SymRef*"))