Mercurial > hg > xemacs-beta
comparison lisp/packages/font-lock.el @ 126:1370575f1259 xemacs-20-1p1
Import from CVS: tag xemacs-20-1p1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:27:39 +0200 |
parents | 9b50b4588a93 |
children | 538048ae2ab8 |
comparison
equal
deleted
inserted
replaced
125:8b0638b347ec | 126:1370575f1259 |
---|---|
1824 ;; | 1824 ;; |
1825 ;; Fontify function name definitions (GNU style; without type on line). | 1825 ;; Fontify function name definitions (GNU style; without type on line). |
1826 | 1826 |
1827 ;; In FSF this has the simpler definition of "\\sw+" for ctoken. | 1827 ;; In FSF this has the simpler definition of "\\sw+" for ctoken. |
1828 ;; I'm not sure if ours is more correct. | 1828 ;; I'm not sure if ours is more correct. |
1829 (list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) | 1829 ;; This is a subset of the next rule, and is slower when present. --dmoore |
1830 ;; (list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) | |
1830 ;; | 1831 ;; |
1831 ;; fontify the names of functions being defined. | 1832 ;; fontify the names of functions being defined. |
1832 ;; FSF doesn't have this but I think it should be fast for us because | 1833 ;; FSF doesn't have this but I think it should be fast for us because |
1833 ;; our regexp routines are more intelligent than FSF's about handling | 1834 ;; our regexp routines are more intelligent than FSF's about handling |
1834 ;; anchored-at-newline. (When I added this hack in regex.c, it halved | 1835 ;; anchored-at-newline. (When I added this hack in regex.c, it halved |
1835 ;; the time to do the regexp phase of font-lock for a C file!) Not | 1836 ;; the time to do the regexp phase of font-lock for a C file!) Not |
1836 ;; including this discriminates against those who don't follow the | 1837 ;; including this discriminates against those who don't follow the |
1837 ;; GNU coding style. --ben | 1838 ;; GNU coding style. --ben |
1839 ;; x?x?x?y?z should always be: (x(xx?)?)?y?z --dmoore | |
1838 (list (concat | 1840 (list (concat |
1839 "^\\(" ctoken "[ \t]+\\)?" ; type specs; there can be no | 1841 "^\\(" |
1840 "\\(" ctoken "[ \t]+\\)?" ; more than 3 tokens, right? | 1842 "\\(" ctoken "[ \t]+\\)" ; type specs; there can be no |
1841 "\\(" ctoken "[ \t]+\\)?" | 1843 "\\(" |
1844 "\\(" ctoken "[ \t]+\\)" ; more than 3 tokens, right? | |
1845 "\\(" ctoken "[ \t]+\\)" | |
1846 "?\\)?\\)?" | |
1842 "\\([*&]+[ \t]*\\)?" ; pointer | 1847 "\\([*&]+[ \t]*\\)?" ; pointer |
1843 "\\(" ctoken "\\)[ \t]*(") ; name | 1848 "\\(" ctoken "\\)[ \t]*(") ; name |
1844 8 'font-lock-function-name-face) | 1849 10 'font-lock-function-name-face) |
1845 ;; | 1850 ;; |
1846 ;; This is faster but not by much. I don't see why not. | 1851 ;; This is faster but not by much. I don't see why not. |
1847 ;(list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) | 1852 ;(list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) |
1848 ;; | 1853 ;; |
1849 ;; Added next two; they're both jolly-good fastmatch candidates so | 1854 ;; Added next two; they're both jolly-good fastmatch candidates so |
1938 | 1943 |
1939 (setq c++-font-lock-keywords-1 | 1944 (setq c++-font-lock-keywords-1 |
1940 (append | 1945 (append |
1941 ;; | 1946 ;; |
1942 ;; The list `c-font-lock-keywords-1' less that for function names. | 1947 ;; The list `c-font-lock-keywords-1' less that for function names. |
1943 (cdr c-font-lock-keywords-1) | 1948 ;; the simple function form regexp has been removed. --dmoore |
1949 ;;(cdr c-font-lock-keywords-1) | |
1950 c-font-lock-keywords-1 | |
1944 ;; | 1951 ;; |
1945 ;; Fontify function name definitions, possibly incorporating class name. | 1952 ;; Fontify function name definitions, possibly incorporating class name. |
1946 (list | 1953 (list |
1947 '("^\\(\\sw+\\)\\(::\\(\\sw+\\)\\)?[ \t]*(" | 1954 '("^\\(\\sw+\\)\\(::\\(\\sw+\\)\\)?[ \t]*(" |
1948 (1 (if (match-beginning 2) | 1955 (1 (if (match-beginning 2) |