diff lisp/font-lock.el @ 83306:8b66fddd72c5

Merged from miles@gnu.org--gnu-2005 (patch 307-312) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-307 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-308 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-309 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-310 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-311 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-312 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-346
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 16 May 2005 15:49:27 +0000
parents 6fef25c75847 ebcb47e6b3f3
children 21eea50897a7
line wrap: on
line diff
--- a/lisp/font-lock.el	Sat May 14 01:56:59 2005 +0000
+++ b/lisp/font-lock.el	Mon May 16 15:49:27 2005 +0000
@@ -1311,12 +1311,19 @@
 
 ;;; Syntactic fontification functions.
 
+(defvar font-lock-comment-start-skip nil
+  "If non-nil, Font Lock mode uses this instead of `comment-start-skip'.")
+
+(defvar font-lock-comment-end-skip nil
+  "If non-nil, Font Lock mode uses this instead of `comment-end'.")
+
 (defun font-lock-fontify-syntactically-region (start end &optional loudly ppss)
   "Put proper face on each string and comment between START and END.
 START should be at the beginning of a line."
   (let ((comment-end-regexp
-         (regexp-quote
-          (replace-regexp-in-string "^ *" "" comment-end)))
+	 (or font-lock-comment-end-skip
+	     (regexp-quote
+	      (replace-regexp-in-string "^ *" "" comment-end))))
         state face beg)
     (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name)))
     (goto-char start)
@@ -1334,12 +1341,14 @@
 					    'syntax-table))
 	    (when face (put-text-property beg (point) 'face face))
 	    (when (and (eq face 'font-lock-comment-face)
-                       comment-start-skip)
+                       (or font-lock-comment-start-skip
+			   comment-start-skip))
 	      ;; Find the comment delimiters
 	      ;; and use font-lock-comment-delimiter-face for them.
 	      (save-excursion
 		(goto-char beg)
-		(if (looking-at comment-start-skip)
+		(if (looking-at (or font-lock-comment-start-skip
+				    comment-start-skip))
 		    (put-text-property beg (match-end 0) 'face
 				       font-lock-comment-delimiter-face)))
 	      (if (looking-back comment-end-regexp (point-at-bol))