Add autoload cookies to gdscript-mode.el

When installing packages from a package-manager, this will help defer execution
and loading of the package until the corresponding symbols are actually called.*

*At least, if I understood this correctly.
This commit is contained in:
Nathan Lovato
2020-02-15 19:54:36 -06:00
parent 2e31a15c95
commit 98274b4b52

View File

@@ -42,8 +42,11 @@
(if (version< emacs-version "27")
(require 'gdscript-rx))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.gd\\'" . gdscript-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.tscn\\'" . conf-toml-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.tres\\'" . conf-toml-mode))
(defvar gdscript-mode-map (let ((map (make-sparse-keymap)))
@@ -124,6 +127,7 @@ the last command event was a string delimiter."
(save-excursion
(insert (make-string 2 last-command-event)))))
;;;###autoload
(define-derived-mode gdscript-mode prog-mode "gdscript"
"Major mode for editing Godot GDScript files."
(setq-local tab-width gdscript-tab-width)