redguardtoo / emacs.d

Fast and robust Emacs setup.
http://blog.binchen.org
GNU General Public License v3.0
2.39k stars 619 forks source link

Searching large pdf files reports only matched or not, not matched texts. #1005

Open TooChaos opened 1 year ago

TooChaos commented 1 year ago

Hi Chen Bin,

It looks like the default incremental search behaviour is, for large file, using 'grep' instead of emacs' native search function. However, 'grep' treats the pdf file as a binary file by default, hence reports only matched or not. Can we, e.g., pass "--text" flag to "grep" when the file is pdf. Or simply fall back to emacs' native search function? Thanks!

redguardtoo commented 1 year ago

which command you use in Emacs?

TooChaos commented 1 year ago

C-s runs the command counsel-grep-or-swiper (found in global-map), which is an autoloaded interactive compiled Lisp function in ‘counsel.el’. It is bound to C-s. (counsel-grep-or-swiper &optional INITIAL-INPUT)

By the way I am using pdftools mode. Thanks!