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   Scruff the Cat       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-make-faces.el

    

;;; d-make-faces.el --- my personal font preferences

;; copyright (c) 2006-2011 davin pearson

;; author/maintainer: Davin Max Pearson <http://davin.50webs.com>
;; keywords: font lock syntax highlighting
;; version: 1.0

;;; Commentary:

;; this file is not part of GNU Emacs.

;; this file contains definitions of fonts that are used in the file
;; d-syntax-highlighting.el

;;; 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-make-faces>
;;
;; 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-make-faces)

;;; Known Bugs:

;; none!

;;; Code:

;;
;; ensures that certain fonts exist:
;;

;;(defun checkpoint (x) (message "*** d-make-faces checkpoint %s" x))
;;(defmacro d-quote (&rest ignored))
(require 'rgb-inverted)
(progn
  (setq bg-colour          "#000")
  (setq bg-colour-inverted (rgb-inverted bg-colour))
  (setq prefs-bg-black-p t)
  )
(progn
  (require 'font-lock)
  (require 'd-dired-colours)
  (require 'd-make-face)
  (require 'd-syntax-highlighting)
  )
(defun d-make-faces-inner ()
  (block nil

(set-face-background 'default "#fff")

(when prefs-minimal-syntax-highlighting-p
      ;; ordinary comment
      ;;; super comment
      ;;(d-beeps "Inside d-make-faces")

      (progn
        (set-face-background 'd-face-cc-stars nil)
        (set-face-foreground 'd-face-cc-stars "#0a0")
        (make-face-bold 'd-face-cc-stars)
        )

;; -------------------------------------------------------------
      (progn ;;abc-function-def
        (set-face-background 'font-lock-comment-face nil)
        (set-face-foreground 'font-lock-comment-face (if prefs-bg-black-p
                                                         "#88ff88"
                                                         "#070")))
      (progn
        (set-face-background 'bold nil)
        (set-face-foreground 'bold bg-colour-inverted)
        )
      (progn
        (set-face-background 'd-face-el-d-stuff-2 nil)
        (set-face-foreground 'd-face-el-d-stuff-2 (if prefs-bg-black-p
                                                      "#fff" "#66c")))
      (progn
        (set-face-background 'font-lock-keyword-face nil)
        (set-face-foreground 'font-lock-keyword-face (if prefs-bg-black-p
                                                         "#fff"
                                                       "#000"))
        )
      (progn
        (set-face-background 'd-face-super-comment nil)
        (set-face-foreground 'd-face-super-comment (if prefs-bg-black-p "#e44" "#f00"))
        )
      (set-face-background 'font-lock-constant-face nil)
      (set-face-foreground 'font-lock-constant-face "#f00")
      (set-face-background 'font-lock-type-face nil)
      (set-face-foreground 'font-lock-type-face "#88f")
      (set-face-background 'font-lock-variable-name-face nil)
      (set-face-foreground 'font-lock-variable-name-face (if prefs-bg-black-p "#f8f" "#8800ff"))
      (set-face-background 'font-lock-function-name-face (if prefs-bg-black-p
                                                             "#000000" "#ffff00"))
      (set-face-foreground 'font-lock-function-name-face (if prefs-bg-black-p
                                                             "#ffff00" "#000000"))
      (set-face-background 'font-lock-doc-face nil)
      (set-face-foreground 'font-lock-doc-face "#ff0000")
      ;;(message "*** d-make-face font-lock-doc-face bg-colour=%s" bg-colour)
      (set-face-background 'dd-face nil)
      (set-face-foreground 'dd-face"#00f")
      (set-face-background 'dired-marked "#9999ff")
      (set-face-foreground 'dired-marked "#ffffff")
      (set-face-background 'dired-flagged "#ff9999")
      (set-face-foreground 'dired-flagged "#ffffff")
      (set-face-background 'dc-face-cc-digits nil)
      (set-face-foreground 'dc-face-cc-digits (d-amiga-color "#f0f"))
      ;;(set-face-background 'd-face-defmacro nil)
      ;;(set-face-foreground 'd-face-defmacro "#f80")
      (set-face-background 'redb-face nil)
      (set-face-foreground 'redb-face "#f00")
      (set-face-background 'grnb-face nil)
      (set-face-foreground 'grnb-face "#0c0")
      (set-face-background 'blub-face nil)
      (set-face-foreground 'blub-face "#00f")
      (set-face-background 'red-face nil)
      (set-face-foreground 'red-face "#f00")
      (set-face-background 'grn-face nil)
      (set-face-foreground 'grn-face "#0c0")
      (set-face-background 'blu-face nil)
      (set-face-foreground 'blu-face "#66f")
      (progn
        (set-face-background 'font-lock-string-face (if prefs-bg-black-p
                                                        "#88f"
                                                      (d-amiga-color "#ddf")))
        (set-face-foreground 'font-lock-string-face (if prefs-bg-black-p
                                                        "#fff"
                                                      "#000"))
        )
      " I am a string in font-lock-string-face... "
      (set-face-background 'd-face-el-d-stuff nil)
      (set-face-foreground 'd-face-el-d-stuff (if prefs-bg-black-p "#66f" "#00f"))
      (set-face-background 'd-face-el-quote nil)
      (set-face-foreground 'd-face-el-quote (if prefs-bg-black-p "#8f8" "#0a0"))
      (set-face-background 'bg:yellow (if prefs-bg-black-p
                                          nil
                                        "#ffff00"))
      (set-face-foreground 'bg:yellow (if prefs-bg-black-p
                                          "#ffff00"
                                        "#000"))
      (set-face-background 'd-face-path nil)
      (set-face-foreground 'd-face-path "#0c0")
      (set-face-background 'd-face-makefile-space "#f0f")
      (set-face-foreground 'd-face-makefile-space "#fff")
      (set-face-background 'd-face-makefile-tab "#ccffcc")
      (set-face-foreground 'd-face-makefile-tab "#fff")
      (set-face-background 'd-face-cc-global nil)
      (set-face-foreground 'd-face-cc-global (if prefs-bg-black-p
                                                 "#0c0"
                                               "#0c0"))
      " asdkjasdkl " ;; I am a comment
      (progn
        (set-face-background 'fg:lightgreen nil)
        (set-face-foreground 'fg:lightgreen "#0c0")
        )
      (progn
        (set-face-background 'd-face-cc-debugging "#0f0")
        (set-face-foreground 'd-face-cc-debugging nil)
        )
      (set-face-background 'fg:white bg-colour-lighter)
      (set-face-foreground 'fg:white bg-colour-inverted)
      (set-face-background 'd-face-path nil)
      (set-face-foreground 'd-face-path "#080")
      (set-face-background 'dc-face-cc-digits nil)
      (set-face-foreground 'dc-face-cc-digits "#f0f")
      (progn
        (set-face-background 'd-face-property nil)
        (set-face-foreground 'd-face-property "#fa0")
        )
      (progn
        (set-face-background 'd-face-property-inverse "#fe0")
        (set-face-foreground 'd-face-property-inverse nil))
      (progn ;; m4_foo
        (set-face-background 'd-face-m4 "#fc8")
        (set-face-foreground 'd-face-m4 "black")
        )
      (progn ;;         (set-face-background 'd-face-m4-dnl "#ffee99")
        (set-face-foreground 'd-face-m4-dnl "black")
        )
      (set-face-background 'bg:yellow nil)
      (set-face-foreground 'bg:yellow (d-amiga-color "#ff0"))
      (progn
        (set-face-background 'bg:lightmagenta "#ffccff")
        (set-face-foreground 'bg:lightmagenta "black")
        )
      (progn
        (set-face-background 'fg:lightmagenta nil)
        (set-face-foreground 'fg:lightmagenta "#f6f")
        )
      (progn
        (set-face-background 'lightgreen nil)
        (set-face-foreground 'lightgreen "#080")
        )
      (set-face-background 'bg:lightgreen "#0f0")
      (set-face-foreground 'bg:lightgreen "white")
      (set-face-background 'bg:lightred "#f00")
      (set-face-foreground 'bg:lightred "white")
      (set-face-background 'bg:lightblue "#00f")
      (set-face-background 'fg:red nil)
      (set-face-foreground 'fg:red "#f00")
      (progn
        (set-face-background 'd-face-m5 "#6f6")
        (set-face-foreground 'd-face-m5 "black"))
      (set-face-background 'd-face-cc-debug "#080")
      (set-face-foreground 'd-face-cc-debug "#fff")
      (set-face-background 'blu-face nil)
      (set-face-foreground 'blu-face "#00f")
      (set-face-background 'lisp++-face-keywords nil)
      (set-face-foreground 'lisp++-face-keywords "#00f")
      (set-face-background 'd-debug-face nil)
      (set-face-foreground 'd-debug-face "#f0f")
      (set-face-background 'd-checkpoint-face nil)
      (set-face-foreground 'd-checkpoint-face "#404")
      (set-face-background 'lisp++-face-illegal-type "#0ff")
      (set-face-foreground 'lisp++-face-illegal-type "#f0f")
      (set-face-background 'bg:yellow "#ffff00")
      (set-face-foreground 'bg:yellow "#000")
      (progn
        (set-face-background 'd-face-green-and-yellow "#8f8")
        (set-face-foreground 'd-face-green-and-yellow "#000"))
      (progn
        (set-face-background 'd-face-green-and-black "#cfc")
        (set-face-foreground 'd-face-green-and-black "#000"))
      (progn
        (set-face-background 'orange nil)
        (set-face-foreground 'orange (d-amiga-color "#960")))
      (progn
        (set-face-background 'fg:orange nil)
        (set-face-foreground 'fg:orange (d-amiga-color "#f80")))
      (progn
        (set-face-background 'dc-face-dired-sources nil)
        (set-face-foreground 'dc-face-dired-sources bg-colour-inverted)
        (set-face-background 'dc-face-dired-text nil)
        (set-face-foreground 'dc-face-dired-text bg-colour-inverted)
        (progn
          (set-face-background 'dc-face-dired-archives nil)
          (set-face-foreground 'dc-face-dired-archives "#f44")
          )
        (progn
          (set-face-background 'dc-face-dired-web "#ffff00")
          (set-face-foreground 'dc-face-dired-web "#000")
          )
        (progn
          (set-face-background 'dc-face-dired-unimportant nil)
          (set-face-foreground 'dc-face-dired-unimportant "#ccc")
          )
        (progn
          (set-face-background 'dc-face-directory nil)
          (set-face-foreground 'dc-face-directory (if prefs-bg-black-p "#aaf" "#00f"))
          )
        (progn
          (set-face-background 'font-lock-preprocessor-face nil)
          (set-face-foreground 'font-lock-preprocessor-face "#c90")
          )
        (progn
          (make-face 'dc-face-dark-blue)
          (make-face-bold 'dc-face-dark-blue)
          (setq dc-face-dark-blue 'dc-face-dark-blue)
          ;;(set-face-foreground 'dc-face-dark-blue "#448")
          (set-face-foreground 'dc-face-dark-blue (if prefs-bg-black-p
                                                      "#fff" "#559"))
          )
        ;;(require 'd-make-face)
        ))))
;; end defun: d-make-faces-inner

;; (d-make-faces)
(defun d-make-faces ()
  (interactive)
  (progn
    ;;(message "Muddy Waters / She's got a mojo")
    (setq prefs-bg-black-p (not prefs-bg-black-p))
    ;; -----------------------------------------------------------------
    (setq bg-colour (if (string= user-login-name "root")
                        (if prefs-bg-black-p "#422" "#c88")
                      (if (not (string= user-login-name "root"))
                          (if prefs-bg-black-p "#000" "#fff"))))

(setq bg-colour-inverted (if prefs-bg-black-p
                                 "#fff" "#000"))
    (setq bg-colour-lighter (if prefs-bg-black-p
                                "#444"
                              "#ffffff"))
    (setq bg-colour-lighter-lighter (if prefs-bg-black-p
                                        "#555"
                                      "#eee"))
    )
  ;; -----------------------------------------------------------------
  (when emacs-dialect-gnuemacs-p
    (progn
      (setq default 'default)
      (make-face 'default)
      (set-face-background 'default bg-colour)
      (set-face-foreground 'default bg-colour-inverted)
      )
    (safe-require 'd-make-face)
    (d-assert (fboundp 'd-make-face))
    (d-assert (fboundp 'd-make-faces))
    ;;(message "*** about to call d-make-faces-inner")
    (d-make-faces-inner)
    (safe-require 'd-dired-colours)
    (safe-require 'd-syntax-highlighting-coding-preferences)
    (safe-require 'd-syntax-highlighting-private))
  ;;(d-beeps "Foomatic")
  (if (not emacs-dialect-xemacs-p)
      (set-background-color bg-colour))
  ;;(setq cursor-colour (if prefs-bg-black-p "#ffff00" "#000"))
  (when (not emacs-dialect-xemacs-p)
    ;;(make-face 'cursor)
    ;;(set-face-background 'cursor "red")
    ;;(set-face-foreground 'cursor "black"))
    )
  (when emacs-dialect-xemacs-p
    (make-face 'text-cursor)
    (set-face-background 'text-cursor nil)
    (set-face-foreground 'text-cursor "#000000"))
  (make-face 'modeline)
  (set-face-background 'modeline "grey")
  (set-face-foreground 'modeline "black")
  ;; -----------------------------------------------------------------
  (safe-require 'd-make-face)
  (safe-require 'd-dired-colours)
  ;; -----------------------------------------------------------------
  (progn
    (make-face-italic 'bold-italic)
    (make-face-italic 'italic)
    (set-face-underline-p 'italic nil)
    (setq italic 'italic)
    )
  (setq font-lock-maximum-size nil)
  (setq font-lock-maximum-decoration t)
  ;; get graphics characters online...
  (if (and (< emacs-major-version 20)
           (not emacs-dialect-xemacs-p))
      (let ((i 127))
        (while (< i 256)
          (aset standard-display-table i (vector i))
          (incf i))))

(copy-face 'font-lock-function-name-face 'match)

(set-face-background 'd-face-makefile-dollar-dollar (if prefs-bg-black-p (d-amiga-color "#090") (d-amiga-color "#cfc")))
  (set-face-foreground 'd-face-makefile-dollar-dollar (if prefs-bg-black-p (d-amiga-color "#fff") "#000000"))

;;(set-face-foreground d-face-speedbar-highlighted)
  )

(d-make-faces)

(defun d-make-faces--minimal-font-lock-mode-hook ()
  (when prefs-minimal-syntax-highlighting-p
    (when (eq major-mode 'emacs-lisp-mode)
      (d-font-lock-add-begin
       `(
         (, (concat "\\<ema""cs-di""alect-[-a-z+]*-p\\>") 0 'd-face-cc-global nil)
         (, (concat "\\<os-ty""pe-[-a-z+]*-p\\>")         0 'd-face-cc-global nil)
         )
       )) ;; END WHEN! (eq major-mode 'emacs-lisp-mode)
    (when (eq major-mode 'emacs-lisp-mode)
      (d-font-lock-add-begin ;; 
 goes here
       `(
         ( , (concat "\\<\\(d-\\)\\(de""bug\\|er""ror\\|ass""ert\\|de""bug-on-er""ror\\)\\>")
             (0 'redb-face nil))
         ( , (concat "\\<\\(de""bug\\|er""ror\\|ass""ert\\)\\>")
             (0 'redb-face nil))
         ( , (concat "\\<\\(d-\\)\\(quo""te\\)\\>")
             (0 'grnb-face nil))
         ( , (concat "\\<\\(quo""te\\)\\>")
             (0 'grnb-face nil))
         )))))
;; end defun: d-make-faces--minimal-font-lock-mode-hook ()

(add-hook 'font-lock-mode-hook 'd-make-faces--minimal-font-lock-mode-hook)

(provide 'd-make-faces)

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 | Scruff the Cat | 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: Mon May 6 01:56:55 NZST 2019
Best viewed at 800x600 or above resolution.
© Copyright 1999-2019 Davin Pearson.
Please report any broken links to