2010-05-13 Stefan Monnier <monnier@iro.umontreal.ca>
+ * 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.
;; 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.
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)
"sh")
(t
sh-shell-file))
- nil nil)
- (run-mode-hooks 'sh-mode-hook))
+ nil nil))
;;;###autoload
(defalias 'shell-script-mode 'sh-mode)