From 90cd4d6caeac337054fa0c4548281cc54eed37d3 Mon Sep 17 00:00:00 2001 From: William Denton Date: Sat, 29 May 2021 08:08:35 +0200 Subject: [PATCH] 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 0c54a1d27a6..cb8bbcd9b9a 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)) -- 2.39.5