diff options
| author | Richard M. Stallman | 1998-09-28 13:31:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-09-28 13:31:53 +0000 |
| commit | c8b88e9f92c4d86237fe26550e8aefa5858852fd (patch) | |
| tree | 5390fb9829af2a26a414596609feda3ef8a7ec70 | |
| parent | d7af002f653f49bfcd5d96995ffaa5da4ab87945 (diff) | |
| download | emacs-c8b88e9f92c4d86237fe26550e8aefa5858852fd.tar.gz emacs-c8b88e9f92c4d86237fe26550e8aefa5858852fd.zip | |
(sh-set-shell): Remove .exe suffix from shell name.
Don't reuse local var `shell' for two different things.
(sh-canonicalize-shell): Remove .exe suffix from shell name.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index acae86db2f3..472eb53951b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -194,6 +194,8 @@ the car and cdr are the same symbol.") | |||
| 194 | 194 | ||
| 195 | (defun sh-canonicalize-shell (shell) | 195 | (defun sh-canonicalize-shell (shell) |
| 196 | "Convert a shell name SHELL to the one we should handle it as." | 196 | "Convert a shell name SHELL to the one we should handle it as." |
| 197 | (if (string-match "\.exe\\'" shell) | ||
| 198 | (setq shell (substring shell 0 (match-beginning 0)))) | ||
| 197 | (or (symbolp shell) | 199 | (or (symbolp shell) |
| 198 | (setq shell (intern shell))) | 200 | (setq shell (intern shell))) |
| 199 | (or (cdr (assq shell sh-alias-alist)) | 201 | (or (cdr (assq shell sh-alias-alist)) |
| @@ -830,6 +832,8 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 830 | (lambda (x) (eq (cdr x) 'sh-mode))) | 832 | (lambda (x) (eq (cdr x) 'sh-mode))) |
| 831 | (eq executable-query 'function) | 833 | (eq executable-query 'function) |
| 832 | t)) | 834 | t)) |
| 835 | (if (string-match "\.exe\\'" shell) | ||
| 836 | (setq shell (substring shell 0 (match-beginning 0)))) | ||
| 833 | (setq sh-shell (intern (file-name-nondirectory shell)) | 837 | (setq sh-shell (intern (file-name-nondirectory shell)) |
| 834 | sh-shell (or (cdr (assq sh-shell sh-alias-alist)) | 838 | sh-shell (or (cdr (assq sh-shell sh-alias-alist)) |
| 835 | sh-shell)) | 839 | sh-shell)) |
| @@ -847,13 +851,13 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 847 | sh-shell-variables nil | 851 | sh-shell-variables nil |
| 848 | sh-shell-variables-initialized nil | 852 | sh-shell-variables-initialized nil |
| 849 | imenu-generic-expression (sh-feature sh-imenu-generic-expression) | 853 | imenu-generic-expression (sh-feature sh-imenu-generic-expression) |
| 850 | imenu-case-fold-search nil | 854 | imenu-case-fold-search nil) |
| 851 | shell (sh-feature sh-variables)) | ||
| 852 | (set-syntax-table (or (sh-feature sh-mode-syntax-table) | 855 | (set-syntax-table (or (sh-feature sh-mode-syntax-table) |
| 853 | (standard-syntax-table))) | 856 | (standard-syntax-table))) |
| 854 | (while shell | 857 | (let ((vars (sh-feature sh-variables))) |
| 855 | (sh-remember-variable (car shell)) | 858 | (while vars |
| 856 | (setq shell (cdr shell))) | 859 | (sh-remember-variable (car vars)) |
| 860 | (setq vars (cdr vars)))) | ||
| 857 | ;; Packages should not need to toggle Font Lock mode. sm. | 861 | ;; Packages should not need to toggle Font Lock mode. sm. |
| 858 | ; (and (boundp 'font-lock-mode) | 862 | ; (and (boundp 'font-lock-mode) |
| 859 | ; font-lock-mode | 863 | ; font-lock-mode |