Function: sh-canonicalize-shell

sh-canonicalize-shell is a byte-compiled function defined in sh-script.el.gz.

Signature

(sh-canonicalize-shell SHELL)

Documentation

Convert a shell name SHELL to the one we should handle it as.

SHELL is a full path to the shell interpreter; return a shell name symbol.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sh-script.el.gz
(defun sh-canonicalize-shell (shell)
  "Convert a shell name SHELL to the one we should handle it as.
SHELL is a full path to the shell interpreter; return a shell
name symbol."
  (cl-loop
     with shell = (cond ((string-match "\\.exe\\'" shell)
                         (substring shell 0 (match-beginning 0)))
                        (t shell))
     with shell-base = (intern (file-name-nondirectory shell))
     for (key . value) in sh-alias-alist
     if (and (stringp key) (string-match key shell)) return value
     if (eq key shell-base) return value
     finally return shell-base))