emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111821: Don't use font-lock-syntax-t


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111821: Don't use font-lock-syntax-table in lisp modes.
Date: Sun, 17 Feb 2013 11:58:12 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111821
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2013-02-17 11:58:12 -0500
message:
  Don't use font-lock-syntax-table in lisp modes.
  * lisp/font-lock.el (lisp-font-lock-keywords-1, lisp-font-lock-keywords-2):
  Don't assume all identifier chars have syntax word.
  * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
  Remove bar-not-symbol.  Adjust callers.
  (lisp-mode-variables): Don't set a font-lock-syntax-table.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/lisp-mode.el
  lisp/font-lock.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-17 16:26:38 +0000
+++ b/lisp/ChangeLog    2013-02-17 16:58:12 +0000
@@ -1,3 +1,11 @@
+2013-02-17  Stefan Monnier  <address@hidden>
+
+       * font-lock.el (lisp-font-lock-keywords-1, lisp-font-lock-keywords-2):
+       Don't assume all identifier chars have syntax word.
+       * emacs-lisp/lisp-mode.el (lisp-mode-variables):
+       Remove bar-not-symbol.  Adjust callers.
+       (lisp-mode-variables): Don't set a font-lock-syntax-table.
+
 2013-02-17  Leo Liu  <address@hidden>
 
        * net/rcirc.el (rcirc-keepalive): Fix invalid timer error.
@@ -32,8 +40,8 @@
 
        * net/tramp-compat.el (top): Require 'trampver.
 
-       * net/tramp-sh.el (tramp-remote-process-environment): Set
-       tramp-autoload cookie.
+       * net/tramp-sh.el (tramp-remote-process-environment):
+       Set tramp-autoload cookie.
 
 2013-02-16  Kevin Ryde  <address@hidden>
 

=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el      2013-01-26 15:13:09 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el      2013-02-17 16:58:12 +0000
@@ -187,14 +187,12 @@
               font-lock-string-face))))
     font-lock-comment-face))
 
-(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive
-                                     bar-not-symbol)
+(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive)
   "Common initialization routine for lisp modes.
 The LISP-SYNTAX argument is used by code in inf-lisp.el and is
 \(uselessly) passed from pp.el, chistory.el, gnus-kill.el and
 score-mode.el.  KEYWORDS-CASE-INSENSITIVE non-nil means that for
-font-lock keywords will not be case sensitive.  BAR-NOT-SYMBOL
-non-nil means that | is not a symbol character."
+font-lock keywords will not be case sensitive."
   (when lisp-syntax
     (set-syntax-table lisp-mode-syntax-table))
   (setq-local paragraph-ignore-fill-prefix t)
@@ -228,9 +226,7 @@
   (setq font-lock-defaults
        `((lisp-font-lock-keywords
           lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
-         nil ,keywords-case-insensitive
-         ((,(concat "+-*/.<>=!?$%_&~^:@" (if bar-not-symbol "" "|")) . "w"))
-         nil
+         nil ,keywords-case-insensitive nil nil
          (font-lock-mark-block-function . mark-defun)
          (font-lock-syntactic-face-function
           . lisp-font-lock-syntactic-face-function))))
@@ -553,7 +549,7 @@
 
 Entry to this mode calls the value of `lisp-mode-hook'
 if that value is non-nil."
-  (lisp-mode-variables nil t t)
+  (lisp-mode-variables nil t)
   (setq-local find-tag-default-function 'lisp-find-tag-default)
   (setq-local comment-start-skip
              "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")

=== modified file 'lisp/font-lock.el'
--- a/lisp/font-lock.el 2013-02-16 01:55:31 +0000
+++ b/lisp/font-lock.el 2013-02-17 16:58:12 +0000
@@ -2259,10 +2259,10 @@
                
"\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\(?:-local\\)?\\)\\|"
                ;; Structure declarations.
                "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)"
-               "\\)\\)\\>"
+               "\\)\\)\\_>"
                ;; Any whitespace and defined object.
                "[ \t'\(]*"
-               "\\(setf[ \t]+\\sw+\\|\\sw+\\)?")
+               "\\(setf[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?")
        (1 font-lock-keyword-face)
        (9 (cond ((match-beginning 3) font-lock-function-name-face)
                ((match-beginning 6) font-lock-variable-name-face)
@@ -2299,7 +2299,7 @@
                 "with-silent-modifications" "with-syntax-table"
                 "with-temp-buffer" "with-temp-file" "with-temp-message"
                 "with-timeout" "with-timeout-handler" "with-wrapper-hook") t)
-         "\\>")
+         "\\_>")
          .  1)
        ;; Control structures.  Common Lisp forms.
        (,(concat
@@ -2320,23 +2320,25 @@
                 "with-open-stream" "with-output-to-string"
                 "with-package-iterator" "with-simple-restart"
                 "with-slots" "with-standard-io-syntax") t)
-         "\\>")
+         "\\_>")
          . 1)
        ;; Exit/Feature symbols as constants.
        (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\>"
-                "[ \t']*\\(\\sw+\\)?")
+                "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?")
        (1 font-lock-keyword-face)
        (2 font-lock-constant-face nil t))
        ;; Erroneous structures.
        
("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 
font-lock-warning-face)
        ;; Words inside \\[] tend to be for `substitute-command-keys'.
-       ("\\\\\\\\\\[\\(\\sw+\\)\\]" 1 font-lock-constant-face prepend)
+       ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
+        (1 font-lock-constant-face prepend))
        ;; Words inside `' tend to be symbol names.
-       ("`\\(\\sw\\sw+\\)'" 1 font-lock-constant-face prepend)
+       ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
+        (1 font-lock-constant-face prepend))
        ;; Constant values.
-       ("\\<:\\sw+\\>" 0 font-lock-builtin-face)
+       ("\\<:\\(?:\\sw\\|\\s_\\)+\\>" 0 font-lock-builtin-face)
        ;; ELisp and CLisp `&' keywords as types.
-       ("\\<\\&\\sw+\\>" . font-lock-type-face)
+       ("\\<\\&\\(?:\\sw\\|\\s_\\)+\\>" . font-lock-type-face)
        ;; ELisp regexp grouping constructs
        ((lambda (bound)
           (catch 'found
@@ -2353,11 +2355,11 @@
                     (throw 'found t)))))))
         (1 'font-lock-regexp-grouping-backslash prepend)
         (3 'font-lock-regexp-grouping-construct prepend))
-;;;  This is too general -- rms.
-;;;  A user complained that he has functions whose names start with `do'
-;;;  and that they get the wrong color.
-;;;      ;; CL `with-' and `do-' constructs
-;;;      ("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+       ;; This is too general -- rms.
+       ;; A user complained that he has functions whose names start with `do'
+       ;; and that they get the wrong color.
+       ;; ;; CL `with-' and `do-' constructs
+       ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
       )))
   "Gaudy level highlighting for Lisp modes.")
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]