(Emacs)+custom personalised ada-mode
The defautl ada-mode requires the installation of many different tools, the compilation of several different systems and much more. I wasn't able to fix all the issues with my installation so I decided to scrap it and make my own. This mode just colourises the buffer so far, but I hope to implement indentation shortly.
This commit is contained in:
66
Emacs/.config/emacs/ada-mode.el
Normal file
66
Emacs/.config/emacs/ada-mode.el
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
;;; ada-mode.el --- My custom ada-mode that colourises buffers -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2021 Aryadev Chavali
|
||||||
|
|
||||||
|
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
|
||||||
|
;; Keywords: faces, languages
|
||||||
|
|
||||||
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; This provides colourising for ada files. Is not compatible with
|
||||||
|
;; standard ada-mode due to name conflicts. Personally I'd rather
|
||||||
|
;; have a mode for colourising a buffer which is what this is supposed
|
||||||
|
;; to be.
|
||||||
|
|
||||||
|
;; I feel ada-mode™ (the official one) tries to do too many things at
|
||||||
|
;; once, so I want something that does the basics. Also want to take
|
||||||
|
;; this opportunity to make a new mode and what facilities Emacs
|
||||||
|
;; provides for it.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'generic-x)
|
||||||
|
|
||||||
|
(define-generic-mode ada-mode
|
||||||
|
'("--") ; Comments
|
||||||
|
'("abort" "else" "new" "return"
|
||||||
|
"abs" "elsif" "not" "reverse"
|
||||||
|
"abstract" "end" "null"
|
||||||
|
"accept" "entry" "select"
|
||||||
|
"access" "exception" "of" "separate"
|
||||||
|
"aliased" "exit" "or" "subtype"
|
||||||
|
"all" "others" "synchronized"
|
||||||
|
"and" "for" "out"
|
||||||
|
"array" "function" "overriding" "tagged"
|
||||||
|
"at" "task"
|
||||||
|
"generic" "package" "terminate"
|
||||||
|
"begin" "goto" "pragma" "then"
|
||||||
|
"body" "private" "type"
|
||||||
|
"if" "procedure"
|
||||||
|
"case" "in" "protected" "until"
|
||||||
|
"constant" "interface" "use"
|
||||||
|
"is" "raise"
|
||||||
|
"declare" "range" "when"
|
||||||
|
"delay" "limited" "record" "while"
|
||||||
|
"delta" "loop" "rem" "with"
|
||||||
|
"digits" "renames"
|
||||||
|
"do" "mod" "requeue" "xor") ; Keywords
|
||||||
|
nil
|
||||||
|
'("\\.ad\\(b\\|s\\)")
|
||||||
|
nil)
|
||||||
|
|
||||||
|
(provide 'ada-mode)
|
||||||
|
;;; ada-mode.el ends here
|
||||||
@@ -1697,6 +1697,16 @@ use the current buffer?) but it works out.
|
|||||||
:keymaps 'pdf-view-mode-map
|
:keymaps 'pdf-view-mode-map
|
||||||
"M-g" #'pdfgrep))
|
"M-g" #'pdfgrep))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
** Ada
|
||||||
|
Check out [[file:ada-mode.el][ada-mode*]], my custom ada-mode that replaces the default one.
|
||||||
|
This mode just colourises stuff, and uses eglot to do the heavy
|
||||||
|
lifting.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(load-file (concat user-emacs-directory "ada-mode.el"))
|
||||||
|
(with-eval-after-load "eglot"
|
||||||
|
(add-hook 'ada-mode-hook #'eglot))
|
||||||
|
#+end_src
|
||||||
** Org
|
** Org
|
||||||
*** Org Core Variables
|
*** Org Core Variables
|
||||||
Tons of variables for org-mode, including a ton of latex ones.
|
Tons of variables for org-mode, including a ton of latex ones.
|
||||||
|
|||||||
Reference in New Issue
Block a user