comparison lisp/font-lock.el @ 40339:6a06f9b1f448

(c-font-lock-keywords-2): Do not require labels to be alone on the line.
author Sam Steingold <sds@gnu.org>
date Fri, 26 Oct 2001 15:04:58 +0000
parents d1a5ac2a48eb
children b2fcb3933879
comparison
equal deleted inserted replaced
40338:ffc4cf9a7cbd 40339:6a06f9b1f448
2330 ("\\(-[0-9]+\\|\\sw+\\)" 2330 ("\\(-[0-9]+\\|\\sw+\\)"
2331 ;; Return limit of search. 2331 ;; Return limit of search.
2332 (save-excursion (skip-chars-forward "^:\n") (point)) 2332 (save-excursion (skip-chars-forward "^:\n") (point))
2333 nil 2333 nil
2334 (1 font-lock-constant-face nil t))) 2334 (1 font-lock-constant-face nil t)))
2335 ;; Anders Lindgren <andersl@andersl.com> points out that it is quicker to 2335 '("\\(\\sw+\\)[ \t]*:" 1 font-lock-constant-face)
2336 ;; use MATCH-ANCHORED to effectively anchor the regexp on the left.
2337 ;; This must come after the one for keywords and targets.
2338 '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$"
2339 (beginning-of-line) (end-of-line)
2340 (1 font-lock-constant-face)))
2341 ))) 2336 )))
2342 2337
2343 (setq c-font-lock-keywords-3 2338 (setq c-font-lock-keywords-3
2344 (append c-font-lock-keywords-2 2339 (append c-font-lock-keywords-2
2345 ;; 2340 ;;
2370 (list (concat "\\<\\(" ,c-type-specs "\\)\\>" 2365 (list (concat "\\<\\(" ,c-type-specs "\\)\\>"
2371 "[ \t]*\\(\\sw+\\)?") 2366 "[ \t]*\\(\\sw+\\)?")
2372 (list 1 'font-lock-keyword-face) 2367 (list 1 'font-lock-keyword-face)
2373 (list ,(+ c-type-specs-depth 2) 'font-lock-type-face nil t) 2368 (list ,(+ c-type-specs-depth 2) 'font-lock-type-face nil t)
2374 (list 'font-lock-match-c-style-declaration-item-and-skip-to-next 2369 (list 'font-lock-match-c-style-declaration-item-and-skip-to-next
2375 nil 2370 nil
2376 ;; Finish with point after the variable name if 2371 ;; Finish with point after the variable name if
2377 ;; there is one. 2372 ;; there is one.
2378 `(if (match-end 2) 2373 `(if (match-end 2)
2379 (goto-char (match-end 2))) 2374 (goto-char (match-end 2)))
2380 ;; Fontify as a variable or function name. 2375 ;; Fontify as a variable or function name.
2381 '(1 (if (match-beginning 2) 2376 '(1 (if (match-beginning 2)
2382 font-lock-function-name-face 2377 font-lock-function-name-face
2383 font-lock-variable-name-face) nil t)))) 2378 font-lock-variable-name-face) nil t))))