[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
My personal syntax highlighting
From: |
Davin Pearson |
Subject: |
My personal syntax highlighting |
Date: |
Fri, 14 Jan 2011 15:52:31 -0800 (PST) |
User-agent: |
G2/1.0 |
;;; d-flock.el --- My personal syntax highlighting preferences
;; Copyright (C) 2006-2011 Davin Pearson
;; Author/Maintainer: Davin Pearson http://www.davinpearson.com
;; Keywords: My personal syntax highlighting preferences font lock
;; Version: 1.0
;;; Limitation of Warranty
;; This file 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 2, or (at your option)
;; any later version.
;; This file 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 details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; When you learn how to customise Emacs' syntax highlighting
;; preferences, it becomes an addictive activity adding new syntax
;; highlighting rules to make debugging your code easier. This file
;; contains almost all of my syntax highlighting customisations that
;; are practical to fit into a single file like this one. Warning:
;; overuse of this feature can render your code like Las Vegas.
;;; Install Instructions:
;; See the following URL for the latest info and a tarball:
;; http://davin.50webs.com/research/2010/mopa2e2.html#d-flock
;; Extract the file in the above-mentioned tarball and put it
;; somewhere in load-path and load it by putting the following
;; command in your .emacs file:
;;
;; (require 'd-flock)
;;; Known Bugs:
;; None!
(add-hook 'font-lock-mode-hook 'd-font-lock-mode-hook)
(setq parse-sexp-ignore-comments t)
;;;
;;; NOTE: This function can stuff up font-lock-mode-hook and therefore
post-command-hook
;;;
(defun d-font-lock-mode-hook ()
;; removes FONT from modeline:
(if (assq 'font-lock-mode minor-mode-alist)
(setcar (cdr (assq 'font-lock-mode minor-mode-alist)) " F"))
;; was here
(if (and (buffer-file-name) (string-match "\\.css$" (buffer-file-
name)))
(d-font-lock-add-end
'(
("#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]
[0-9a-fA-F]" 0 'd-face-cc-digits t))
)
)
(when (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode) (eq
major-mode 'java-mode) (eq major-mode 'sjs-mode))
(d-font-lock-add-end
'(
("\\<0[xX][0-9A-Fa-f]*" 0 'd-face-cc-digits nil)
))
)
(when (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode) (eq
major-mode 'java-mode) (eq major-mode 'sjs-mode)
(eq major-mode 'emacs-lisp-mode))
(d-font-lock-add-end
'(
;;("[^a-z]\\([012]\\)[^a-z]" 1 'd-face-cc-
illegal-type t)
;;("[^a-zA-Z0-9]\\([012]\\)\\[^a-zA-Z0-9]" 1 'd-face-cc-illegal-
type t)
("\\(\\<[-]*\\)\\([0-9]+[.]\\)?[0-9]+\\([eE][+-]?[0-9]+\\)?" 0
'd-face-cc-digits nil)
))
)
;;(quote ofofo)
(when (and prefs-font prefs-font-xtra)
(when (eq major-mode 'emacs-lisp-mode)
(d-font-lock-add-end
'(
("\\<\\(d-n?beeps?\\|checkpoint\\|debug\\|debug-on-error\\|
error\\|d-foo\\)\\>" 0 'fg:lightmagenta t)
("\\(safe-require\\)\\s-'\\(\\sw+\\)" (1 font-lock-keyword-
face) (2 font-lock-reference-face))
("\\<quote\\>" 0 'd-face-el-quote nil)
))))
(when (and prefs-font-libd prefs-font-xtra)
(when (or (eq major-mode 'c++-mode)
(and (buffer-file-name) (string-match "\\.lpp$" (buffer-
file-name))))
(d-font-lock-add-end
`(("\\<\\(exit\\)(\\([^)]*\\))" (1 font-lock-keyword-face) (2
font-lock-reference-face))
("\\<\\(CONTRACT_[123]\\|contract_[123]\\)\\>" 0 'bg:yellow
t)
("\\<\\(ASSERT\\|assert\\)(" 1 'font-lock-
keyword-face t)
("\\<\\(ASSERT_INFO\\|assert_info\\)\\>" 1 'font-lock-
keyword-face t)
("[^a-zA-Z0-9_]\\(init[a-z0-9_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(deinit[a-z_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(new_[a-zA-Z0-9_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(delete_[a-z_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(create[a-z0-9_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(copy[a-z0-9_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(clone[a-z0-9_]*\\)(" 1 'd-face-cc-
ctor-dtor t)
("[^a-zA-Z0-9_]\\(destroy[a-z_]*\\)(" 1 'd-face-cc-
ctor-dtor nil)
("\\<\\(free\\|malloc\\|new\\|delete\\)\\>" 0 'd-face-cc-ctor-
dtor t)
("\\<debug[_a-z0-9]*" 0 'd-face-cc-
debugging t)
;;("ESC_CONDITI" 0 'fg:lightred nil)
;;("USER_PRESSED_QUIT" 0 'fg:lightred nil)
;;("\\<\\(new\\|delete\\)\\>" 1 'fg:lightred t)
;;;
;;; BEGIN_...(); BEGIN_ALLEGRO()
;;; ALLEGRO_..._ERROR() ALLEGRO_MATH_OVERFLOW_ERROR()
;;; END_,..() END_OF_MAIN()
;;("\\<\\(BEGIN[A-Z_]*\\|EXIT_ON[A-Z_]*\\|[A-Z_]*ERROR\\|
END[A-Z_]*\\)\\>(" 1 'fg:lightred t)
;; EXTENDED ALLEGRO FUNCTIONS! smeg
abcdefghijklmnopqrstuvwxyz
;; EXTENDED ALLEGRO FUNCTIONS: smog
abcdefghijklmnopqrstuvwxyz
("\\<\\(press_key_to_continue[_a-z]*\\|qcos\\|qsin\\)
(" 1 'd-face-cc-allegro)
;;("\\<\\(load_rle\\|save_rle\\)
(" 1 'd-face-cc-
allegro)
("\\<\\(safe_load_sample\\|safe_load_bitmap\\|safe_load_midi\
\|safe_play_sample\\)(" 1 'd-face-cc-allegro)
("\\(\\<qclamp_[a-z_]*\\)(" 1 'd-face-cc-allegro)
("\\<\\(BEGIN_ALLEGRO\\)\\>" 0 'd-face-cc-illegal-type t)
("\\<\\(END_OF_MAIN\\)\\>" 0 'font-lock-keyword-face t)
("\\<\\(BEGIN_FUNCTION\\|END_FUNCTION\\)\\>" 0 'd-face-cc-
debugging t)
("\\<\\(EXIT_ON_[A-Z0-9_]*\\)\\>" 1 'bg:yellow t)
("\\<\\(ALLEGRO_[A-Z_]*\\|SHOULD_NEVER_HAPPEN\\|
should_never_happen\\)(" 1 'font-lock-keyword-face nil)
("\\<\\(allegro_user_pressed_quit\\|allegro_on\\|
allegro_quit[a-z_]*\\|allegro_window_close_hook\\)\\>"
1 'font-lock-keyword-face t)
("\\<allegro_init[a-z_]*\\>" 0 'd-face-cc-ctor-dtor t)
("\\<install_[a-z_]*\\>" 0 'd-face-cc-ctor-dtor t)
("\\<remove_[a-z_]*\\>" 0 'd-face-cc-ctor-dtor t)
;;; ALLEGRO_ONLINE, DAVINS_IO_ONLINE, DMM_ONLINE
("\\<[A-Z_]*ONLINE\\>" 0 'd-face-cc-libd t)
("\\<NDEBUG\\>" 0 'd-face-cc-libd t)
;;("\\<ERROR_PADDING\\>" 0 'fg:lightred t)
("\\<PRINTF_AND_EXIT\\>" 0 'font-lock-keyword-face t)
("[a-z_]*eraseme[a-z_]*" 0 'd-face-cc-illegal-type t)
;;("[a-z_]*debug[a-z0-9_]*" 0 'd-face-cc-debugging t)
;;("\\<dmm[a-z0-9_]*" 0 'd-face-cc-debugging t)
;;("\\<SDL_\\sw+" 0 'fg:white t)
("\\<global_[a-z0-9_]*" 0 'd-face-cc-global t)
("\\<GLOBAL_[A-Z0-9_]*" 0 'd-face-cc-global t)
("\\<DEBUG[A-Z0-9_]*\\>" 0 'd-face-cc-debugging t)
("\\<[A-Z_]*ERROR\\>" 0 'font-lock-keyword-face t)
("\\<\\(inner\\.[^;(]*\\)(" 1 'd-face-property t)
("\\<\\(inner\\.[^ ;(]*\\)(" 1 'd-face-property t)
("\\<PROP_[A-Z0-9_]*" 0 'd-face-property t)
("\\<prop_[a-z0-9_]*" 0 'd-face-property t)
("\\<local_[a-z0-9_]*" 0 'd-face-property t)
("\\<LOCAL_[A-Z0-9_]*" 0 'd-face-property t)
;; MYLIB FUNCTIONS!
("[^a-zA-Z0-9_]\\(char_star\\|const_char_star\\|distance[a-
z0-9_]*\\|equals\\|fgeti16\\|fputi16\\|get_char_at\\|get_length\\|
get_ptr\\|gulp_quoted_string\\|looking_at\\|mag\\|mag2\\|mag_by_sums\\|
set_char_at\\|unit_vector\\|is_unit_vector\\|dot\\|cross\\|rot90\\|on\
\|xyi_to_xyd\\|xyi_to_xyf\\)(" 1 'd-face-cc-libd t)
;; MYSTRING FUNCTIONS!
("\\<\\(string[a-z0-9_]*\\|strings_equal\\|
strings_equal_ignore_case\\)(" 1 'd-face-cc-libd t)
;; MYLIB WORDS!
("[^a-zA-Z0-9_]\\(cerr\\|cout\\)[^a-zA-Z0-9_]" 1 'd-face-cc-
clib)
;; MYLIST FUNCTIONS/METHODS!
(,(concat "[^a-zA-Z0-9_]\\(add_after\\|add_before\\|
add_element\\|add_element_deep\\|add_list\\|add_list_deep\\|add_to_end\
\|add_to_start\\|clear_dirty\\|clone_deep\\|clone_shallow\\|empty\\|
get_cyclic_next\\|get_cyclic_next_const\\|cyclic_previous\\|
cyclic_previous_const\\|delete_deep\\delete_duplicates_eq\\|
delete_duplicates_equal\\|delete_duplicates_equal_deep\\|delete_shallow
\\|get_data\\|get_data_const\\|get_dirty\\|get_element_at[a-z_]*\\|
get_element_at_const[a-z_]*\\|get_first\\|get_first_const\\|get_index\
\|get_iterator\\|get_iterator_backwards\\|get_last\\|get_last_const\\|
get_length\\|get_next\\|get_next_const\\|get_owner\\|get_owner_const\\|
get_previous\\|get_previous_const\\|get_second\\|get_second_const\\|
get_second_to_last\\|get_second_to_last_const\\|get_third\\|
get_third_const\\|get_third_to_last\\|get_third_to_last_const\\|
is_empty\\|is_first\\|is_last\\|lists_equal\\|OK\\|remove_element\\|
reverse\\|set_data\\|set_element_at[a-z_]*\\|xs_equal\\|quicksort\
\)" (if (eq major-mode 'c++-mode) "(" "")) 1 'd-face-cc-libd nil)
("[^a-zA-Z0-9_]\\(advance\\|has_more\\|retreat\\)(" 1 'd-face-
cc-libd nil)
("[^a-zA-Z0-9_]\\(find_element[a-z0-9_]*\\)(" 1 'd-face-cc-
libd nil)
;; MYARRAY FUNCTIONS/METHODS!
("[^a-zA-Z0-9_]\\(add_element_at\\|remove_element_at\\|
cascade_down\\|cascade_up\\)(" 1 'd-face-cc-libd nil)
("\\<SUBMODES[A-Z_]*" 0 'fg:lightred nil)
("\\<\\([GS]ETTER\\)\\(([^)]*)\\)" (1 'fg:lightred t) )
("\\<\\([GS]ETTER_LONG\\)\\(([^)]*)\\)" (1 'fg:lightred t) )
("\\<INFINITE_LOOP\\>" 0 'fg:lightred t)
("\\<error[a-z_]*\\>" 0 'fg:lightred t)
))))
(when (and prefs-font-libd prefs-font-xtra)
(when (eq major-mode 'c++-mode)
(d-font-lock-add-end
'(
;; DLIB WORDS!
("\\<libd_[a-z0-9_]*\\>" 0 'd-face-cc-libd t)
("\\<my[a-zA-Z0-9_]+" 0 'd-face-cc-libd t)
))))
(when (and prefs-font-libd prefs-font-xtra)
(when (or (eq major-mode 'c++-mode)
(eq major-mode 'text-mode))
(d-font-lock-add-end
'( ;; CLIB FUNCTIONS!
("\\<\\(abs\\|atoi\\|calloc\\|exp\\|rand\\|fclose\\|fgetc\\|
fopen\\|fprintf\\|fputc\\|fputs\\|fread\\|getenv\\|isalnum\\|isalpha\\|
isdigit\\|isxdigit\\|log\\|max\\|min\\|mid\\|pow\\|printf\\|sprintf\\|
srand\\|strcmp\\|strlen\\|sin\\|cos\\|exp\\|sqrt\\|system\\|time\\|
toupper\\|tolower\\)(" 1 'd-face-cc-clib)
;; EXTENDED CLIB FUNCTIONS!
("\\<\\(fput16\\|fget16\\)(" 1 'd-face-cc-clib)
;;("\\<\\(to_hex_[0-9]*\\)(" 1 'd-face-cc-clib)
;; CLIB VARIABLES!
("\\<\\(argc\\|argv\\|EOF\\|INT_MAX\\|PI\\|stdout\\|stderr\\)\
\>" 1 'd-face-cc-clib)
("\\<std::[a-z_]*\\>" 0 'd-face-cc-clib)
("\\<\\(EXIT_SUCCESS\\|EXIT_FAILURE\\)\\>" 0 'font-lock-
constant-face t)
("[^a-zA-Z0-9_]\\(sqrt\\|cos\\|sin\\|tan\\|acos\\|asin\\|
atan2?\\|abs\\|max\\|min\\)(" 1 'd-face-cc-clib t)
;; ALLEGRO FUNCTIONS!
("[^a-zA-Z0-9_]\\(acquire_[a-z_]*\\|adjust_sample\\|
allegro_[a-z0-9_]*\\|bitmap_color_depth\\|blit\\|calc_spline\\|clamp\\|
circle\\|circlefill\\|clear\\|clear_bitmap\\|clear_keybuf\\|
clear_to_color\\|desktop_color_depth\\|do_line\\|draw_lit_sprite\\|
draw_rle_sprite\\|draw_sprite[a-z_]*\\|draw_trans_sprite\\|drawing_mode
\\|ellipse\\|ellipsefill\\|enable_triple_buffer\\|exists\\|file_exists\
\|floodfill\\|for_each_file\\|getr[0-9]*\\|getg[0-9]*\\|getb[0-9]*\\|
getpixel\\|get_desktop_resolution\\|hline\\|hsv_to_rgb\\|
install_joystick\\|install_keyboard\\|install_mouse\\|install_sound\\|
install_timer\\|is_linear_bitmap\\|is_video_bitmap\\|
keyboard_needs_poll\\|keypressed\\|line\\|load_bitmap\\|load_midi\\|
load_sample\\|makeacol32\\|makecol[0-9]*\\|masked_blit\\|
masked_stretch_blit\\|midi_seek\\|pivot_sprite\\|play_midi\\|
play_sample\\|poll_joystick\\|poll_keyboard\\|poll_scroll\\|
position_mouse\\|polygon\\|putpixel\\|readkey\\|rect\\|rectfill\\|
release_[a-z_]*\\|request_scroll\\|request_video_bitmap\\|rest\\|
rest_callback\\|rgb_to_hsv\\|rotate_sprite\\|save_bitmap\\|scare_mouse\
\|scroll_screen\\|select_palette\\|set_alpha_blender\\|set_burn_blender
\\|set_clip\\|set_color_conversion\\|set_color_depth\\|
set_display_switch_mode\\|set_gfx_mode\\|set_mouse_[a-z_]*\\|
set_trans_blender\\|set_window_close_button\\|set_window_close_hook\\|
set_window_title\\|set_volume\\|show_mouse\\|solid_mode\\|
show_video_bitmap\\|spline\\|stop_midi\\|stop_sample\\|stretch_blit\\|
stretch_sprite\\|textprintf\\|textprintf_centre\\|text_height\\|
text_length\\|textout\\|textout_[a-z_]*\\|text_mode\\|triangle\\|
unscare_mouse\\|unselect_palette\\|vline\\|vsync\\|xor_mode\\|
yield_timeslice\\)(" 1 'd-face-cc-allegro t)
;; ALLEGRO ARRAYS!
("\\<\\(joy\\|key\\)\\[" 1 'd-face-cc-allegro)
;; ALLEGRO VARIABLES AND CONSTANTS!
;; was [^a-zA-Z0-9_]
("\\<\\(allegro_[a-z_]*\\|ALLEGRO_[A-Z_]*\\|allegro_error\\|
COLORCONV_[A-Z0-9_]*\\|DIGI_[A-Z0-9_]*\\|DRAW_MODE_[A-Z0-9_]*\\|errno\
\|FA_[A-Z]*\\|font\\|gfx_capabilities\\|GFX_[A-Z0-9_]*\\|JOY_[A-Z_]*\\|
joy_\\(x\\|y\\|left\\|right\\|up\\|down\\)\\|key_led_flag\\|KEY_[A-
Z0-9_]*\\|MASK_COLOR_[0-9]*\\|MIDI_[A-Z0-9_]*\\|midi_pos\\|mouse_[xyzb]
\\|mouse_sprite\\|mouse_[xy]_focus\\|num_joysticks\\|PAL_SIZE\\|
QUICK_MAX\\|retrace_count\\|screen\\|SCREEN_W\\|SCREEN_H\\|SWITCH_[A-
Z]*\\|three_finger_flag\\)\\>" 1 'd-face-cc-allegro nil)
))))
(when (and prefs-font-libd prefs-font-xtra)
(when (eq major-mode 'c++-mode)
(d-font-lock-add-end
'( ;;("class \\([a-zA-Z][a-zA-Z0-9_]*\\)" 1 'font-lock-type-
face t)
;;
;; NOTE: smeg
;;
;;("\\<[A-Z][a-z][a-zA-Z0-9_]*_A\\>" 0 'font-lock-type-face
nil)
("\\(\\<[A-Z]+[a-zA-Z0-9_]*\\)::" 1 'font-lock-type-face t)
("\\<\\(Round\\|Floor\\)\\>" 1 'd-face-cc-libd t)
("\\<\\(File_Gulper\\|File_Reader\\|File_Writer\\|Gulper\\|
Io_Worker\\|Reader\\|Reader_Core\\|String_Gulper\\|String_Internal\\|
String_Reader\\|Writer\\)\\>" 1 'font-lock-type-face t)
("\\<\\(Auto_G_C\\|Root_G_C\\|Super_G_C\\|Manual_G_C\\)\\>" 1
'font-lock-type-face t)
("\\<\\(Temp_Blit\\)\\>" 1 'font-lock-type-face t)
("\\<[a-z_][a-z0-9_]+_t\\>" 0 'd-face-cc-illegal-type t)
("\\<[a-zA-Z_][a-zA-Z0-9_]*_t\\>" 0 'font-lock-type-face t)
("\\<[a-z][a-z0-9_]*_e\\>" 0 'font-lock-constant-face t)
;;("\\<[A-Z][a-zA-Z0-9_]*_E\\>" 0 'd-face-red-and-yellow
t) ;;; ERROR!
;;("\\<0x[A-Za-z0-9]*\\>" 0 'default t)
("\\<LOOP_OK\[^)]*)" 0 'bold t)
("\\<STAR_OK\[^)]*)" 0 'bold t)
("\\<for_list ?([^)]*)" 0 'bold t)
("\\<for_list_backwards ?([^)]*)" 0 'bold t)
("\\<PTR\\>" 0 'fg:lightred t)
;; // COMMENTS: here to force unfontification of types in
comments
;;
))))
;;; error here
(when (and prefs-font-libd prefs-font-xtra)
(when (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
)
;;(setq tab-width 3)
(let* ((class-name "\\([A-Z]\\|[A-Z][A-Za-z0-9_]+\\)") ;; 1
(stuff-in-angle-brackets "<[^>]*>") ;; 0
(class-name-with-template (concat "\\(" class-name stuff-
in-angle-brackets "\\)")) ;; 2
(class-name-with-possibly-template (concat "\\(" class-
name "\\(" stuff-in-angle-brackets "\\)?" "\\)")) ;; 3
)
;;(setq font-lock-keywords nil)
(d-font-lock-add-end
`(
;; template class:
(,class-name-with-template (1 font-lock-type-face t))
;; template VARIABLE THAT IS NOT class MEMBER:
(,(concat class-name-with-template "\\**"
"\\s-+"
"\\([a-z]\\sw*\\)[^:(a-zA-Z]")
(3 font-lock-variable-name-face nil))
;; template VARIABLE THAT IS class MEMBER:
(,(concat class-name-with-template "\\**"
"\\s-+\\(\\sw+"
"\\(" stuff-in-angle-brackets "\\)?"
"\\)::"
"\\(\\sw+\\)[^:(a-zA-Z]")
(5 font-lock-variable-name-face t))
;; template FUNCTION THAT IS-OR-IS-NOT class MEMBER:
(,(concat class-name-with-template "\\**"
"\\s-+"
"\\(" class-name-with-possibly-template "::\\)?"
"\\([a-z]\\sw*\\)(")
(7 font-lock-function-name-face t))
;; NON template FUNCTION THAT IS class MEMBER:
(,(concat "\\<[A-Za-z]\\sw*[&*]*"
"\\s-+"
"\\(" class-name-with-possibly-template "::\\)"
"\\([a-z]\\sw*\\)(")
(5 font-lock-function-name-face t))
;; ;; template FUNCTION THAT IS NOT class MEMBER:
;; (,(concat class-name-with-template "\\**"
;; "\\s-+"
;; "\\(\\sw+\\)(")
;; (3 font-lock-function-name-face t))
;;
;; NOTE: smeg
;; CONSTRUCTOR AND DESTRUCTOR:
("\\(\\|::\\)\\(~?\\<[A-Z]+[a-z][A-Za-z_]*\\)(" 2 font-lock-
type-face nil)
("\\(~[A-Za-z_]*\\)(" 1 font-lock-type-face t)
;; COLONED CONSTRUCTOR OR DESTRUCTOR:
;;("::\\(~?[A-Z]+[a-z][A-Za-z_]*\\)" 1 font-lock-type-face
t)
("\\<\\(NULL\\|NIL\\|FALSE\\|TRUE\\)\\>" 1 font-lock-
constant-face)
("\\<null\\>" 0 font-lock-constant-face nil)
("\\<\\(if\\|ENDIF\\)(\\(\\sw+\\))" (0 'd-face-red-and-
white) (2 'fg:white t))
("\\<private_\\sw+" 0 'd-face-cc-private t)
("\\<ABSTRACT\\>" 0 'font-lock-keyword-face t)
("\\<finaL\\>" 0 'font-lock-keyword-face t)
("\\<ctor[_a-z0-9]*\\>" 0 'd-face-cc-ctor-dtor t)
("\\<dtor[_a-z0-9]*\\>" 0 'd-face-cc-ctor-dtor t)
("\\<init[_a-z0-9]*\\>" 0 'd-face-cc-ctor-dtor t)
("\\<instance_of_[_A-Za-z]*\\>" 0 'font-lock-keyword-face
t)
("\\<cast_to_[_A-Za-z]*\\>" 0 'font-lock-keyword-face t)
("\\<\\(PRINT[A-Z0-9_]*\\|TELL\\)(\\(.*\\))" (1 'd-face-cc-
debugging nil) (2 'd-face-cc-debugging nil))
;;("\\(xx_\\)\\sw*" 1 'fg:white t)
("^ *\\<BREAKPOINT\\>;? *\n" 0 'd-face-cc-
debugging t)
("\\<BREAKPOINT\\>" 0 'd-face-cc-debugging t)
("\\<CHECKPOINT\\>" 0 'd-face-cc-debugging)
("\\<PLEASE_EMAIL_DAVIN\\>" 0 'fg:lightred t)
))) ;; PLEASE_EMAIL_DAVIN
))
^L
(when (and prefs-font-xtra (eq major-mode 'makefile-mode))
(d-font-lock-add-end
'(
("^\t+" 0 'd-face-makefile-
tab t)
("^ +" 0 'd-face-makefile-
space t)
("[^$]\\($([^ ]+)\\)" 1 font-lock-
variable-name-face t)
("[^$]\\($([^()]+)\\)" 1 font-lock-
variable-name-face t)
("[^$]\\($([^()]*([^()]*)[^()]*)\\)" 1 font-lock-
variable-name-face t)
("[^$]\\($([^()]*([^()]*)[^()]*([^()]*)\\)" 1 font-lock-
variable-name-face t)
("$$(\\([a-zA-Z0-9._-]* ?\\)[^()]*"
(0 'd-face-makefile-dollar-dollar t)
(1 'd-face-makefile-dollar-dollar-highlight t)
)
("$$(\\([a-zA-Z0-9._-]* ?\\)[^()]*(\\([a-zA-Z0-9._-]* ?\\)
[^()]*)[^()]*)"
(0 'd-face-makefile-dollar-dollar t)
(1 'd-face-makefile-dollar-dollar-highlight t)
(2 'd-face-makefile-dollar-dollar-highlight t)
)
("$$[A-Z]+" 0 font-lock-variable-name-face t)
)
)
;; patches the incorrectly fontified as font-lock-constant-face to
be font-lock-variable-name-face
;;(set (make-local-variable 'font-lock-constant-face) 'font-lock-
variable-name-face)
)
(when (and prefs-font-xtra (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'java-mode)
;;(eq major-mode 'jde-mode)
))
(d-font-lock-add-end
'(
("&&\\|||" . font-lock-keyword-face)
("\\(RTTI_SAME\\|RTTI_ROOT\\)\\(.*\\)" 0 'd-face-m4 t)
;;("/\\*\\*.*" 0 'd-face-super-comment t)
)))
(quote (when (eq major-mode 'java-mode)
(d-font-lock-add-end
'(
;; Abc def
("\\([A-Z][a-zA-Z_-]*\\)[ \t]+\\([a-z][a-zA-Z_-]*\
\);" (1 'fg:lightcyan t) (2 'fg:cyan t))
("\\([A-Z][a-zA-Z_-]*\\)[ \t]+\\([a-z][a-zA-Z_-]*\\)
(" (1 'fg:lightcyan t) (2 'bg:yellow t))
("\\<\\([A-Z]+\\)[ \t]+\\([a-z][a-zA-Z_-]*\\)
[ \t]*[;=]" (1 'fg:lightcyan t) (2 'fg:cyan t))
("\\<\\([A-Z]+\\)[ \t]+\\([a-z][a-zA-Z_-]*\\)
[ \t]*[(]" (1 'fg:lightcyan t) (2 'bg:yellow t))
))))
(when (and prefs-font-libd prefs-font-xtra)
(when (or (eq major-mode 'c++-mode)
(eq major-mode 'text-mode))
(d-font-lock-add-end
'(("\\<DCODE_[A-Z0-9_]*\\>" 0 'd-face-red-and-white t)
("\\<DCODE_TRI_[A-Z0-9_]*" 0 'd-face-green-and-white t)
("\\<DCODE_GENERIC_A\\>" 0 'd-face-cc-illegal-type t)
;;("\\<DCODE_UNKNOWN_A\\>" 0 'd-face-cc-illegal-type t)
))))
(when (and prefs-font-xtra (or (eq major-mode 'c-mode) (eq major-
mode 'c++-mode)))
(d-font-lock-add-end
'(
("\\<gl[A-Z][a-zA-Z0-9]*\\>" 0 'd-face-cc-opengl)
("\\<glu[A-Z][a-zA-Z0-9]*\\>" 0 'd-face-cc-opengl)
("\\<glut[A-Z][a-zA-Z0-9]*\\>" 0 'd-face-cc-opengl)
("\\<GL_[A-Z0-9_]*\\>" 0 'd-face-cc-opengl)
("\\<GLUT_[A-Z0-9_]*\\>" 0 'd-face-cc-opengl)
)
)
)
;;`((1 2 3) (,@(list (concat "a" "b") 4 5)))
(when (and prefs-font-xtra (eq major-mode 'java-mode))
(d-font-lock-add-end
`(
("\\<[A-Z]\\>" 0 'font-lock-type-face t)
;;("^ \\(private\\|public\\)" 1 'font-lock-function-name-
face t))))
,@(list (list (concat "^"
(make-string c-basic-offset ? )
"\\(\\(private\\|protected\\|public\\) \
\)?"
"\\(\\(abstract\\|static\\|final\\) \\)*"
"[A-Z]+[a-z][A-Za-z0-9]*"
"<[A-Z]+[a-z]*[a-zA-Z]*> "
"\\([a-z]+[a-zA-Z]*\\)(")
5 'font-lock-function-name-face t))
,@(list (list (concat "^"
(make-string c-basic-offset ? )
"\\(\\(private\\|protected\\|public\\) \
\)?"
"\\(\\(abstract\\|static\\|final\\) \\)*"
"[A-Z] "
"\\([a-z][a-zA-Z0-9]+\\)(")
5 'font-lock-function-name-face t)))))
^L
(when (and prefs-font-xtra (or (eq major-mode 'compilation-mode)
(eq major-mode 'Info-mode)))
(d-font-lock-add-begin
'(
("(\\([^ ()]*\\.sjs\\):\\([0-9]+\\))" (1 'd-face-link t) (2 'd-
face-line t))
;;("[0-9]+" 0 'd-face-link t)
;;("fuck" 0 'd-face-link t)
;; NOTE: Various levels of documentation
;;("^\\*.*$" 0 'fg:cyan t)
;;("^\\*\\*.*$" 0 'fg:green t)
;;("^\\*\\*\\*.*$" 0 'fg:lightred t)
;;("^\\*\\*\\*\\*.*$" 0 'bg:yellow t)
("^\\*.*[\r\n]+" 0 'fg:lightblue t)
("^\\*\\*.*[\r\n]+" 0 'fg:lightgreen t)
("^\\*\\*\\*.*[\r\n]+" 0 'fg:lightred t)
("^\\*\\*\\*\\*.*[\r\n]+" 0 'bg:yellow t)
("^cd .*$" 0 'font-lock-keyword-face
t)
("^make .*$" 0 'font-lock-keyword-face
t)
("^.*tar cf.*$" 0 'font-lock-keyword-face
t)
("^-----.*$" 0 'fg:cyan t)
("^\\(Compilation\\|Grep\\) \\(started\\|exited\\|finished\\|
interrupt\\).*$" 0 'font-lock-keyword-face t)
("^Compilation took.*$" 0 'font-lock-keyword-face t)
)))
^L
(when (eq major-mode 'html-mode)
(setq font-lock-keywords nil)
(setq font-lock-keywords-case-fold-search nil))
(when (and prefs-font prefs-font-xtra (eq major-mode 'html-mode))
;;(d-foo)
(d-font-lock-add-end
'( ;;("FUCK" 0 'd-face-cc-illegal-type t)
("\\<\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\<\\([^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\<\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\<\\([^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\(\\<PCOD\\)(\\([^)]*\\))" (1 'fg:lightgreen t) (2 'bold
t)) ;;; PHP code
("\\(\\<FCOD\\)(\\([^)]*\\))" (1 'fg:lightred t) (2 'bold
t)) ;;; FILE code (filename)
("\\(\\<MCOD\\)(\\([^)]*\\))" (1 'fg:lightmagenta t) (2 'bold
t)) ;;; MAKE code
("\\<\\(\\)(\\(.*\\))" (1 'fg:lightred t)
(2 'bold t))
("\\<\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\<\\([^()\n\r]*\\)?" (0 'fg:lightred
t) (1 'bold t))
("\\<M4_\\([_A-Z][_A-Z0-9]*\\)" (0 'd-face-el-
d-stuff t) )
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-comment-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-keyword-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-string-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3
'fg:lightmagenta t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-type-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-variable-name-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) (3 'font-
lock-function-name-face t))
("\\(^\\|[^a-zA-Z]\\)\\(\\)(\\([^)]*\\)" (2 'bold t) )
("\\(\\<KB\\)(\\([^)]*\\)" (1 'bold t) (2 'fg:lightgreen t))
("\\<SECT_[^ \r\n\t,<>]*\\>" 0 'font-lock-function-name-face t)
("\\<QEST_[^ \r\n\t,<>]*\\>" 0 'font-lock-function-name-face t)
("\\<TUTE_[^ \r\n\t,<>]*\\>" 0 'font-lock-function-name-face t)
("\\<\\(ABSTRACT\\|AND\\|ASSERT\\|class\\|BEGIN\\|BEGINMAIN\\|
BREAK\\|CASE\\|CLASSVAR\\|CONSTRUCTOR\\|DO\\|ELSE\\|END\\|ENDMAIN\\|
EXTENDS\\|finaL\\|FOR\\|FUNCTION\\|if\\|INSTANCEOF\\|METHOD\\|new\\|OR\
\|private\\|PROPERTY\\|protected\\|PUBLIC\\|return\\|STATIC\\|SUPER\\|
SWITCH\\|THEN\\|this\\|VAR\\|while\\)\\>" 0 'font-lock-keyword-face
nil)
("\\<\\(BOOLEAN\\|char\\|double\\|FLOAT\\|int\\|LONG\\|SHORT\\|
STRING\\|void\\)\\>" 0 'font-lock-type-face nil)
("\\<SYSTEM_OUT_PRINT\\(LN\\)?\\>" 0 'd-face-cc-global t)
("\\<\\(NULL\\|NIL\\|FALSE\\|TRUE\\)\\>" 1 font-lock-constant-
face nil)
("\\<ENTY([^)]*)" 0 'fg:red t)
)))
;;; error here
(when (eq major-mode 'html-mode)
;;(set (make-local-variable 'font-lock-string-face) nil)
;;(setq font-lock-string-face nil)
(d-font-lock-add-end
`(
(,(concat "\\<m4" "_esyscmd(\\(.*\\))") 1 'bold t)
;;("\\<m4_r?include(\\(.*\\))" 1 'bold t)
;;("m4 subsection[a-z_]*(\\(.*\\))" 1 'bg:yellow t)
;;("m4 section[a-z_]*(\\(.*\\))" 1 'bg:yellow t)
;;("m4 input_[a-z]*(\\(.*\\))" 1 'fg:lightred t)
;;("[Hh][Rr][Ee][Ff]=[^>]*>" 0 'fg:lightred t)
("<[Aa] [^>\n]*>\\([^\n<>]*\\)" 1 'fg:lightblue t)
("</[Aa]>" ("\\([^\n<>]*\\)</[Aa]>" (beginning-of-line) (end-of-
line) (1 'fg:lightblue t)))
("<[Aa] .*>\\(.*\\)</[Aa]>" 1 'fg:lightblue t)
("[^-]>" ("[^<>]*>" (beginning-of-line) (end-of-line) (0 'font-
lock-keyword-face t)))
("<[Ee][Mm]>\\([^<]*\\)" 1 'bold t)
("</[Ee][Mm]>" ("\\([^<>]*\\)</[Ee][Mm]>" (beginning-of-line)
(end-of-line) (1 'bold t)))
;; ("<[Ss][Pp][Aa][Nn][^>]*>\\([^<>\n]*\\)" 1 'd-face-
green-and-white)
;; ("</[Ss][Pp][Aa][Nn]>" ("\\([^<>\n]*\\)</[Ss][Pp][Aa]
[Nn]>"
;; (beginning-of-line)
;; (end-of-line)
;; (1 'd-face-green-and-white
t)))
;;
;; ("<[Ff][Oo][Nn][Tt][^>]*>\\([^<>\n]*\\)" 1 'd-face-
green-and-white)
;; ("</[Ff][Oo][Nn][Tt]>" ("\\([^<>\n]*\\)</[Ff][Oo][Nn]
[Tt]>"
;; (beginning-of-line)
;; (end-of-line)
;; (1 'd-face-green-and-white
t)))
;;
;; ("<[Ii]>\\([^<]*\\)" 1 'italic t)
("</[Ii]>" ("\\([^<>]*\\)</[Ii]>" (beginning-of-line) (end-of-
line) (1 'italic t)))
("<[Ii]>\\(.*\\)</[Ii]>" 1 'italic t)
("<[Bb]>\\(.*\\)</[Bb]>" 1 'bold t)
("<[Uu]>\\(.*\\)</[Uu]>" 1 'underline t)
("<[Ee][Mm]>\\(.*\\)</[Ee][Mm]>" 1 'bold t)
("<[Tt][Tt]>\\(.*\\)</[Tt][Tt]>" 1 'bold t)
("<[Ss][Tt][Rr][Oo][Nn][Gg]>\\(.*\\)</[Ss][Tt][Rr][Oo][Nn]
[Gg]>" 1 'bold t)
("<[Tt][Ii][Tt][Ll][Ee]>\\(.*\\)</[Tt][Ii][Tt][Ll][Ee]>" 1
'font-lock-function-name-face t)
("<[Hh][0-9]>\\(.*\\)</[Hh][0-9]>" 1 'font-lock-function-name-
face t)
("<[^!][^>]*>?" 0 'font-lock-keyword-face t)
("</?\\(form\\|input\\|select\\|textarea\\|option\\)[^>]*>?" 0
'fg:green t)
("</?\\(applet\\|param\\)[^>]*>?" 0 'fg:red t)
("<![^>]*>?" 0 'font-lock-comment-face t)
("\\<m4_\\([_a-zA-Z0-9]*\\)" (0 'd-face-m4 t) )
("\\<m5_\\([_a-zA-Z0-9]*\\)" (0 'd-face-m5 t) )
("\\<m6_\\([_a-zA-Z0-9]*\\)" (0 'd-face-m6 t) )
(,(concat "\\(\\<m4" "dnl\\>\\)\\([^\r\n]*\\)$") (1 'd-face-m4-
dnl t) (2 'font-lock-comment-face t))
(,(concat "\\(\\<m4" "ignore\\>\\)") (1 'd-face-m4-dnl t))
("^\\(H2\\)(\\([^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("^\\(H2\\)(\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("^\\(H3\\)(\\([^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("^\\(H3\\)(\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("^\\(H4\\)(\\([^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("^\\(H4\\)(\\([^()\n\r]*([^()\n\r]*)[^()\n\r]*\\))?" (1 'bold
t) (2 'font-lock-function-name-face t))
("\\(\\<NOTE[:!?]\\)[ \t]+\\([^\r\n]*\\)" (1 'bg:lightmagenta
t) (2 'fg:lightmagenta t))
("\\(\\<TODO[:!?]\\)[ \t]+\\([^\r\n]*\\)" (1 'bg:lightmagenta
t) (2 'fg:lightmagenta t))
("\\(\\<COOL[:!?]\\)[ \t]+\\([^\r\n]*\\)" (1 'bg:lightmagenta
t) (2 'fg:lightmagenta t))
("&[a-zA-Z0-9]+;" 0 'd-face-html-entity t)
("&#[0-9]+;" 0 'd-face-html-entity t)
("^[ \t]*^L[ \t]*[\r\n]" 0 'd-face-linefeed t))))
(when (and (eq major-mode 'html-mode)
(save-excursion
(goto-char (point-min))
(re-search-forward "<\\?php" nil t)))
(d-font-lock-add-end
'(
("\\(function\\)[ \t]+\\([a-zA-Z0-9_]+\\)([^)]*)" (1 'bold t)
(2 'font-lock-function-name-face t))
("\\(\\(WHERE\\|FROM\\|SELECT\\|INSERT\\|UPDATE\\|delete\\).*\
\)" (1 'fg:lightred t))
("^\\( \\)*\\(isset\\|echo\\|include\\|header\\|exit\\|else\\|
if\\|foreach\\|global\\|return\\|while\\)\\>" (2 'bold t))
("\\<\\(MYSQL_[A-Z]*\\|mysqli?_[a-z_]*\\|and\\|or\\)\\>" (1
'bold t))
("\\(\\<die\\)(" (1 'bold t))
("$[a-zA-Z_][a-zA-Z0-9_]+" (0 'font-lock-variable-name-face t))
("\\(//.*$\\)" (1 'font-lock-comment-face t))
("\\(https?://\\)\\([^ \t\r\n\"><?]*\\)" (1 'bg:lightred t) (2
'fg:lightred t))
)))
(when (and prefs-font-xtra (eq major-mode 'asm-mode))
(d-font-lock-add-end
'(
("\\(^\tcall[ \t]*\\)\\([^\n]*$\\)" (1 'fg:white t) (2
'bg:yellow t))
("\\<_debug\\|_smeg\\>" 0 'bg:yellow t)
)))
(when (and prefs-font-xtra (eq major-mode 'java-mode))
(d-font-lock-add-end
'(
("\\(\\<[A-Z]+[a-z][A-Za-z0-9]*\\)\\." 1 'font-lock-constant-
face t)
("\\<_\\sw+" 0 'd-face-green-and-white t)
("\\(\\<assert\\>\\)\\([^\n;]*\\);" (1 'font-lock-keyword-face
t) (2 'fg:white t))
("\\<\\(Assert\\)\\." 1 'font-lock-keyword-face nil)
("\\<\\(assertEquals\\|assertFalse\\|assertNotNull\\|
assertNotSame\\|assertNull\\|assertSame\\|assertTrue\\|fail\\)(" 1
'font-lock-keyword-face nil)
;;("fuck" 0 'd-face-cc-global t)
("\\<\\(System.out.print\\(ln\\)?\\)(" 1 'd-face-cc-global t)
("\\<\\([a-z][A-Za-z0-9]*\\.printStackTrace\\)(" 1 'd-face-cc-
global nil)
("\\<\\(null\\|true\\|false\\)\\>" 1 'font-lock-constant-face
nil)
)))
(when (and prefs-font-libd prefs-font-xtra)
(if (or (eq major-mode 'c++-mode)
;;(eq major-mode 'text-mode) ;;; NOTE: no because of
Abcdef would be fontified in text-mode
)
(d-font-lock-add-end
'(
("\\(\\<[A-Z]+[a-z][a-zA-Z0-9_]*<.+>\\)::" 1 'font-lock-
type-face t)
("\\(\\<[A-Z]+[a-z][a-zA-Z0-9_]*_A<.+>\\)::" 1 'font-lock-
type-face t)
;;("\\<String\\>" 0 'font-lock-type-face
t)
;;("\\<String_Buffer\\>" 0 'font-lock-type-face
t)
("\\<[A-Z]+[a-z][a-zA-Z0-9_]*_A::" 0 'font-lock-
type-face t)
("\\<\\(Allegro_Init\\|Auto_G_C\\|Dialog\\|File_Reader\\|
File_Writer\\|Font\\|Font_Mine\\|Gulper\\|Reader\\|Reader_Core\\|
Return_Values\\|Round\\|Sprite_A\\|Sprite_Grabber\\|Temp_Blit\\|Writer\
\)\\>" 0 'font-lock-type-face t)
("\\<[A-Z]+[a-z][a-zA-Z0-9_]*::" 0 'font-lock-
type-face t)
("\\<[A-Z]+[a-z][a-zA-Z0-9_]*_A<[A-Z]+[0-9a-zA-Z_]*_A>" 0
'font-lock-type-face t)
("\\<Array_A<Array_A<[A-Z]+[a-zA-Z0-9]*_A>
>" 0 'font-lock-type-face t)
("\\<ptr<[A-Z]+[a-z][a-zA-Z0-9_]*_A>" 0 'font-
lock-type-face t)
("\\<ptr<[A-Z]+[a-z][a-zA-Z0-9_]*_A<[A-Z]+> >" 0 'font-
lock-type-face t)
("\\<ptr<[A-Z]+[a-z][a-zA-Z0-9_]*_A<[A-Z]+[a-z][a-zA-
Z0-9_]*_A> >" 0 'font-lock-type-face t)
("\\<ptr<[A-Z]+[a-z][a-zA-Z0-9_]*_A<[A-Z]+[a-z][a-zA-
Z0-9_]*_A<[A-Z]+[a-z][a-zA-Z0-9_]*+A> > >" 0 'font-lock-type-face t)
("\\<[A-Z]+[a-z][a-zA-Z0-9_]*_A\\*+" 0 'd-face-cc-illegal-
type t)
)
)))
(when (and prefs-font-xtra (or (eq major-mode 'c-mode) (eq major-
mode 'c++-mode) (eq major-mode 'java-mode)))
(d-font-lock-add-end
'(
("/[*][*][*].*[*][*][*]/" 0 'd-face-super-comment t)
;;("/faggot/" 0 'd-face-super-comment t)
)))
(when (and prefs-font-xtra (or (eq major-mode 'c++-mode) (eq major-
mode 'emacs-lisp-mode)))
(d-font-lock-add-end
'(
("N?DEBUG:.*$" 0 'fg:lightmagenta t)
("\\(\\<LINE:[0-9]+\\)[ \t\n]" 1 'd-face-m4 t)
)))
(when (and prefs-font-xtra (eq major-mode 'gud-mode))
(d-font-lock-add-end
'(
("^(gdb)" 0 'fg:white)
("^\\((gdb) \\)?\\(print\\)" 2 'bg:yellow)
("^\\((gdb) \\)?\\(bt\\)" 2 'bg:yellow)
("at \\([^ ]+:[0-9]+\\)" 1 'fg:lightred)
("in \\([^ (]+\\) ?(" (1 'bg:yellow t))
("#0 \\([^(]+\\)" (1 'bg:yellow t))
("^.*(y or n)" 0 'font-lock-keyword-face)
)))
(if (and prefs-font-xtra (string= (buffer-file-name) diary-file))
(d-font-lock-add-end
'(
("^\\(January\\|February\\|March\\|April\\|May\\|June\\|July\
\|August\\|September\\|October\\|November\\|December\\) \\([0-9]+,
[0-9][0-9][0-9][0-9]\\)[ \t]+\\([^ ].*$\\)" (1 'bg:yellow) (2
'bg:yellow) (3 'fg:white))
("Blood.*$" 0 'fg:lightred t)
)))
(when (and prefs-font prefs-font-xtra (or (eq major-mode 'text-mode)
(eq major-mode 'emacs-lisp-mode)))
(d-font-lock-add-end
'(
("\\<emacs-dialect--[a-z]*-p\\>" 0 'd-face-cc-global
nil)
("\\<prefs-[a-z-]*" 0 'd-face-cc-global
nil)
("\\<emacs-version\\>" 0 'd-face-cc-global
nil)
("\\<noninteractive\\>" 0 'd-face-cc-global
nil)
("\\<os-type--[a-z]*-p\\>" 0 'd-face-cc-global
nil)
("\\<window-system\\>" 0 'd-face-cc-global
nil)
("\\<d-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<dc-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<bak--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<cbrow--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<cfm--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<cull-same-dates--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<cull-size-quota--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<diagnose--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<demises--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<datify--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<my-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<log--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<safe-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<simbad--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<sjs-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<sjs2m4-[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<testlinks--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<trashcan--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<warn--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
("\\<weblint--[a-z0-9+:-]*\\>" 0 'd-face-el-d-stuff
nil)
)))
;;
;; BEGIN: comments
;;
(when (and prefs-font-xtra (or (eq major-mode 'c++-mode) (eq major-
mode 'c-mode) (eq major-mode 'java-mode)))
(d-font-lock-add-end
'(
("//.*$" 0 'font-lock-comment-face t)
("///.*$" 0 'd-face-super-comment t)
)))
(when (and prefs-font-xtra (eq major-mode 'emacs-lisp-mode))
(d-font-lock-add-end
'(
(";;.*$" 0 'font-lock-comment-face t)
("^;;;.*$" 0 'd-face-super-comment t)
)))
(when (and prefs-font-xtra (eq major-mode 'makefile-mode))
(d-font-lock-add-end
'(
("^###+.*$" 0 'd-face-super-comment t)
("^#[^#].*$" 0 'font-lock-comment-face t)
)))
(when (and prefs-font-xtra (eq major-mode 'latex-mode))
(d-font-lock-add-end
'(
'"^%%%+.*$" 0 'd-face-super-comment t)))
;;;
;;; END COMMENTS:
;;; BEGIN POST COMMENTS:
;;;
(when (and prefs-font prefs-font-xtra)
(when (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'java-mode)
(eq major-mode 'haskell-mode)
(eq major-mode 'asm-mode)
;;(eq major-mode 'html-mode)
(eq major-mode 'emacs-lisp-mode)
(eq major-mode 'lisp-mode)
(eq major-mode 'prolog-mode)
(eq major-mode 'makefile-mode)
(eq major-mode 'pov-mode)
(eq major-mode 'latex-mode)
(eq major-mode 'fundamental-mode)
(eq major-mode 'text-mode)
(eq major-mode 'compilation-mode)
(eq major-mode 'wiki-mode)
(eq major-mode 'sjs-mode)
)
;;(d-foo)
(d-font-lock-add-end
'( ;; vvvv foooo nnnn foooo
("\\(vvv+\\|nnn+\\)\\(\\([ ][^ \t\n]+\\)+\\)\\([ \t]\\|$\
\)" (1 'fg:red t) (2 'fg:lightblue t))
;; (1) zap skip (23443) sdfsdf
;; [ ]* 0 ...
;; [ ][ ]* is [ ]+ is 1 ...
;; [ ][ ][ ]* is [ ][ ]+ is 2 ...
;; (234) not fontified
;; (234) yes fontified
;; (234) yes fontified
;; (234)yes fontified
;;("\\(^\\|[ \t]\\)\\(([0-9*. ]+)\\)\\(\\([ ][^ \t\n]+\\)+\\)\
\([ \t]\\|$\\)"
("\\(^\\|[ \t][ \t]+\\)\\(([0-9*. ]+)\\)\\(.*\\)"
(2 'fg:red t) (3 'fg:lightblue t))
;; IMPORTANT NOTES: smeg mazza
;; A SEF BAR: dfgsdfgsdf
;;; FIXME: sdfsdfsdfdfdf
;;("\\(\\(\\<[A-Z][^a-z\n!:;() ]*[ ]\\)*[:]+\\)\\(.*$\\)"
;;("abc[$]" 0 'bg:yellow)
))))
(when (and prefs-font prefs-font-xtra)
(when (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'java-mode)
(eq major-mode 'haskell-mode)
(eq major-mode 'asm-mode)
;;(eq major-mode 'html-mode)
(eq major-mode 'emacs-lisp-mode)
(eq major-mode 'lisp-mode)
(eq major-mode 'prolog-mode)
(eq major-mode 'makefile-mode)
(eq major-mode 'pov-mode)
(eq major-mode 'latex-mode)
(eq major-mode 'fundamental-mode)
(eq major-mode 'text-mode)
(eq major-mode 'compilation-mode)
(eq major-mode 'wiki-mode)
(eq major-mode 'sjs-mode)
)
(d-font-lock-add-end
'(
;; FOO-SAD-FSDF: sadfadf
;; NOTE: adfasdfosdf
("\\([ ]\\|^\\)\\(\\([A-Z'-]+[ ]\\)*[A-Z][A-Z0-9.'-]+:\\)\\(.*
$\\)" (2 'd-face-special-reference t) (4 'fg:white t))
;; IMPORTANT NOTES! sdfsdf
;; IMPORTANT NOTES? sdfsdff
("\\(\\<[A-Z][^a-z\n!:;()]*[A-Z0-9][!?]+\\)\\(.*$\\)" (1 'd-
face-green-and-yellow t) (2 'bg:yellow t))
;; QUESTION: hello (not smegged)
("\\(\\<CODE:\\)\\([A-Z ]*\\)\\(.*$\\)" (1 'bg:lightgreen
t) (2 'fg:lightgreen t) (3 default t))
("\\(\\<delete ?ME:\\)\\(.*$\\)" (1 'd-face-cc-
debugging t) (2 'fg:lightgreen t))
("\\(\\<REMOVE ?ME:\\)\\(.*$\\)" (1 'd-face-cc-
debugging t) (2 'fg:lightgreen t))
("\\(\\<PUT BACK:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<NOT DO:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<FIXME[?:!]+\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<TODO[A-Z0-9 .]*[:?]\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<DEBUG[A-Z0-9 ]*:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<BUG[A-Z0-9 ]*:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<FUCK[A-Z0-9 ]*:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<WHY[A-Z0-9 ]*[?:]+\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<WTF[A-Z0-9 ]*[?:]+\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\(\\<WARNING[A-Z0-9 ]*[?:]+\\)\\(.*$\\)" (1 'd-face-red-
and-yellow t) (2 'fg:red t))
("\\(\\<URGENT:\\)\\(.*$\\)" (1
'bg:lightmagenta t) (2 'fg:lightmagenta t))
("\\*[a-zA-Z][a-zA-Z0-9 ]+[a-zA-Z]\\*" 0 'fg:lightred
t) ;; *foo* *m4*
;;("^^L[^\n]*" 0 'd-face-red-and-white t)
))))
(when (and prefs-font prefs-font-xtra)
(when (or (eq major-mode 'text-mode)
(eq major-mode 'emacs-lisp-mode)
;;(eq major-mode 'java-mode)
;;(eq major-mode 'c++-mode)
;;(eq major-mode 'c-mode)
)
(d-font-lock-add-end
'(
;; NOTE: File paths
;; /sdfasdffsd/dasfasdff
;; ~/sdfasdffsd/dasfasdff
;; ~dmp/sdfasdffsd/dasfasdff
;; c:/affsdaf
("\\(^\\|[ \t]+\\)\\(~[a-z0-9]*/[^? ()\t\r\n\"]*\\)" 2 'd-
face-path t)
("\\(^\\|[ \t]+\\)\\(/[^ ()\t\r\n\"]+\\>\\)" 2 'd-
face-path t)
("\\(^\\|[ \t]+\\)\\([a-zA-Z]:/[^ ()\t\r\n\"]*\\)" 2 'd-
face-path t)
))))
;;; error here
;;(message "*truck*")
(when (and prefs-font prefs-font-xtra)
;;(message "*truck2 major-mode=%s" major-mode)
(when (or (eq major-mode 'text-mode)
(eq major-mode 'emacs-lisp-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'html-mode)
(eq major-mode 'sjs-mode)
(eq major-mode 'makefile-mode)
(eq major-mode 'compilation-mode)
)
;;(message "*fuck*") foo.tar fooffuckaff
(d-font-lock-add-end
`(
;;,@(list (concat "fuck") 0 ''dc-face-dired-archives t)
;;,@(list (concat "[^ \t\r\n(),\"{}]*\\." dc-files-regexp--
archives "\\>") 0 'dc-face-dired-archives t)
;;("[^ \t\r\n(),\"{}]*\\.\\(tar\\.gz\\|tar\\|zip\\)\
\>" 0 'dc-face-dired-archives t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(css\\|hts\\|m4\\|html?\\)\
\>" 0 'dc-face-dired-web t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(txt\\)\
\>" 0 'dc-face-dired-text
t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(exe\\|bat\\|dll\\)\
\>" 0 'dc-face-dired-executable t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(flac\\|mid\\|mp3\\|wav\\|wma\\)\
\>" 0 'dc-face-dired-sounds t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(tar\\|gz\\|zip\\)\
\>" 0 'dc-face-dired-archives t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(bmp\\|gif\\|jpg\\|ico\\|pdf\\|png
\\|rle\\)\\>" 0 'dc-face-dired-graphics t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(cc\\|hh\\|el\\|java\\|php\\|js\\)
\\>" 0 'dc-face-dired-sources t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(mpe?g\\|mov\\|avi\\|wmv\\)\
\>" 0 'dc-face-dired-movies t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(class\\|tmp\\|tm4\\|o\\|dep\\)\
\>" 0 'dc-face-dired-unimportant t)
("[^ \t\r\n(),\"{}<>=]*\\.\\(txt\\)
\gt;" 0 'dc-face-dired-
text t)
;; <a href="http://www.foo.com">Not Supposed to be me
;; supposed to be me</a>
("\\(https?://\\)\\([^ \t\r\n\"<>?]*\\)" (1
'bg:lightred t) (2 'fg:lightred t))
("\\(file:///\\)\\([^ \t\r\n\"<>?]*\\)" (1
'bg:lightred t) (2 'fg:lightred t))
("\\(ftp://\\)\\([^ \t\r\n\"<>?]*\\)" (1
'bg:lightred t) (2 'fg:lightred t))
;;("[a-z0-9-]*\\.exe" 1 'fg:orange t)
;;("\\(^\\|[ \t]\\)\\(/[a-zA-Z0-9][^ )\t\r\n\"]*\
\)" 2 'fg:orange t)
("\\<gnu\\.emacs\\.bug\
\>" 0 'fg:lightred t)
("\\<gnu\\.emacs\\.help\
\>" 0 'fg:lightred t)
("\\<gnu\\.emacs\\.sources\
\>" 0 'fg:lightred t)
;; NOTE: Websites
("\\<[Ww][Ww][Ww]\\.[^ \t\r
\n]*" 0 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Cc][Oo][mM]\\(/[^ \t\r\n\"]*\\)?\
\)[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Oo][Rr][Gg]\\(/[^ \t\r\n\"]*\\)?\
\)[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Ee][Du][Uu]\\(/[^ \t\r\n\"]*\\)?\
\)[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Nn][Ee][Tt]\\(/[^ \t\r\n\"]*\\)?\
\)[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Nn][Zz]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Aa][Uu]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Uu][Kk]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Cc][Aa]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Ff][Rr]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Cc][Xx]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n\"]" 1 'fg:lightred t)
;;("\\([a-zA-Z0-9]+\\.\\)+[Cc][Cc]\\(/[^ \t\r\n]*\\)?[ \t\r
\n]" 0 'fg:lightred nil)
("\\(\\([a-zA-Z0-9]+\\.\\)+[Ii][Ll]\\(/[^ \t\r\n\"]*\\)?\\)
[ \t\r\n]" 1 'fg:lightred t)
;;("[^ \n<>]*\\.[Cc][Oo][mM][ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.org[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.edu[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.net[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.nz[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.au[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.uk[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.ca[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.fr[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.cx[ \t
\n]" 0 'fg:lightred t)
;;("[^ \n<>]*\\.il[ \t
\n]" 0 'fg:lightred t)
;; NOTE EMAIL ADDRESSES:
("address@hidden
+" 0 'fg:lightred t)
;;("[-_a-zA-Z0-9]*\\.\\(gz\\|tar\\|.gz\\|zip\
\)" 0 'fg:lightred t)
("[0-9?][0-9?][0-9?][0-9?]-[0-9?][0-9?]-[0-9?]
[0-9?]" 0 'bg:yellow t)
))))
(when (and prefs-font prefs-font-xtra)
(when (eq major-mode 'text-mode)
(d-font-lock-add-end
'(
;;; Headings
(">>>+.*$" 0 'bg:yellow t)
("===+.*$" 0 'bg:yellow t)
("^#+.*$" 0 'bg:yellow t)
("^[ \t]+#.*$" 0 'fg:lightred t)
))
;;(set (make-local-variable 'font-lock-string-face) nil)
))
(when (and prefs-font prefs-font-xtra)
(when (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)
(eq major-mode 'java-mode)
(eq major-mode 'haskell-mode)
(eq major-mode 'emacs-lisp-mode)
(eq major-mode 'lisp-mode)
(eq major-mode 'prolog-mode)
(eq major-mode 'makefile-mode)
(eq major-mode 'pov-mode)
(eq major-mode 'latex-mode)
(eq major-mode 'fundamental-mode)
(eq major-mode 'text-mode)
;;(eq major-mode 'sjs-mode)
;;(eq major-mode 'html-mode)
)
^L
;;(setq font-lock-string-face 'font-lock-string-face)
(d-font-lock-add-end
`(
("\\(^\\|[ ()]\\)\\(m4_[_a-zA-Z][_a-zA-Z0-9]*\\)" 2 'd-face-
m4 t)
("\\(^\\|[ ()]\\)\\(m5_[_a-zA-Z][_a-zA-Z0-9]*\\)" 2 'd-face-
m5 t)
("\\(^\\|[ ()]\\)\\(m6_[_a-zA-Z][_a-zA-Z0-9]*\\)" 2 'd-face-
m6 t)
(,(concat "\\<m4" "_ignore\\>") 0 'd-face-
m4-dnl t)
(,(concat "\\(\\<m4" "dnl\\>\\)\\([^\r\n]*\\)$") (1 'd-face-
m4-dnl t) (2 'font-lock-comment-face nil))
("^[ \t]*^L.*\n" 0 'd-face-linefeed t)
("---+" 0 'fg:lightred t) ;; -------------
("<--+" 0 'fg:lightred t) ;; <----------
))))
(if (and (buffer-file-name) (string-match "\\.lpp$" (buffer-file-
name)))
(d-font-lock-add-end
'(
("\\<c-[^() \t\r\n]*" 0 'fg:lightgreen nil)
("(\\(b\\>\\)" 1 'fg:lightgreen nil)
("(\\(s\\>\\)" 1 'fg:lightgreen nil)
("(\\(bs\\>\\)" 1 'fg:lightgreen nil)
("(\\(f\\>\\)" 1 'fg:lightgreen nil)
)
)
)
(when (or (eq major-mode 'html-mode)
(eq major-mode 'text-mode))
(d-font-lock-add-end
`(
(,(concat "\\<RE" "D([^()]*)") 0 'fg:red t)
(,(concat "\\<RE" "D([^()]*([^()]*)[^()]*)") 0 'fg:red t)
(,(concat "\\<GR" "N([^()]*)") 0 'fg:lightgreen
t)
(,(concat "\\<GR" "N([^()]*([^()]*)[^()]*)") 0 'fg:lightgreen
t)
(,(concat "\\<PU" "R([^()]*)") 0 'fg:magenta t)
(,(concat "\\<PU" "R([^()]*([^()]*)[^()]*)") 0 'fg:magenta t)
(,(concat "\\<BL" "U([^()]*)") 0 'fg:blue t)
(,(concat "\\<BL" "U([^()]*([^()]*)[^()]*)") 0 'fg:blue t))))
;;; error here
(quote
(d-font-lock-add-end
'(
("abc" 0 d-face-cc-global t) ;; defabcdef
))
)
t
)
(safe-require 'dired-colors)
(provide 'd-flock)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- My personal syntax highlighting,
Davin Pearson <=