emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114168: Correctly fontify Java class constructors.


From: Alan Mackenzie
Subject: [Emacs-diffs] trunk r114168: Correctly fontify Java class constructors.
Date: Sat, 07 Sep 2013 14:36:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114168
revision-id: address@hidden
parent: address@hidden
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Sat 2013-09-07 14:33:50 +0000
message:
  Correctly fontify Java class constructors.
  * progmodes/cc-langs.el (c-type-decl-suffix-key): Now matches ")"
  in Java Mode.
  (c-recognize-typeless-decls): Set the Java value to t.
  * progmodes/cc-engine.el (c-forward-decl-or-cast-1): While
  handling a "(", add a check for, effectively, Java, and handle a
  "typeless" declaration there.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/cc-engine.el    
ccengine.el-20091113204419-o5vbwnq5f7feedwu-1227
  lisp/progmodes/cc-langs.el     cclangs.el-20091113204419-o5vbwnq5f7feedwu-1228
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-07 10:29:57 +0000
+++ b/lisp/ChangeLog    2013-09-07 14:33:50 +0000
@@ -1,3 +1,13 @@
+2013-09-07  Alan Mackenzie  <address@hidden>
+
+       Correctly fontify Java class constructors.
+       * progmodes/cc-langs.el (c-type-decl-suffix-key): Now matches ")"
+       in Java Mode.
+       (c-recognize-typeless-decls): Set the Java value to t.
+       * progmodes/cc-engine.el (c-forward-decl-or-cast-1): While
+       handling a "(", add a check for, effectively, Java, and handle a
+       "typeless" declaration there.
+
 2013-09-07  Roland Winkler  <address@hidden>
 
        * textmodes/bibtex.el (bibtex-biblatex-entry-alist): Add optional

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2013-08-29 17:26:48 +0000
+++ b/lisp/progmodes/cc-engine.el       2013-09-07 14:33:50 +0000
@@ -6905,32 +6905,38 @@
 
       ;; Skip over type decl prefix operators.  (Note similar code in
       ;; `c-font-lock-declarators'.)
-      (while (and (looking-at c-type-decl-prefix-key)
-                 (if (and (c-major-mode-is 'c++-mode)
-                          (match-beginning 3))
-                     ;; If the third submatch matches in C++ then
-                     ;; we're looking at an identifier that's a
-                     ;; prefix only if it specifies a member pointer.
-                     (when (setq got-identifier (c-forward-name))
-                       (if (looking-at "\\(::\\)")
-                           ;; We only check for a trailing "::" and
-                           ;; let the "*" that should follow be
-                           ;; matched in the next round.
-                           (progn (setq got-identifier nil) t)
-                         ;; It turned out to be the real identifier,
-                         ;; so stop.
-                         nil))
-                   t))
-
-       (if (eq (char-after) ?\()
+      (if (and c-recognize-typeless-decls
+              (equal c-type-decl-prefix-key "\\<\\>"))
+         (when (eq (char-after) ?\()
            (progn
              (setq paren-depth (1+ paren-depth))
-             (forward-char))
-         (unless got-prefix-before-parens
-           (setq got-prefix-before-parens (= paren-depth 0)))
-         (setq got-prefix t)
-         (goto-char (match-end 1)))
-       (c-forward-syntactic-ws))
+             (forward-char)))
+       (while (and (looking-at c-type-decl-prefix-key)
+                   (if (and (c-major-mode-is 'c++-mode)
+                            (match-beginning 3))
+                       ;; If the third submatch matches in C++ then
+                       ;; we're looking at an identifier that's a
+                       ;; prefix only if it specifies a member pointer.
+                       (when (setq got-identifier (c-forward-name))
+                         (if (looking-at "\\(::\\)")
+                             ;; We only check for a trailing "::" and
+                             ;; let the "*" that should follow be
+                             ;; matched in the next round.
+                             (progn (setq got-identifier nil) t)
+                           ;; It turned out to be the real identifier,
+                           ;; so stop.
+                           nil))
+                     t))
+
+         (if (eq (char-after) ?\()
+             (progn
+               (setq paren-depth (1+ paren-depth))
+               (forward-char))
+           (unless got-prefix-before-parens
+             (setq got-prefix-before-parens (= paren-depth 0)))
+           (setq got-prefix t)
+           (goto-char (match-end 1)))
+         (c-forward-syntactic-ws)))
 
       (setq got-parens (> paren-depth 0))
 

=== modified file 'lisp/progmodes/cc-langs.el'
--- a/lisp/progmodes/cc-langs.el        2013-08-25 13:52:14 +0000
+++ b/lisp/progmodes/cc-langs.el        2013-09-07 14:33:50 +0000
@@ -2816,7 +2816,8 @@
                     "\\>")
                  "")
                "\\)")
-  (java idl) "\\([\[\(]\\)")
+  java "\\([\[\(\)]\\)"
+  idl "\\([\[\(]\\)")
 (c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
   'dont-doc)
 
@@ -2937,7 +2938,7 @@
 that are preceded by a declaration starting keyword, so
 e.g. `c-typeless-decl-kwds' may still be used when it's set to nil."
   t nil
-  (c c++ objc) t)
+  (c c++ objc java) t)
 (c-lang-defvar c-recognize-typeless-decls
   (c-lang-const c-recognize-typeless-decls))
 


reply via email to

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