]> code.delx.au - gnu-emacs/blobdiff - lisp/font-lock.el
(scrolling): New group.
[gnu-emacs] / lisp / font-lock.el
index f264805f3d722163d8e084eccb96451119e7e1d8..468235582408d0a949c7a267b129bc205eeb52b2 100644 (file)
 ;;
 ;; Efficient regexps for use as MATCHERs for `font-lock-keywords' and
 ;; `font-lock-syntactic-keywords' can be generated via the function
-;; `regexp-opt', and their depth counted via the function `regexp-opt-depth'.
+;; `regexp-opt'.
 
 ;;; Adding patterns for modes that already support Font Lock:
 
@@ -332,10 +332,10 @@ MATCH-HIGHLIGHT should be of the form:
 where MATCHER can be either the regexp to search for, or the function name to
 call to make the search (called with one argument, the limit of the search) and
 return non-nil if it succeeds (and set `match-data' appropriately).
-MATCHER regexps can be generated via the function `regexp-opt'.  MATCH is the
-subexpression of MATCHER to be highlighted.  MATCH can be calculated via the
-function `regexp-opt-depth'.  FACENAME is an expression whose value is the face
-name to use.  Face default attributes can be modified via \\[customize].
+MATCHER regexps can be generated via the function `regexp-opt'.  MATCH is
+the subexpression of MATCHER to be highlighted.  FACENAME is an expression
+whose value is the face name to use.  Face default attributes can be
+modified via \\[customize].
 
 OVERRIDE and LAXMATCH are flags.  If OVERRIDE is t, existing fontification can
 be overwritten.  If `keep', only parts not already fontified are highlighted.
@@ -532,9 +532,10 @@ the differences are listed below.  MATCH-HIGHLIGHT should be of the form:
 
  (MATCH SYNTAX OVERRIDE LAXMATCH)
 
-where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR), the name of a
-syntax table, or an expression whose value is such a form or a syntax table.
-OVERRIDE cannot be `prepend' or `append'.
+where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR) (see
+also `string-to-syntax'), the name of a syntax table, or an expression
+whose value is such a form or a syntax table.  OVERRIDE cannot be
+`prepend' or `append'.
 
 For example, an element of the form highlights syntactically:
 
@@ -638,6 +639,7 @@ Major/minor modes can set this variable if they know which option applies.")
         (when (and (not modified) (buffer-modified-p))
           (set-buffer-modified-p nil)))))
   (put 'save-buffer-state 'lisp-indent-function 1)
+  (def-edebug-spec save-buffer-state let)
   ;;
   ;; Shut up the byte compiler.
   (defvar global-font-lock-mode)       ; Now a defcustom.
@@ -1390,8 +1392,10 @@ see `font-lock-syntactic-keywords'."
         (start (match-beginning match)) (end (match-end match))
         (value (nth 1 highlight))
         (override (nth 2 highlight)))
-    (unless (numberp (car-safe value))
-      (setq value (eval value)))
+    (cond ((stringp value)
+          (setq value (string-to-syntax value)))
+         ((not (numberp (car-safe value)))
+          (setq value (eval value))))
     (cond ((not start)
           ;; No match but we might not signal an error.
           (or (nth 3 highlight)
@@ -1577,9 +1581,10 @@ LIMIT can be modified by the value of its PRE-MATCH-FORM."
        (put-text-property (point) limit 'font-lock-multiline t)))
     (save-match-data
       ;; Find an occurrence of `matcher' before `limit'.
-      (while (if (stringp matcher)
-                (re-search-forward matcher limit t)
-              (funcall matcher limit))
+      (while (and (< (point) limit)
+                 (if (stringp matcher)
+                     (re-search-forward matcher limit t)
+                   (funcall matcher limit)))
        ;; Apply each highlight to this instance of `matcher'.
        (setq highlights lowdarks)
        (while highlights
@@ -2094,7 +2099,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
                   "\\)\\)\\>"
                   ;; Any whitespace and defined object.
                   "[ \t'\(]*"
-                  "\\(\\sw+\\)?")
+                  "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
           '(1 font-lock-keyword-face)
           '(9 (cond ((match-beginning 3) font-lock-function-name-face)
                     ((match-beginning 6) font-lock-variable-name-face)
@@ -3095,8 +3100,13 @@ See also `java-font-lock-extra-types'.")
     '("\\<\\(false\\|null\\|true\\)\\>" . font-lock-constant-face)
     ;;
     ;; Javadoc tags within comments.
-    '("@\\(author\\|deprecated\\|link\\|return\\|see\\|version\\)\\>"
-      (1 font-lock-constant-face prepend))
+    (list
+     (concat "@\\("
+            "author\\|deprecated\\|exception"
+            "\\|link\\|return\\|see\\|serial\\|serialData\\|serialField"
+            "\\|since\\|throws"
+            "\\|version"
+            "\\)\\>"))
     '("@\\(param\\)\\>[ \t]*\\(\\sw+\\)?"
       (1 font-lock-constant-face prepend)
       (2 font-lock-variable-name-face prepend t))