From 2faf8bddbdab9269010f479d4be7febb86925787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?=
 <sebastien.villemot@sciencespo.fr>
Date: Tue, 25 Jul 2017 16:26:21 +0200
Subject: [PATCH] Use magic comments for autoloads in Emacs mode file

Also automatically trigger the mode for files with the .mod extension.

(cherry picked from commit 47c2fa361039035244bf7c9e0d55e322b6bfcf05)
---
 scripts/dynare.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/dynare.el b/scripts/dynare.el
index 839b89eb2..82d9713a3 100644
--- a/scripts/dynare.el
+++ b/scripts/dynare.el
@@ -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
-- 
GitLab