commit 962671ab1afe4e13c1440310ca30348e7afe208a from: Omar Polo date: Sat Nov 06 22:24:17 2021 UTC rewrite the mode with define-derived-mode This way we can inherit from prog-mode. While here also set comment-start and comment-stop. commit - a6ba7179f8cadd07d59b89c399332e04f167e116 commit + 962671ab1afe4e13c1440310ca30348e7afe208a blob - 8ec4a933e26d33448d72d49921437a19fbfe1d02 blob + 179cf7b4f4880b2f7f7050c77dfe5a492649d649 --- algol-mode.el +++ algol-mode.el @@ -204,19 +204,13 @@ (a68-within-string)) (a68-indent-line))) -(defun algol-mode () - "Major mode for editing Algol 68 files." - (interactive) - (kill-all-local-variables) - (set-syntax-table a68-mode-syntax-table) - (use-local-map a68-mode-map) - (set (make-local-variable 'font-lock-defaults) - '(a68-font-lock-keywords)) - (set (make-local-variable 'indent-line-function) - 'a68-indent-line) - (setq major-mode 'a68-mode) - (setq mode-name "Algol68") - (run-hooks 'a68-mode-hooks)) +;;;###autoload +(define-derived-mode a68-mode prog-mode "Algol68" + "Major mode for editing Alogl68 files." + (setq-local font-lock-defaults '(a68-font-lock-keywords)) + (setq-local indent-line-function #'a68-indent-line) + (setq-local comment-start "#") + (setq-local comment-stop "#")) (provide 'algol-mode) ;;; algol-mode.el ends here