Skip to content

Instantly share code, notes, and snippets.

@epost
Last active June 15, 2017 00:13
Show Gist options
  • Save epost/3e1fd232e0a182f5b4ef580d3e788b95 to your computer and use it in GitHub Desktop.
Save epost/3e1fd232e0a182f5b4ef580d3e788b95 to your computer and use it in GitHub Desktop.
emacs mode for AQL specifications
;; Usage:
;; `(add-to-list 'auto-mode-alist '("\\.aql\\'" . aql-mode))`
;;
;; References:
;; - http://www.wilfred.me.uk/blog/2015/03/19/adding-a-new-language-to-emacs/
;; - https://www.emacswiki.org/emacs/EmacsSyntaxTable
(defconst aql-mode-syntax-table
(let ((table (make-syntax-table java-mode-syntax-table)))
;; # is punctuation, but // is a comment starter
(modify-syntax-entry ?/ ". 12" table)
;; \n is a comment ender
(modify-syntax-entry ?\n ">" table)
table))
(setq aql-highlights
'(("pragma\\|typeside\\|schema\\|literal\\|exec_jdbc\\|entities\\|foreign_keys\\|attributes\\|:\\|->" . font-lock-keyword-face)
))
(define-derived-mode aql-mode fundamental-mode "aql"
"major mode for editing AQL (Algebraic Query Language) specifications."
:syntax-table aql-mode-syntax-table
(setq font-lock-defaults '(aql-highlights)))
(provide 'aql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment