- (let* ((grep-expand-keywords semantic-symref-grep-expand-keywords)
- (cmd (grep-expand-template grep-find-template
- greppattern
- filepattern
- rootdir)))
- ;; For some reason, my default has no <D> in it.
+ (let* ((grepflags flags)
+ (greppattern pattern)
+ (grep-expand-keywords semantic-symref-grep-expand-keywords)
+ (cmd (grep-expand-template
+ (if (memq system-type '(windows-nt ms-dos))
+ ;; grep-find uses '--color=always' on MS-Windows
+ ;; because it wants the colorized output, to show
+ ;; it to the user. By contrast, here we don't show
+ ;; the output, and the SGR escapes get in the way
+ ;; of parsing the output.
+ (replace-regexp-in-string "--color=always" ""
+ grep-find-template t t)
+ grep-find-template)
+ greppattern
+ filepattern
+ rootdir)))
+ ;; http://debbugs.gnu.org/20719