el/dot-emacs.el (apcalc-mode): Use the proper major-mode machinery.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 28 Apr 2016 12:15:33 +0000 (13:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 28 Apr 2016 12:18:18 +0000 (13:18 +0100)
el/dot-emacs.el

index 6d9e2f0..bb8ccaa 100644 (file)
@@ -1669,12 +1669,8 @@ doesn't match any of the regular expressions in
 ;;;--------------------------------------------------------------------------
 ;;; AP calc mode.
 
-(defun apcalc-mode ()
-  (interactive)
-  (c-mode)
-  (setq major-mode 'apcalc-mode)
-  (setq mode-name "AP Calc")
-  (run-hooks 'apcalc-mode-hook))
+(define-derived-mode apcalc-mode c-mode "AP Calc"
+  "Major mode for editing Calc code.")
 
 (defun mdw-fontify-apcalc ()