emacs-diffs
[Top][All Lists]
Advanced

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

master 90cd4d6 2/2: Add pretty symbols to ruby-mode


From: Lars Ingebrigtsen
Subject: master 90cd4d6 2/2: Add pretty symbols to ruby-mode
Date: Sat, 29 May 2021 02:08:45 -0400 (EDT)

branch: master
commit 90cd4d6caeac337054fa0c4548281cc54eed37d3
Author: William Denton <wtd@pobox.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add pretty symbols to ruby-mode
    
    * lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add
    pretty symbols (bug#48681).
    (ruby-mode): Use them.
---
 lisp/progmodes/ruby-mode.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 0c54a1d..cb8bbcd 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2421,6 +2421,14 @@ If there is no Rubocop config file, Rubocop will be 
passed a flag
    report-fn
    args))
 
+(defconst ruby--prettify-symbols-alist
+  '(("<=" . ?≤)
+    (">=" . ?≥)
+    ("->"  . ?→)
+    ("=>"  . ?⇒)
+    ("::" . ?∷))
+  "Value for `prettify-symbols-alist' in `ruby-mode'.")
+
 ;;;###autoload
 (define-derived-mode ruby-mode prog-mode "Ruby"
   "Major mode for editing Ruby code."
@@ -2437,6 +2445,7 @@ If there is no Rubocop config file, Rubocop will be 
passed a flag
 
   (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil
                                    ((?_ . "w"))))
+  (setq-local prettify-symbols-alist ruby--prettify-symbols-alist)
 
   (setq-local syntax-propertize-function #'ruby-syntax-propertize))
 



reply via email to

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