X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/162d33499592d12d7c9f44c1a66f40b073eef16b..55f80fae9a56f8f915c1deb305f8c4b2e628665b:/dot-emacs.el diff --git a/dot-emacs.el b/dot-emacs.el index 1596f11..d94f962 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -726,6 +726,11 @@ the regular expressions in `mdw-backup-disable-regexps'." ;; --- Make C indentation nice --- +(eval-after-load "cc-mode" + '(progn + (define-key c-mode-map "*" nil) + (define-key c-mode-map "/" nil))) + (defun mdw-c-style () (c-add-style "[mdw] C and C++ style" '((c-basic-offset . 2) @@ -1586,6 +1591,41 @@ strip numbers instead." (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" '(0 mdw-punct-face)))))) +;;;----- Erlang configuration ----------------------------------------------- + +(setq erlang-electric-commannds + '(erlang-electric-newline erlang-electric-semicolon)) + +(defun mdw-fontify-erlang () + + ;; --- Set fill prefix --- + + (mdw-standard-fill-prefix "\\([ \t]*{?%*[ \t]*\\)") + + ;; --- Fiddle with fontification --- + + (make-local-variable 'font-lock-keywords) + (let ((erlang-keywords + (mdw-regexps "after" "and" "andalso" + "band" "begin" "bnot" "bor" "bsl" "bsr" "bxor" + "case" "catch" "cond" + "div" "end" "fun" "if" "let" "not" + "of" "or" "orelse" + "query" "receive" "rem" "try" "when" "xor"))) + + (setq font-lock-keywords + (list + (list "%.*$" + '(0 font-lock-comment-face)) + (list (concat "\\<\\(" erlang-keywords "\\)\\>") + '(0 font-lock-keyword-face)) + (list (concat "^-\\sw+\\>") + '(0 font-lock-keyword-face)) + (list "\\<[0-9]+\\(\\|#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)\\>" + '(0 mdw-number-face)) + (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" + '(0 mdw-punct-face)))))) + ;;;----- Texinfo configuration ---------------------------------------------- (defun mdw-fontify-texinfo () @@ -1630,6 +1670,7 @@ strip numbers instead." (defun mdw-fontify-tex () (setq ispell-parser 'tex) + (turn-on-reftex) ;; --- Don't make maths into a string ---