Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ag-match-face can not propertize matched string #150

Open
nrsaty opened this issue Jul 26, 2018 · 1 comment
Open

ag-match-face can not propertize matched string #150

nrsaty opened this issue Jul 26, 2018 · 1 comment

Comments

@nrsaty
Copy link

nrsaty commented Jul 26, 2018

My environment:
Windows/10 + msys2
emacs 26.0.90
ag 2.1.0
ag-el 0.48

My ag seems not output ANSI color sequence when --vimgrep specified. So, ag-el can not colorize matched string in result buffer.

Example output in mintty.Command is as follows:
ag --vimgrep --literal --group --line-number --column -
-color --color-match '30;43' --color-path '1;32' --smart-case --stats
--el -- 'mode-line' .

Result:
without --vimgrep
ESC[1;32mw32-ime.elESC[0mESC[K
ESC[1;33m24ESC[0mESC[K:22:(defvar w32-ime-show-ESC[30;43mmode-lineESC[0mESC[K t
ESC[1;33m26ESC[0mESC[K:17:(defvar w32-ime-ESC[30;43mmode-lineESC[0mESC[K-state-indicator

with --vimgrep (which is neccesary for ag.el)
w32-ime.el:24:22:(defvar w32-ime-show-mode-line t
w32-ime.el:26:17:(defvar w32-ime-mode-line-state-indicator "[O]"

Obviously, this cause the problem. Does anybody resolve this?

@nrsaty nrsaty changed the title ag-match-face can not propertize mathed string ag-match-face can not propertize matched string Jul 26, 2018
@nrsaty
Copy link
Author

nrsaty commented Sep 23, 2018

I found a solution.
--vimgrep option is disturbing highlight, and it is introduced for issue 101 fix.
When using emacs on msys2, this fix did not needed.
Comment out following line from ag.el (from line 234-236), and everything worked normaly.

;; (when (or (eq system-type 'windows-nt) (eq system-type 'cygwin))
;;   ;; Use --vimgrep to work around issue #97 on Windows.
;;   (setq arguments (cons "--vimgrep" arguments)))

I am using self-build emacs on msys2.
Do not know about pre-build version on msys2 (installed by pacman).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant