1

I'm trying to integrate Ack in Emacs. All is fine on Linux, but I need to make it work on Windows too.

My ack is already installed (somewhere on %PATH%) and working correctly . Rather, I should say my ack.pl is working correctly because Windows relies on file extensions to know how to deal with files. I used the file association explained here

Within emacs though, there is something I can't get to work. ack.el for example, tries to locate ack using (executable-find "ack")

On Windows, however, exec-suffixes is set to (".exe" ".com" ".bat" ".cmd" ".btm" "") by default, so of course it doesn't find my ack.pl

Naively I was hoping that the below would work:

(add-to-list 'exec-suffixes ".pl")
(executable-find "ack")

But it doesn't do the trick an returns nil.... The first question is: why is that ? How to make it work ?

And the second question perhaps: is there a better way to integrate Ack in Emacs on Windows ?

Thanks

Edit: I'm using the latest and greatest Emacs 27.1

Drew
  • 29,895
  • 7
  • 74
  • 104
DaveC
  • 115
  • 8
  • Doesn't really answer any of my questions but if, next to my `ack.pl`, I create a `ack.cmd` then `(executable-find "ack")` does locate it successfully. This `ack.cmd` only contains `ack.pl %*` so is fully transparent. For some reason however it's not enough to keep [ack.el](https://github.com/leoliu/ack-el) happy.... – DaveC Feb 20 '21 at 03:51
  • [pl2bat](https://metacpan.org/pod/distribution/perl/win32/bin/pl2bat.pl) might be useful. - It should be installed if you are using strawberryperl. – clamp Feb 20 '21 at 15:33
  • Thanks very much for that link, really interesting ! I didn't know about `%PathExt%`. Also I didn't realize the disadvantages method 4 & 5, namely that you can't use them in pipelines nor with file redirection... I suppose the same applies to my trick with `ack.cmd` otherwise they wouldn't have bothered writing pl2bat.... – DaveC Feb 21 '21 at 17:52

0 Answers0