(concat "(" (buffer-string) ")")))))))
(cdr (assq sym mdw-config)))
+;; --- Set up the load path convincingly ---
+
+(dolist (dir (append (and (boundp 'debian-emacs-flavor)
+ (list (concat "/usr/share/"
+ (symbol-name debian-emacs-flavor)
+ "/site-lisp")))))
+ (dolist (sub (directory-files dir t))
+ (when (and (file-accessible-directory-p sub)
+ (not (member sub load-path)))
+ (setq load-path (nconc load-path (list sub))))))
+
;; --- Is an Emacs library available? ---
(defun library-exists-p (name)
(auto-fill-mode 1)
(setq fill-column 77)
(setq show-trailing-whitespace t)
+ (and (fboundp 'gtags-mode)
+ (gtags-mode))
(outline-minor-mode t)
(mdw-set-font))
+(eval-after-load 'gtags
+ '(dolist (key '([mouse-2] [mouse-3]))
+ (define-key gtags-mode-map key nil)))
+
;; --- Set up all sorts of faces ---
(defvar mdw-set-font nil)
;; --- 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)
(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 ()
(defun mdw-fontify-tex ()
(setq ispell-parser 'tex)
+ (turn-on-reftex)
;; --- Don't make maths into a string ---