From: William Denton Date: Sat, 29 May 2021 06:08:35 +0000 (+0200) Subject: Add pretty symbols to ruby-mode X-Git-Tag: emacs-28.0.90~2284 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90cd4d6caeac337054fa0c4548281cc54eed37d3;p=emacs.git Add pretty symbols to ruby-mode * lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add pretty symbols (bug#48681). (ruby-mode): Use them. --- 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))