wakatime / wakatime-mode

Emacs plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/emacs
267 stars 41 forks source link

Simplify wakatime-find-binary with locate-file. #71

Open rakino opened 11 months ago

rakino commented 11 months ago

I have converted the conditions into a list of paths to be used for locate-file (which is what executable-find uses).

"wakatime-cli-windows-amd64.exe" is handled in the form of a "-windows-amd64.exe" suffix, but the change has not been tested on Windows.

Since I have added exec-path and exec-suffixes to the paths and suffixes, there's no need to call executable-find separately.

rakino commented 11 months ago

I think it's better not to fallback to PROGRAM in wakatime-find-binary, since it has been searched in all possible paths. Returning a value in such a case would also prevent the wakatime-prompt-cli-path call.