From: Stefan Monnier Date: Thu, 13 May 2010 00:44:22 +0000 (-0400) Subject: * progmodes/sh-script.el (sh-mode): Use define-derived-mode. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~211^2^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=791ffe1ce251f03d8cd51b4f67b56b975bd12083;p=emacs.git * progmodes/sh-script.el (sh-mode): Use define-derived-mode. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 45f1167412a..4b73a4fd6df 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2010-05-13 Stefan Monnier + * progmodes/sh-script.el (sh-mode): Use define-derived-mode. + * dos-fns.el: Add "dos-" prefix for namespace control. (convert-standard-filename): Define as alias for dos-convert-standard-filename but only if applicable. diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 610fa14489a..eca6d5fbe7b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1480,7 +1480,7 @@ frequently editing existing scripts with different styles.") ;; mode-command and utility functions ;;;###autoload -(defun sh-mode () +(define-derived-mode sh-mode prog-mode "Shell-script" "Major mode for editing shell scripts. This mode works for many shells, since they all have roughly the same syntax, as far as commands, arguments, variables, pipes, comments etc. are concerned. @@ -1533,11 +1533,6 @@ indicate what shell it is use `sh-alias-alist' to translate. If your shell gives error messages with line numbers, you can use \\[executable-interpret] with your script for an edit-interpret-debug cycle." - (interactive) - (kill-all-local-variables) - (setq major-mode 'sh-mode - mode-name "Shell-script") - (use-local-map sh-mode-map) (make-local-variable 'skeleton-end-hook) (make-local-variable 'paragraph-start) (make-local-variable 'paragraph-separate) @@ -1613,8 +1608,7 @@ with your script for an edit-interpret-debug cycle." "sh") (t sh-shell-file)) - nil nil) - (run-mode-hooks 'sh-mode-hook)) + nil nil)) ;;;###autoload (defalias 'shell-script-mode 'sh-mode)