Skip to content

Commit

Permalink
Add pretty symbols to ruby-mode
Browse files Browse the repository at this point in the history
* lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add
pretty symbols (bug#48681).
(ruby-mode): Use them.
  • Loading branch information
wdenton authored and larsmagne committed May 29, 2021
1 parent 2e1510d commit 90cd4d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lisp/progmodes/ruby-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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))

Expand Down

0 comments on commit 90cd4d6

Please sign in to comment.