From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.bugs Subject: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode Date: Sun, 27 Sep 2015 08:39:20 +0800 Message-ID: References: <1443268188.7436.0@smtp.gmail.com> <834mihgvb9.fsf@gnu.org> <1443283198.7442.0@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443314424 32031 80.91.229.3 (27 Sep 2015 00:40:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Sep 2015 00:40:24 +0000 (UTC) Cc: 21568@debbugs.gnu.org, dgutov@yandex.ru To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 27 02:40:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zg00h-000350-Bz for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Sep 2015 02:40:11 +0200 Original-Received: from localhost ([::1]:55706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg00g-0004Bh-B8 for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Sep 2015 20:40:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg00d-0004A5-51 for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 20:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zg00Z-0000Bn-Vt for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 20:40:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg00Z-0000Az-TL for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 20:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zg00Z-0003Se-AH for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 20:40:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xue Fuqiao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Sep 2015 00:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21568 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 21568-submit@debbugs.gnu.org id=B21568.144331436313254 (code B ref 21568); Sun, 27 Sep 2015 00:40:02 +0000 Original-Received: (at 21568) by debbugs.gnu.org; 27 Sep 2015 00:39:23 +0000 Original-Received: from localhost ([127.0.0.1]:45323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zfzzv-0003Ri-4r for submit@debbugs.gnu.org; Sat, 26 Sep 2015 20:39:23 -0400 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:34414) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zfzzt-0003RY-1Y for 21568@debbugs.gnu.org; Sat, 26 Sep 2015 20:39:21 -0400 Original-Received: by iofb144 with SMTP id b144so144512564iof.1 for <21568@debbugs.gnu.org>; Sat, 26 Sep 2015 17:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=q10h1vxoyuBdcARL8VgtSpj0wPkB65ZbyIwzeZRoQ+4=; b=qdN3p27d05eoWvHt+258TAAhzWMkcPADwl8XsY+7MVyh8kpOwzm1ryRSsIQQvtBmDf I1ryWxBOh/MWQEu7ys/xbzaztKFPzuu2RexbxnInleoaL+PJGunE7gd2bgAKcWZNwJd9 sBAX9eGAX9h4OjXqEHjgcePop3qnSSGCgiNKgxtnYl4hM9mm0EhG9exEdLXGV0mM8WsA PJSgL5hmnCItVmeVzjL/hqfe9iPbW/xonDtJRV2xlE8obH7Nad4vcuEEr+jJJk9y3EZc jdqjNYOQA3Vg4AJiBjfbuZOukKO8XoU+3cHlNporxGrofv8uXJb+xAa/3mXiFIlHMqNS NqcA== X-Received: by 10.107.16.80 with SMTP id y77mr11692003ioi.183.1443314360391; Sat, 26 Sep 2015 17:39:20 -0700 (PDT) Original-Received: by 10.79.94.2 with HTTP; Sat, 26 Sep 2015 17:39:20 -0700 (PDT) In-Reply-To: <1443283198.7442.0@smtp.gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106953 Archived-At: On Sat, Sep 26, 2015 at 11:59 PM, Simen Heggest=C3=B8yl 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: =3D?UTF-8?q?Simen=3D20Heggest=3DC3=3DB8yl?=3D > 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 > + '(("=3D>" . ?=E2=87=92) > + (">=3D" . ?=E2=89=A5) > + ("<=3D" . ?=E2=89=A4)) > + "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 fo= r 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 fo= r a > new one." > > (provide 'js) > > +;; Local Variables: > +;; coding: utf-8 > +;; End: > + > ;; js.el ends here > -- > 2.5.3 >