X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/blobdiff_plain/91dba4e4faf4822fa6869df6bbd44ac033d7c355..cc1980e1db0ae091fe1a80797a7cfe63ed884bf9:/dot-emacs.el diff --git a/dot-emacs.el b/dot-emacs.el index 0d27f52..f687acb 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -1414,6 +1414,67 @@ (defun mdw-fontify-python () (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" '(0 mdw-punct-face)))))) +;;;----- Icon programming style --------------------------------------------- + +;; --- Icon indentation style --- + +(setq icon-brace-offset 0 + icon-continued-brace-offset 0 + icon-continued-statement-offset 2 + icon-indent-level 2) + +;; --- Define Icon fontification style --- + +(defun mdw-fontify-icon () + + ;; --- Miscellaneous fiddling --- + + (mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)") + + ;; --- Now define fontification things --- + + (make-local-variable 'font-lock-keywords) + (let ((icon-keywords + (mdw-regexps "break" "by" "case" "create" "default" "do" "else" + "end" "every" "fail" "global" "if" "initial" + "invocable" "link" "local" "next" "not" "of" + "procedure" "record" "repeat" "return" "static" + "suspend" "then" "to" "until" "while")) + (preprocessor-keywords + (mdw-regexps "define" "else" "endif" "error" "ifdef" "ifndef" + "include" "line" "undef"))) + (setq font-lock-keywords + (list + + ;; --- Set up the keywords defined above --- + + (list (concat "\\<\\(" icon-keywords "\\)\\>") + '(0 font-lock-keyword-face)) + + ;; --- The things that Icon calls keywords --- + + (list "&\\sw+\\>" '(0 font-lock-variable-name-face)) + + ;; --- At least numbers are simpler than C --- + + (list (concat "\\<[0-9]+" + "\\([rR][0-9a-zA-Z]+\\|" + "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\)\\>\\|" + "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\>") + '(0 mdw-number-face)) + + ;; --- Preprocessor --- + + (list (concat "^[ \t]*$[ \t]*\\<\\(" + preprocessor-keywords + "\\)\\>") + '(0 font-lock-keyword-face)) + + ;; --- And anything else is punctuation --- + + (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" + '(0 mdw-punct-face)))))) + ;;;----- ARM assembler programming configuration ---------------------------- ;; --- There doesn't appear to be an Emacs mode for this yet ---