comparison lisp/progmodes/cc-fonts.el @ 71754:60304f6ae360

* progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el, cc-mode.el: Changes to eradicate eval-after-load.
author Alan Mackenzie <acm@muc.de>
date Mon, 10 Jul 2006 13:17:09 +0000
parents dc49655f57ae
children f0343b6fc846 8a8e69664178
comparison
equal deleted inserted replaced
71753:0f33735837d4 71754:60304f6ae360
346 (save-match-data ,(car highlight)) 346 (save-match-data ,(car highlight))
347 ,(nth 2 highlight)))) 347 ,(nth 2 highlight))))
348 highlights)))) 348 highlights))))
349 nil))) 349 nil)))
350 350
351 (eval-after-load "edebug" 351 ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el.
352 '(progn 352 ; '(progn
353 (def-edebug-spec c-fontify-types-and-refs let*) 353 (def-edebug-spec c-fontify-types-and-refs let*)
354 (def-edebug-spec c-make-syntactic-matcher t) 354 (def-edebug-spec c-make-syntactic-matcher t)
355 ;; If there are literal quoted or backquoted highlight specs in 355 ;; If there are literal quoted or backquoted highlight specs in
356 ;; the call to `c-make-font-lock-search-function' then let's 356 ;; the call to `c-make-font-lock-search-function' then let's
357 ;; instrument the forms in them. 357 ;; instrument the forms in them.
358 (def-edebug-spec c-make-font-lock-search-function 358 (def-edebug-spec c-make-font-lock-search-function
359 (form &rest &or ("quote" (&rest form)) ("`" (&rest form)) form))))) 359 (form &rest &or ("quote" (&rest form)) ("`" (&rest form)) form)));))
360 360
361 (defun c-fontify-recorded-types-and-refs () 361 (defun c-fontify-recorded-types-and-refs ()
362 ;; Convert the ranges recorded on `c-record-type-identifiers' and 362 ;; Convert the ranges recorded on `c-record-type-identifiers' and
363 ;; `c-record-ref-identifiers' to fontification. 363 ;; `c-record-ref-identifiers' to fontification.
364 ;; 364 ;;
2266 `((,(lambda (limit) 2266 `((,(lambda (limit)
2267 (c-font-lock-doc-comments "/[*/]!" limit 2267 (c-font-lock-doc-comments "/[*/]!" limit
2268 autodoc-font-lock-doc-comments))))) 2268 autodoc-font-lock-doc-comments)))))
2269 2269
2270 2270
2271 ;; AWK. 2271 ;; 2006-07-10: awk-font-lock-keywords has been moved back to cc-awk.el.
2272
2273 ;; Awk regexps written with help from Peter Galbraith
2274 ;; <galbraith@mixing.qc.dfo.ca>.
2275 ;; Take GNU Emacs's 'words out of the following regexp-opts. They dont work
2276 ;; in Xemacs 21.4.4. acm 2002/9/19.
2277 (eval-after-load "cc-awk" ; Evaluate while loading cc-fonts
2278 `(defconst awk-font-lock-keywords ; Evaluate after loading cc-awk
2279 ',(eval-when-compile ; Evaluate while compiling cc-fonts
2280 (list
2281 ;; Function names.
2282 '("^\\s *\\(func\\(tion\\)?\\)\\>\\s *\\(\\sw+\\)?"
2283 (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
2284 ;;
2285 ;; Variable names.
2286 (cons
2287 (concat "\\<"
2288 (regexp-opt
2289 '("ARGC" "ARGIND" "ARGV" "BINMODE" "CONVFMT" "ENVIRON"
2290 "ERRNO" "FIELDWIDTHS" "FILENAME" "FNR" "FS" "IGNORECASE"
2291 "LINT" "NF" "NR" "OFMT" "OFS" "ORS" "PROCINFO" "RLENGTH"
2292 "RS" "RSTART" "RT" "SUBSEP" "TEXTDOMAIN") t) "\\>")
2293 'font-lock-variable-name-face)
2294
2295 ;; Special file names. (acm, 2002/7/22)
2296 ;; The following regexp was created by first evaluating this in GNU Emacs 21.1:
2297 ;; (regexp-opt '("/dev/stdin" "/dev/stdout" "/dev/stderr" "/dev/fd/n" "/dev/pid"
2298 ;; "/dev/ppid" "/dev/pgrpid" "/dev/user") 'words)
2299 ;; , removing the "?:" from each "\\(?:" (for backward compatibility with older Emacsen)
2300 ;; , replacing the "n" in "dev/fd/n" with "[0-9]+"
2301 ;; , removing the unwanted \\< at the beginning, and finally filling out the
2302 ;; regexp so that a " must come before, and either a " or heuristic stuff after.
2303 ;; The surrounding quotes are fontified along with the filename, since, semantically,
2304 ;; they are an indivisible unit.
2305 '("\\(\"/dev/\\(fd/[0-9]+\\|p\\(\\(\\(gr\\)?p\\)?id\\)\\|\
2306 std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
2307 \\(\\(\"\\)\\|\\([^\"/\n\r][^\"\n\r]*\\)?$\\)"
2308 (1 font-lock-variable-name-face t)
2309 (8 font-lock-variable-name-face t t))
2310 ;; Do the same (almost) with
2311 ;; (regexp-opt '("/inet/tcp/lport/rhost/rport" "/inet/udp/lport/rhost/rport"
2312 ;; "/inet/raw/lport/rhost/rport") 'words)
2313 ;; This cannot be combined with the above pattern, because the match number
2314 ;; for the (optional) closing \" would then exceed 9.
2315 '("\\(\"/inet/\\(\\(raw\\|\\(tc\\|ud\\)p\\)/lport/rhost/rport\\)\\)\\>\
2316 \\(\\(\"\\)\\|\\([^\"/\n\r][^\"\n\r]*\\)?$\\)"
2317 (1 font-lock-variable-name-face t)
2318 (6 font-lock-variable-name-face t t))
2319
2320 ;; Keywords.
2321 (concat "\\<"
2322 (regexp-opt
2323 '("BEGIN" "END" "break" "continue" "delete" "do" "else"
2324 "exit" "for" "getline" "if" "in" "next" "nextfile"
2325 "return" "while")
2326 t) "\\>")
2327
2328 ;; Builtins.
2329 `(eval . (list
2330 ,(concat
2331 "\\<"
2332 (regexp-opt
2333 '("adump" "and" "asort" "atan2" "bindtextdomain" "close"
2334 "compl" "cos" "dcgettext" "exp" "extension" "fflush"
2335 "gensub" "gsub" "index" "int" "length" "log" "lshift"
2336 "match" "mktime" "or" "print" "printf" "rand" "rshift"
2337 "sin" "split" "sprintf" "sqrt" "srand" "stopme"
2338 "strftime" "strtonum" "sub" "substr" "system"
2339 "systime" "tolower" "toupper" "xor") t)
2340 "\\>")
2341 0 c-preprocessor-face-name))
2342
2343 ;; gawk debugging keywords. (acm, 2002/7/21)
2344 ;; (Removed, 2003/6/6. These functions are now fontified as built-ins)
2345 ;; (list (concat "\\<" (regexp-opt '("adump" "stopme") t) "\\>")
2346 ;; 0 'font-lock-warning-face)
2347
2348 ;; User defined functions with an apparent spurious space before the
2349 ;; opening parenthesis. acm, 2002/5/30.
2350 `(,(concat "\\(\\w\\|_\\)" c-awk-escaped-nls* "\\s "
2351 c-awk-escaped-nls*-with-space* "(")
2352 (0 'font-lock-warning-face))
2353
2354 ;; Space after \ in what looks like an escaped newline. 2002/5/31
2355 '("\\\\\\s +$" 0 font-lock-warning-face t)
2356
2357 ;; Unbalanced string (") or regexp (/) delimiters. 2002/02/16.
2358 '("\\s|" 0 font-lock-warning-face t nil)
2359 ;; gawk 3.1 localizable strings ( _"translate me!"). 2002/5/21
2360 '("\\(_\\)\\s|" 1 font-lock-warning-face)
2361 '("\\(_\\)\\s\"" 1 font-lock-string-face) ; FIXME! not for XEmacs. 2002/10/6
2362 ))
2363 "Default expressions to highlight in AWK mode."))
2364
2365
2366 (cc-provide 'cc-fonts) 2272 (cc-provide 'cc-fonts)
2367 2273
2368 ;;; arch-tag: 2f65f405-735f-4da5-8d4b-b957844c5203 2274 ;;; arch-tag: 2f65f405-735f-4da5-8d4b-b957844c5203
2369 ;;; cc-fonts.el ends here 2275 ;;; cc-fonts.el ends here