changeset 23341:d29b6b51866f

(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.
author Richard M. Stallman <rms@gnu.org>
date Mon, 28 Sep 1998 13:31:53 +0000
parents 6df1b016f5fc
children 8cc9aa86ee9d
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Mon Sep 28 11:52:53 1998 +0000
+++ b/lisp/progmodes/sh-script.el	Mon Sep 28 13:31:53 1998 +0000
@@ -194,6 +194,8 @@
 
 (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 @@
 				      (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 @@
 	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