Use magic comments for autoloads in Emacs mode file

Also automatically trigger the mode for files with the .mod extension.
time-shift
Sébastien Villemot 2017-07-25 16:26:21 +02:00
parent 209e16888d
commit 47c2fa3610
1 changed files with 6 additions and 3 deletions

View File

@ -28,8 +28,6 @@
;; add this to your .emacs or site-init.el file:
;;
;; (require 'dynare)
;; (autoload 'dynare-mode "dynare" "Enter dynare mode." t)
;; (setq auto-mode-alist (cons '("\\.mod\\'" . dynare-mode) auto-mode-alist))
;;; Commentary:
;;
@ -107,7 +105,8 @@ For detail, see `comment-dwim'."
("(\\(+\\|-\\)[1-9])" . font-lock-constant-face)
))
;; define the major mode
;;; define the major mode
;;;###autoload
(define-derived-mode dynare-mode fundamental-mode
"dynare mode"
"dynare is a mode for editing mod files used by dynare."
@ -149,5 +148,9 @@ For detail, see `comment-dwim'."
(setq dynare-functions-regexp nil)
)
;;; mode trigger
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.mod$" . dynare-mode))
(provide 'dynare)
;;; dynare.el ends here