diff options
| author | Glenn Morris | 2012-08-20 00:30:40 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-08-20 00:30:40 -0700 |
| commit | 36e8d1eb27b39ea35e9a57575858cb86a8784f2a (patch) | |
| tree | e486afda7611542e4728acca73d8b0c3ba020ee9 | |
| parent | b96e5814f9fdb124f283b8051cc11d667d948d01 (diff) | |
| download | emacs-36e8d1eb27b39ea35e9a57575858cb86a8784f2a.tar.gz emacs-36e8d1eb27b39ea35e9a57575858cb86a8784f2a.zip | |
* lisp/font-lock.el (font-lock-add-keywords): Doc fix
(quote face names since most non-font-lock faces are not also variables).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/font-lock.el | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2895aef3a7e..b944746861c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * font-lock.el (font-lock-add-keywords): Doc fix (quote face names | ||
| 4 | since most non-font-lock faces are not also variables). | ||
| 5 | |||
| 1 | 2012-08-20 Edward Reingold <reingold@iit.edu> | 6 | 2012-08-20 Edward Reingold <reingold@iit.edu> |
| 2 | 7 | ||
| 3 | * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): | 8 | * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f3e313e9c35..77c21d26535 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -146,8 +146,8 @@ | |||
| 146 | ;; fontified automagically. In your ~/.emacs there could be: | 146 | ;; fontified automagically. In your ~/.emacs there could be: |
| 147 | ;; | 147 | ;; |
| 148 | ;; (defvar foo-font-lock-keywords | 148 | ;; (defvar foo-font-lock-keywords |
| 149 | ;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face) | 149 | ;; '(("\\<\\(one\\|two\\|three\\)\\>" . 'font-lock-keyword-face) |
| 150 | ;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face)) | 150 | ;; ("\\<\\(four\\|five\\|six\\)\\>" . 'font-lock-type-face)) |
| 151 | ;; "Default expressions to highlight in Foo mode.") | 151 | ;; "Default expressions to highlight in Foo mode.") |
| 152 | ;; | 152 | ;; |
| 153 | ;; (add-hook 'foo-mode-hook | 153 | ;; (add-hook 'foo-mode-hook |
| @@ -167,8 +167,8 @@ | |||
| 167 | ;; could be: | 167 | ;; could be: |
| 168 | ;; | 168 | ;; |
| 169 | ;; (defvar bar-font-lock-keywords | 169 | ;; (defvar bar-font-lock-keywords |
| 170 | ;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . font-lock-keyword-face) | 170 | ;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . 'font-lock-keyword-face) |
| 171 | ;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . font-lock-type-face)) | 171 | ;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . 'font-lock-type-face)) |
| 172 | ;; "Default expressions to highlight in Bar mode.") | 172 | ;; "Default expressions to highlight in Bar mode.") |
| 173 | ;; | 173 | ;; |
| 174 | ;; and within `bar-mode' there could be: | 174 | ;; and within `bar-mode' there could be: |
| @@ -679,8 +679,8 @@ end of the current highlighting list. | |||
| 679 | For example: | 679 | For example: |
| 680 | 680 | ||
| 681 | (font-lock-add-keywords 'c-mode | 681 | (font-lock-add-keywords 'c-mode |
| 682 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) | 682 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) |
| 683 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face))) | 683 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . 'font-lock-keyword-face))) |
| 684 | 684 | ||
| 685 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in | 685 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in |
| 686 | comments, and to fontify `and', `or' and `not' words as keywords. | 686 | comments, and to fontify `and', `or' and `not' words as keywords. |
| @@ -694,9 +694,9 @@ For example: | |||
| 694 | (add-hook 'c-mode-hook | 694 | (add-hook 'c-mode-hook |
| 695 | (lambda () | 695 | (lambda () |
| 696 | (font-lock-add-keywords nil | 696 | (font-lock-add-keywords nil |
| 697 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) | 697 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) |
| 698 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . | 698 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . |
| 699 | font-lock-keyword-face))))) | 699 | 'font-lock-keyword-face))))) |
| 700 | 700 | ||
| 701 | The above procedure may fail to add keywords to derived modes if | 701 | The above procedure may fail to add keywords to derived modes if |
| 702 | some involved major mode does not follow the standard conventions. | 702 | some involved major mode does not follow the standard conventions. |