diff lisp/packages/font-lock.el @ 213:78f53ef88e17 r20-4b5

Import from CVS: tag r20-4b5
author cvs
date Mon, 13 Aug 2007 10:06:47 +0200
parents 41ff10fd062f
children 1f0dabaa0855
line wrap: on
line diff
--- a/lisp/packages/font-lock.el	Mon Aug 13 10:05:53 2007 +0200
+++ b/lisp/packages/font-lock.el	Mon Aug 13 10:06:47 2007 +0200
@@ -1183,11 +1183,16 @@
 	  ;; Apply each highlight to this instance of `matcher', which may be
 	  ;; specific highlights or more keywords anchored to `matcher'.
 	  (setq highlights (cdr keyword))
-	(while highlights
-	  (if (numberp (car (car highlights)))
-	      (font-lock-apply-highlight (car highlights))
-	    (font-lock-fontify-anchored-keywords (car highlights) end))
-	  (setq highlights (cdr highlights))))
+	  (while highlights
+	    (if (numberp (car (car highlights)))
+		(let ((end (match-end (car (car highlights)))))
+		  (font-lock-apply-highlight (car highlights))
+		  ;; restart search just after the end of the
+		  ;; keyword so keywords can share bracketing
+		  ;; expressions.
+		  (and end (goto-char end)))
+	      (font-lock-fontify-anchored-keywords (car highlights) end))
+	    (setq highlights (cdr highlights))))
 	(setq keywords (cdr keywords))))
     (if loudly (display-message
 		'progress