Mercurial > emacs
comparison lisp/generic.el @ 57113:5bd3a1e1dfe5
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-549
Use symbol-matching for generic-mode keywords
2004-09-15 Miles Bader <miles@gnu.org>
* lisp/generic.el (generic-make-keywords-list): Use symbol rather than
word anchors in regexp.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 15 Sep 2004 04:04:10 +0000 |
parents | 7cb75f6a290a |
children | 9aacf8e5ae58 566253900690 |
comparison
equal
deleted
inserted
replaced
57112:4c14357ffc27 | 57113:5bd3a1e1dfe5 |
---|---|
403 (defun generic-make-keywords-list (keywords-list face &optional prefix suffix) | 403 (defun generic-make-keywords-list (keywords-list face &optional prefix suffix) |
404 "Return a regular expression matching the specified KEYWORDS-LIST. | 404 "Return a regular expression matching the specified KEYWORDS-LIST. |
405 The regexp is highlighted with FACE." | 405 The regexp is highlighted with FACE." |
406 (unless (listp keywords-list) | 406 (unless (listp keywords-list) |
407 (error "Keywords argument must be a list of strings")) | 407 (error "Keywords argument must be a list of strings")) |
408 (list (concat prefix "\\<" | 408 (list (concat prefix "\\_<" |
409 ;; Use an optimized regexp. | 409 ;; Use an optimized regexp. |
410 (regexp-opt keywords-list t) | 410 (regexp-opt keywords-list t) |
411 "\\>" suffix) | 411 "\\_>" suffix) |
412 1 | 412 1 |
413 face)) | 413 face)) |
414 | 414 |
415 (provide 'generic) | 415 (provide 'generic) |
416 | 416 |