From: Xue Fuqiao <xfq.free@gmail.com>
To: "Simen Heggestøyl" <simenheg@gmail.com>
Cc: 21568@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 08:39:20 +0800 [thread overview]
Message-ID: <CAAF+z6FnuzR_0b4LH8jKd5BHs5gjkgLyEN83xS6f_B1-CxEn9A@mail.gmail.com> (raw)
In-Reply-To: <1443283198.7442.0@smtp.gmail.com>
On Sat, Sep 26, 2015 at 11:59 PM, Simen Heggestøyl <simenheg@gmail.com> wrote:
> Alright. Better?
LGTM. WDYT, Dmitry and Daniel?
BTW, Dmitry, maybe you can also apply it to js2-mode.
> 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
>
next prev parent reply other threads:[~2015-09-27 0:39 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
2015-09-27 0:39 ` Xue Fuqiao [this message]
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=CAAF+z6FnuzR_0b4LH8jKd5BHs5gjkgLyEN83xS6f_B1-CxEn9A@mail.gmail.com \
--to=xfq.free@gmail.com \
--cc=21568@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=simenheg@gmail.com \
/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.