From: "Simen Heggestøyl" <simenheg@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21568@debbugs.gnu.org
Subject: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sat, 26 Sep 2015 17:59:58 +0200 [thread overview]
Message-ID: <1443283198.7442.0@smtp.gmail.com> (raw)
In-Reply-To: <834mihgvb9.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]
On Sat, Sep 26, 2015 at 3:32 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> Thanks, but please add a coding cookie to the file, so that UTF-8
> encoded characters in it will always decoded correctly.
Alright. Better?
From a51d8ceaa7e6114cf775a4f01e16a7cf1403e075 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@gmail.com>
Date: Wed, 23 Sep 2015 21:49:24 +0200
Subject: [PATCH] Add prettify-symbols-alist for js-mode
* lisp/progmodes/js.el (js--prettify-symbols-alist): New defconst.
(js-mode): Use it.
---
lisp/progmodes/js.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 6a800f8..ab994f3 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -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
--
2.5.3
[-- Attachment #2: Type: text/html, Size: 2590 bytes --]
next prev parent reply other threads:[~2015-09-26 15:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 11:49 bug#21568: [PATCH] Add prettify-symbols-alist for js-mode Simen Heggestøyl
2015-09-26 13:32 ` Eli Zaretskii
2015-09-26 15:59 ` Simen Heggestøyl [this message]
2015-09-27 0:39 ` Xue Fuqiao
2015-09-27 2:01 ` Dmitry Gutov
2015-09-27 6:04 ` Eli Zaretskii
2015-09-27 6:12 ` Dmitry Gutov
2015-09-27 7:28 ` Eli Zaretskii
2015-09-27 8:21 ` Dmitry Gutov
2015-09-27 8:39 ` Eli Zaretskii
2015-09-27 8:50 ` Dmitry Gutov
2015-09-27 10:03 ` Eli Zaretskii
2015-09-27 14:11 ` Dmitry Gutov
2015-09-27 18:37 ` Eli Zaretskii
2015-09-27 19:13 ` Dmitry Gutov
2015-09-27 19:46 ` Eli Zaretskii
2015-09-27 20:18 ` Dmitry Gutov
2015-09-27 21:01 ` Eli Zaretskii
2015-09-28 4:16 ` Explicit encoding cookie in Elisp files, was: " Dmitry Gutov
2015-09-28 7:27 ` Explicit encoding cookie in Elisp files " Eli Zaretskii
2015-09-28 7:53 ` Dmitry Gutov
2015-09-28 8:24 ` Eli Zaretskii
2015-09-28 22:54 ` Dmitry Gutov
2015-09-27 8:10 ` bug#21568: [PATCH] " Simen Heggestøyl
2015-09-27 14:28 ` Xue Fuqiao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443283198.7442.0@smtp.gmail.com \
--to=simenheg@gmail.com \
--cc=21568@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.