emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4fab7ba: ruby-mode: Don't consider `=' a part of sy


From: Dmitry Gutov
Subject: [Emacs-diffs] master 4fab7ba: ruby-mode: Don't consider `=' a part of symbol when followed by `>'
Date: Mon, 09 Mar 2015 03:27:14 +0000

branch: master
commit 4fab7badf5ce341cd6b1e32e72f55eee5c3962e8
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    ruby-mode: Don't consider `=' a part of symbol when followed by `>'
    
    Fixes: debbugs:18644
    
    * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider
    `=' a part of symbol when followed by `>'.
---
 lisp/ChangeLog              |    5 +++++
 lisp/progmodes/ruby-mode.el |   12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3e45813..e184297 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-09  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider
+       `=' a part of symbol when followed by `>'.  (Bug#18644)
+
 2015-03-09  Eli Zaretskii  <address@hidden>
 
        * dired.el (dired-delete-file): Doc fix.  (Bug#20021)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 4abc413..06b1fcf 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2155,8 +2155,16 @@ See `font-lock-syntax-table'.")
     ;; Keywords that evaluate to certain values.
     ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>"
      (0 font-lock-builtin-face))
-    ;; Symbols.
-    
("\\(^\\|[^:]\\)\\(:\\(address@hidden|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
+    ;; Symbols with symbol characters.
+    ("\\(^\\|[^:]\\)\\(:@?\\(?:\\w\\|_\\)+\\)\\([!?=]\\)?"
+     (2 font-lock-constant-face)
+     (3 (unless (and (eq (char-before (match-end 3)) ?=)
+                     (eq (char-after (match-end 3)) ?>))
+          ;; bug#18466
+          font-lock-constant-face)
+        nil t))
+    ;; Symbols with special characters.
+    
("\\(^\\|[^:]\\)\\(:\\(address@hidden|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
      2 font-lock-constant-face)
     ;; Special globals.
     (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"



reply via email to

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