]> code.delx.au - gnu-emacs/commitdiff
Add prettify-symbols-alist for js-mode
authorSimen Heggestøyl <simenheg@gmail.com>
Sun, 27 Sep 2015 08:04:09 +0000 (10:04 +0200)
committerSimen Heggestøyl <simenheg@gmail.com>
Sun, 27 Sep 2015 08:04:09 +0000 (10:04 +0200)
* lisp/progmodes/js.el (js--prettify-symbols-alist): New defconst.
(js-mode): Use it.

lisp/progmodes/js.el

index 6a800f8abe5d1beea804e35d57dd681be63bc3a4..ab994f382529ea51d7159f502a3c122999d598c1 100644 (file)
@@ -1724,6 +1724,12 @@ This performs fontification according to `js--class-styles'."
            (js-syntax-propertize-regexp end))))))
    (point) end))
 
+(defconst js--prettify-symbols-alist
+  '(("=>" . ?⇒)
+    (">=" . ?≥)
+    ("<=" . ?≤))
+  "Alist of symbol prettifications for JavaScript.")
+
 ;;; Indentation
 
 (defconst js--possibly-braceless-keyword-re
@@ -3495,6 +3501,7 @@ If one hasn't been set, or if it's stale, prompt for a new one."
   (setq-local open-paren-in-column-0-is-defun-start nil)
   (setq-local font-lock-defaults (list js--font-lock-keywords))
   (setq-local syntax-propertize-function #'js-syntax-propertize)
+  (setq-local prettify-symbols-alist js--prettify-symbols-alist)
 
   (setq-local parse-sexp-ignore-comments t)
   (setq-local parse-sexp-lookup-properties t)
@@ -3564,4 +3571,8 @@ If one hasn't been set, or if it's stale, prompt for a new one."
 
 (provide 'js)
 
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
 ;; js.el ends here