;;; d-flock-coding-preferences.el --- Uses Hungarian notation for fontification of global variables etc.
;; Copyright (C) 2014-2016 Davin Pearson
;; Emacs Lisp Archive Entry:
;; Filename: d-flock-coding-preferences.el
;; Author/Maintainer: Davin Pearson http://davin.50webs.com
;; Keywords: Current function method C, C++, Java, Emacs Lisp
;; Version: 1.0
;;; Commentary:
;; This file is not part of GNU Emacs.
;;; Limitation of Warranty
;; 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 detail.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs, see the file COPYING. If not, see:
;;
;; <http://www.gnu.org/licenses/gpl-3.0.txt>.
;;; Install Instructions:
;; See the following URL for the latest info and a tarball:
;;
;; <http://davin.50webs.com/research/2010/mopa2e2.html#d-flock-coding-preferences>
;;
;; Then untar the tarball to a folder pointed to by the Emacs variable
;; load-path and add the following line to your ~/.emacs file.
;;
;; (require 'd-flock-coding-preferences)
;;; Known Bugs:
;; None so far!
;;; Code:
(add-hook 'font-lock-mode-hook 'd-coding-prefs-font-lock-mode-hook 'APPEND)
(defun d-coding-prefs-font-lock-mode-hook ()
(if (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'java-mode))
(d-font-lock-add-end
'(
("\\<\\(global[a-zA-Z0-9_]*\\)" 0 global-face nil)
("\\<\\(GLOBAL[a-zA-Z0-9_]*\\)" 0 global-face nil)
("\\<\\(local[a-zA-Z0-9_]*\\)" 0 local-face nil)
("\\<\\(LOCAL[a-zA-Z0-9_]*\\)" 0 local-face nil)
("\\<\\(prop[a-zA-Z0-9_]*\\)" 0 prop-face nil)
("\\<\\(PROP[a-zA-Z0-9_]*\\)" 0 prop-face nil)
)))
(if (eq major-mode 'emacs-lisp-mode)
(d-font-lock-add-end
'(
("\\<\\(global[-a-zA-Z0-9_+]*\\)" 0 global-face nil)
("\\<\\(\\*[-+a-zA-Z0-9_<>!]+\\*\\)" 0 *global-face* nil)
("\\<\\(GLOBAL[-a-zA-Z0-9_+]*\\)" 0 global-face nil)
("\\<\\(local[-a-zA-Z0-9_+]*\\)" 0 local-face nil)
("\\<\\(LOCAL[-a-zA-Z0-9_+]*\\)" 0 local-face nil)
("\\<\\(prop[-a-zA-Z0-9_+]*\\)" 0 prop-face nil)
("\\<\\(PROP[-a-zA-Z0-9_+]*\\)" 0 prop-face nil)
)
)
)
(if (or (eq major-mode 'lisp++-mode)
(eq major-mode 'emacs-lisp-mode))
(d-font-lock-add-end
'(
("[a-z_]*_design_pattern\\>" 0 d-design-pattern-face t))))
)
(require 'd-make-face)
(defun d-flock-coding-preferences ()
(d-make-face global-face bg-colour "#008800" bold)
(d-make-face *global-face* bg-colour "#004400" bold)
(d-make-face local-face bg-colour "#f90" bold)
(d-make-face prop-face bg-colour "#f90" bold)
(d-make-face d-design-pattern-face "#f90" "#000" bold)
)
(d-flock-coding-preferences)
(provide 'd-flock-coding-preferences)
| Back |