szermatt / emacs-bash-completion

Add programmable bash completion to Emacs shell-mode
GNU General Public License v2.0
280 stars 33 forks source link

Set bash-completion-prog executable path dynamically #33

Closed Ambrevar closed 6 years ago

Ambrevar commented 6 years ago

Operating systems like NixOS or GuixSD don't store bash in /bin/bash, so this package won't work for them by default.

Using executable-find is enough to be portable:

(defcustom bash-completion-prog (executable-find "bash")
  "Name or path of the BASH executable to run for command-line completion.
This should be either an absolute path to the BASH executable or
the name of the bash command if it is on Emacs' PATH.  This
should point to a recent version of BASH (BASH 3) with support
for command-line completion."
  :type '(file :must-match t)
  :group 'bash-completion)
szermatt commented 6 years ago

I switched to executable-find, as you recommended. Thanks!

Ambrevar commented 6 years ago

Thanks!