# HG changeset patch # User Stefan Monnier # Date 1273711462 14400 # Node ID 6985fcf16f42339702a408df7a51141383989b8d # Parent a4cdc6d33cc6f1973dc0a54ec7cb91193f5ad9bb * progmodes/sh-script.el (sh-mode): Use define-derived-mode. diff -r a4cdc6d33cc6 -r 6985fcf16f42 lisp/ChangeLog --- a/lisp/ChangeLog Wed May 12 20:35:07 2010 -0400 +++ b/lisp/ChangeLog Wed May 12 20:44:22 2010 -0400 @@ -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 -r a4cdc6d33cc6 -r 6985fcf16f42 lisp/progmodes/sh-script.el --- a/lisp/progmodes/sh-script.el Wed May 12 20:35:07 2010 -0400 +++ b/lisp/progmodes/sh-script.el Wed May 12 20:44:22 2010 -0400 @@ -1480,7 +1480,7 @@ ;; 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 @@ 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 @@ "sh") (t sh-shell-file)) - nil nil) - (run-mode-hooks 'sh-mode-hook)) + nil nil)) ;;;###autoload (defalias 'shell-script-mode 'sh-mode)