emacsorphanage / helm-ag

The silver searcher with helm interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to highlight helm-ag result in buffers opened by the follow-mode?

taquangtrung opened this issue · comments

  • Emacs version: 26.3
  • Operating system: Linux Mint 19.2
  • Search command: ag, version 2.1.0
  • Last value of helm-ag--last-command
("ag" "--nocolor" "--nogroup" "--ignore=.#*" "--ignore=*.cmxs" "--ignore=*.cmti"
"--ignore=*.cmt" "--ignore=*.annot" "--ignore=*.cmi" "--ignore=*.cmxa" "--ignore=*.cma" "--ignore=*.cmx" "--ignore=*.cmo" "--ignore=*.pho" "--ignore=*.phi" "--ignore=*.glob" "--ignore=*.vo" "--ignore=*.hi" "--ignore=*.o" "--ignore=*~" "--ignore=*.bin" "--ignore=*.lbin" "--ignore=*.so"
"--ignore=*.a" "--ignore=*.ln" "--ignore=*.blg" "--ignore=*.bbl" "--ignore=*.elc" "--ignore=*.lof" "--ignore=*.glo" "--ignore=*.idx" "--ignore=*.lot" "--ignore=*.fmt" "--ignore=*.tfm" "--ignore=*.class"
"--ignore=*.fas" "--ignore=*.lib" "--ignore=*.mem" "--ignore=*.x86f" "--ignore=*.sparcf" "--ignore=*.dfsl" "--ignore=*.pfsl" "--ignore=*.d64fsl" "--ignore=*.p64fsl" "--ignore=*.lx64fsl" "--ignore=*.lx32fsl" "--ignore=*.dx64fsl" "--ignore=*.dx32fsl" "--ignore=*.fx64fsl"
"--ignore=*.fx32fsl" "--ignore=*.sx64fsl" "--ignore=*.sx32fsl" "--ignore=*.wx64fsl" "--ignore=*.wx32fsl" "--ignore=*.fasl" "--ignore=*.ufsl" "--ignore=*.fsl" "--ignore=*.dxl" "--ignore=*.lo" "--ignore=*.la"
"--ignore=*.gmo" "--ignore=*.mo" "--ignore=*.toc" "--ignore=*.aux" "--ignore=*.cp" "--ignore=*.fn" "--ignore=*.ky" "--ignore=*.pg" "--ignore=*.tp" "--ignore=*.vr" "--ignore=*.cps" "--ignore=*.fns" "--ignore=*.kys" "--ignore=*.pgs" "--ignore=*.tps" "--ignore=*.vrs" "--ignore=*.pyc" "--ignore=*.pyo" "--ignore=SCCS" "--ignore=RCS" "--ignore=CVS" "--ignore=MCVS" "--ignore=.src" "--ignore=.svn" "--ignore=.git" "--ignore=.hg" "--ignore=.bzr" "--ignore=_MTN" "--ignore=_darcs" "--ignore={arch}"
"module")

Actual behavior

When the follow-mode is enabled, helm-ag results are not highlighted in buffers opened by the follow-mode.

When I tested with both Spacemacs and the vanilla Emacs with only helm-ag installed, the same behavior occurs.

Here is the screenshot in my vanilla Emacs. The matched string module in the buffer proof_nonentail.ml is not highlighted.

helm-ag

Expected behavior

It would be nice if helm-ag results are also highlighted in each buffer opened by the follow-mode. I saw that previously, this behavior is possible, such as the screenshot in this issue.

#209

Steps to reproduce

Use helm-do-ag command and use C-c C-f to enable the follow-mode

Do you install any Ocaml packages ? Emacs does not support Ocaml(or similar ML language) and opens .ml file with lisp-mode by default. Please install ocaml packages via package manager and try again. auto-mode-alist has following value if you configura Ocaml language correctly.

("\\.ml[ip]?\\'" . tuareg-mode)

You can test manually with following configuration too.

(add-to-list 'auto-mode-alist '("\\.ml[ip]?\\'" . tuareg-mode))

Thanks for the reply. The problem still occurs when tuareg-mode is enabled.

Here is the screenshot in my vanilla Emacs. I also encounter the same issue in Spacemacs.

helm-ag2

Sorry I misunderstood.

I suppose your expected feature does not implement neither helm-ag nor helm, however launching isearch-forward or similar commands(or Ctrl-s or Ctrl-r) before inputting narrowing keyword word highlights buffers which is opened by helm-follow-mode.

  1. M-x helm-ag
  2. Input some query
  3. Enable follow mode by Ctrl-c Ctrl-f
  4. Ctrl-s(isearch-forward)
  5. Input module
  6. then highlight module in buffer

I followed your previous tutorial, but at step 4, C-s is not defined.

Somehow this feature appeared in the latter part of this GIF screenshot of yours, posted in this issue #209.

helm-ag

I also see a similar feature in helm-grep.

Ah, I understand its feature. I'll send PR later, please wait for a while.

Great! Thanks a lot for your quick responses.

#361 has been merged. Please check latest version

@syohex Thanks again! :)

@taquangtrung Can you check if this feature is resolved? Thanks! 😄

@syohex Many thanks for the update. I'm impressed with the fix in lighting speed.

@jcs090218 Yes, it works perfectly fine.

Close this issue now! :)