summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-09-28 13:31:53 +0000
committerRichard M. Stallman <rms@gnu.org>1998-09-28 13:31:53 +0000
commitc8b88e9f92c4d86237fe26550e8aefa5858852fd (patch)
tree5390fb9829af2a26a414596609feda3ef8a7ec70 /lisp/progmodes
parentd7af002f653f49bfcd5d96995ffaa5da4ab87945 (diff)
downloademacs-c8b88e9f92c4d86237fe26550e8aefa5858852fd.tar.gz
(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.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/sh-script.el14
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.")
(defun sh-canonicalize-shell (shell)
"Convert a shell name SHELL to the one we should handle it as."
+ (if (string-match "\.exe\\'" shell)
+ (setq shell (substring shell 0 (match-beginning 0))))
(or (symbolp shell)
(setq shell (intern shell)))
(or (cdr (assq shell sh-alias-alist))
@@ -830,6 +832,8 @@ Calls the value of `sh-set-shell-hook' if set."
(lambda (x) (eq (cdr x) 'sh-mode)))
(eq executable-query 'function)
t))
+ (if (string-match "\.exe\\'" shell)
+ (setq shell (substring shell 0 (match-beginning 0))))
(setq sh-shell (intern (file-name-nondirectory shell))
sh-shell (or (cdr (assq sh-shell sh-alias-alist))
sh-shell))
@@ -847,13 +851,13 @@ Calls the value of `sh-set-shell-hook' if set."
sh-shell-variables nil
sh-shell-variables-initialized nil
imenu-generic-expression (sh-feature sh-imenu-generic-expression)
- imenu-case-fold-search nil
- shell (sh-feature sh-variables))
+ imenu-case-fold-search nil)
(set-syntax-table (or (sh-feature sh-mode-syntax-table)
(standard-syntax-table)))
- (while shell
- (sh-remember-variable (car shell))
- (setq shell (cdr shell)))
+ (let ((vars (sh-feature sh-variables)))
+ (while vars
+ (sh-remember-variable (car vars))
+ (setq vars (cdr vars))))
;; Packages should not need to toggle Font Lock mode. sm.
; (and (boundp 'font-lock-mode)
; font-lock-mode