]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/asm-mode.el (asm-mode): Use define-derived-mode.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 15 May 2010 04:10:22 +0000 (00:10 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 15 May 2010 04:10:22 +0000 (00:10 -0400)
lisp/ChangeLog
lisp/progmodes/asm-mode.el

index 32785d928cc3c3c279eade9137b9162716e6b964..047d0d640e69302380f0471f26e781160f108b62 100644 (file)
@@ -1,5 +1,6 @@
 2010-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * progmodes/asm-mode.el (asm-mode):
        * progmodes/prolog.el (prolog-mode): Use define-derived-mode.
 
        * pcomplete.el (pcomplete-completions-at-point): New function,
index 0ce7d780d1fbae52d0dd66b8af959e8e7eb2ba37..f5fef76a009a4085b707bdf5238729695b5c1af3 100644 (file)
   "Additional expressions to highlight in Assembler mode.")
 
 ;;;###autoload
-(defun asm-mode ()
+(define-derived-mode asm-mode prog-mode "Assembler"
   "Major mode for editing typical assembler code.
 Features a private abbrev table and the following bindings:
 
@@ -128,13 +128,8 @@ Turning on Asm mode runs the hook `asm-mode-hook' at the end of initialization.
 
 Special commands:
 \\{asm-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (setq mode-name "Assembler")
-  (setq major-mode 'asm-mode)
   (setq local-abbrev-table asm-mode-abbrev-table)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(asm-font-lock-keywords))
+  (set (make-local-variable 'font-lock-defaults) '(asm-font-lock-keywords))
   (set (make-local-variable 'indent-line-function) 'asm-indent-line)
   ;; Stay closer to the old TAB behavior (was tab-to-tab-stop).
   (set (make-local-variable 'tab-always-indent) nil)
@@ -157,8 +152,7 @@ Special commands:
   (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
   (make-local-variable 'comment-end)
   (setq comment-end "")
-  (setq fill-prefix "\t")
-  (run-mode-hooks 'asm-mode-hook))
+  (setq fill-prefix "\t"))
 
 (defun asm-indent-line ()
   "Auto-indent the current line."