GNU   davin.50webs.com/research
Bringing to you notes for the ages

       Main Menu          Research Projects         Photo Album            Curriculum Vitae      The Greatest Artists
    Email Address       Computer Games          Web Design          Java Training Wheels      The Fly (A Story)   
  Political Activism   Bob Dylan Quotes+       My Life Story          Smoking Cessation          Other Links      
Debugging Macros     String Class I     Linked List System I Java for C Programmers Naming Convention
    String Class II         How I use m4              Strings III                 Symmetrical I/O             Linked Lists II     
Run-Time Type Info   Virtual Methods      An Array System        Science & Religion            Submodes       
  Nested Packages      Memory Leaks    Garbage Collection      Internet & Poverty      What is Knowledge?
Limits of Evolution   Emacs Additions      Function Plotter           Romantic Love        The Next Big Thing
    Science Fiction     Faster Compilation Theory of Morality         Elisp Scoping               Elisp Advice      
  S.O.G.M. Pattern       Safe Properties         School Bullying          Charisma Control          Life and Death    
     Splitting Java          Multiple Ctors       Religious Beliefs         Conversation 1           Conversation 2    
   J.T.W. Language    Emacs Additions II      Build Counter             Relation Plotter          Lisp++ Language  
  Memory Leaks II   Super Constructors CRUD Implementation Order a Website Form There Is An Afterlife
More Occam's Razor C to Java Translator Theory of Morality II


d-flock-coding-preferences.el

    

;;; 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 Max 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
       '(
         ("[^a-zA-Z0-9_-]\\(global[a-zA-Z0-9_]*\\)"  0 global-face nil)
         ("[^a-zA-Z0-9_-]\\(GLOBAL[a-zA-Z0-9_]*\\)"  0 global-face nil)
         ("[^a-zA-Z0-9_-]\\(local[a-zA-Z0-9_]*\\)"   0 local-face nil)
         ("[^a-zA-Z0-9_-]\\(LOCAL[a-zA-Z0-9_]*\\)"   0 local-face nil)
         ("[^a-zA-Z0-9_-]\\(prop[a-zA-Z0-9_]*\\)"    0 prop-face nil)
         ("[^a-zA-Z0-9_-]\\(PROP[a-zA-Z0-9_]*\\)"    0 prop-face nil)
         )))

  (if (eq major-mode 'emacs-lisp-mode)
      (d-font-lock-add-end
       '(
         ("[^a-zA-Z0-9_-]\\(global[-a-zA-Z0-9_+]*\\)"  0 global-face nil)
         ("[^a-zA-Z0-9_-]\\(\\*[-+a-zA-Z0-9_<>!]+\\*\\)"  0 global-face t)
         ("[^a-zA-Z0-9_-]\\(GLOBAL[-a-zA-Z0-9_+]*\\)"  0 global-face nil)
         ("[^a-zA-Z0-9_-]\\(local[-a-zA-Z0-9_+]*\\)"   0 local-face nil)
         ("[^a-zA-Z0-9_-]\\(LOCAL[-a-zA-Z0-9_+]*\\)"   0 local-face nil)
         ("[^a-zA-Z0-9_-]\\(prop[-a-zA-Z0-9_+]*\\)"    0 prop-face nil)
         ("[^a-zA-Z0-9_-]\\(PROP[-a-zA-Z0-9_+]*\\)"    0 prop-face nil)
         )
       )
    )
  )

(make-face 'global-face)
(set-face-foreground 'global-face "#008800")
(make-face-bold 'global-face)
(setq global-face 'global-face)

(make-face 'local-face)
(set-face-foreground 'local-face "#f90")
(make-face-bold 'local-face)
(setq local-face 'local-face)

(make-face 'prop-face)
(set-face-foreground 'prop-face "#f90")
(make-face-bold 'prop-face)
(setq prop-face 'prop-face)

(provide 'd-flock-coding-preferences)
Back
| Main Menu | Research Projects | Photo Album | Curriculum Vitae | The Greatest Artists |
| Email Address | Computer Games | Web Design | Java Training Wheels | The Fly (A Story) |
| Political Activism | Bob Dylan Quotes+ | My Life Story | Smoking Cessation | Other Links |
| Debugging Macros | String Class I | Linked List System I | Java for C Programmers | Naming Convention |
| String Class II | How I use m4 | Strings III | Symmetrical I/O | Linked Lists II |
| Run-Time Type Info | Virtual Methods | An Array System | Science & Religion | Submodes |
| Nested Packages | Memory Leaks | Garbage Collection | Internet & Poverty | What is Knowledge? |
| Limits of Evolution | Emacs Additions | Function Plotter | Romantic Love | The Next Big Thing |
| Science Fiction | Faster Compilation | Theory of Morality | Elisp Scoping | Elisp Advice |
| S.O.G.M. Pattern | Safe Properties | School Bullying | Charisma Control | Life and Death |
| Splitting Java | Multiple Ctors | Religious Beliefs | Conversation 1 | Conversation 2 |
| J.T.W. Language | Emacs Additions II | Build Counter | Relation Plotter | Lisp++ Language |
| Memory Leaks II | Super Constructors | CRUD Implementation | Order a Website Form | There Is An Afterlife |
| More Occam's Razor | C to Java Translator | Theory of Morality II
Last modified: Sat Apr 29 18:35:30 NZST 2017
Best viewed at 800x600 or above resolution.
© Copyright 1999-2017 Davin Pearson.
Please report any broken links to