From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Newsgroups: gmane.emacs.bugs Subject: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode Date: Sat, 26 Sep 2015 13:49:48 +0200 Message-ID: <1443268188.7436.0@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-ewiT+RYdU0MVQOKmv/qf" X-Trace: ger.gmane.org 1443268287 11894 80.91.229.3 (26 Sep 2015 11:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Sep 2015 11:51:27 +0000 (UTC) To: 21568@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 26 13:51:16 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 1Zfo0W-0006Ks-N2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Sep 2015 13:51:12 +0200 Original-Received: from localhost ([::1]:53396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfo0W-00040n-9F for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Sep 2015 07:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfo0R-00040d-TA for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zfo0M-0001so-Sg for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:51:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfo0M-0001sg-PN for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zfo0M-0001FZ-Iq for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Sep 2015 11:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21568 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14432682034731 (code B ref -1); Sat, 26 Sep 2015 11:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Sep 2015 11:50:03 +0000 Original-Received: from localhost ([127.0.0.1]:44083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfnzN-0001E2-HB for submit@debbugs.gnu.org; Sat, 26 Sep 2015 07:50:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37395) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfnzM-0001Dl-0G for submit@debbugs.gnu.org; Sat, 26 Sep 2015 07:50:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfnzK-0000nX-HO for submit@debbugs.gnu.org; Sat, 26 Sep 2015 07:49:59 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfnzK-0000nT-Ef for submit@debbugs.gnu.org; Sat, 26 Sep 2015 07:49:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfnzJ-0003rP-CQ for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:49:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfnzE-0000iF-2s for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:49:57 -0400 Original-Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:35948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfnzD-0000hm-PG for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 07:49:52 -0400 Original-Received: by laclj5 with SMTP id lj5so26580920lac.3 for ; Sat, 26 Sep 2015 04:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type; bh=l/w/g5NZd2ZX6bfvYFqk+jrW3CzItzrUWSpPII/urQI=; b=Zfl6tSceWUaLTFdGajIzKHf0NKGl00jWv+EMjaWbQxvsYGS1iAj0jdTWRau4R5Hdz3 q7m2jW0hds4m9ucPHCnXOyLz1ZvGThEdYlUoNRz9sg5yrLY1brn/ahQHf0z21JGEj7r2 CVEGo7i1QZ34aPyGSiJQXgiuwhX9BI9Ya5mHrINShIFlmYaRFM2zutIMg/bIt1BtnKxw 7gTNW5WMLD85shkKRoDHGFQZGsJXjvVcs7dFsm6kr3xAA/YKaLayNOewZN4iCFE/KsfG FadN4kPEDyje//aHd6QFYxqj+hc/I3bEt0nV0pmSJSv8zlOBFtjqkoPSa+FqlFwKVhJ/ 3/rg== X-Received: by 10.25.81.3 with SMTP id f3mr1984762lfb.44.1443268190758; Sat, 26 Sep 2015 04:49:50 -0700 (PDT) Original-Received: from [192.168.100.7] (cm-84.210.143.4.getinternet.no. [84.210.143.4]) by smtp.gmail.com with ESMTPSA id d139sm949298lfe.31.2015.09.26.04.49.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Sep 2015 04:49:50 -0700 (PDT) X-Mailer: geary/0.10.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:106939 Archived-At: --=-ewiT+RYdU0MVQOKmv/qf Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable With the introduction of the fat arrow (=3D>) function notation in ECMAScript 6, why not make them prettier by default when prettify-symbols-mode is turned on? I propose the following patch, which also adds pretty versions of >=3D and <=3D while we're at it: From fa37953359f50748801717d259350d7e352cff60 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 6a800f8..f214015 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1724,6 +1724,12 @@ This performs fontification according to=20 `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=20 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) --=20 2.5.1 = --=-ewiT+RYdU0MVQOKmv/qf Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
With the introduction of the fat arrow (=3D>) function notation in<= /div>
ECMAScript 6, why not make them prettier by default when
prettify-symbols-mode is turned on?

I propose th= e following patch, which also adds pretty versions of >=3D
and= <=3D while we're at it:


Fr= om fa37953359f50748801717d259350d7e352cff60 Mon Sep 17 00:00:00 2001
<= div>From: =3D?UTF-8?q?Simen=3D20Heggest=3DC3=3DB8yl?=3D <simenheg@gmail.= com>
Date: Wed, 23 Sep 2015 21:49:24 +0200
Subject: = [PATCH] Add prettify-symbols-alist for js-mode

* l= isp/progmodes/js.el (js--prettify-symbols-alist): New defconst.
(= js-mode): Use it.
---
 lisp/progmodes/js.el | 7 ++= +++++
 1 file changed, 7 insertions(+)

<= div>diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
inde= x 6a800f8..f214015 100644
--- a/lisp/progmodes/js.el
++= + b/lisp/progmodes/js.el
@@ -1724,6 +1724,12 @@ This performs fon= tification according to `js--class-styles'."
     =       (js-syntax-propertize-regexp end))))))
&nbs= p;   (point) end))
 
+(defconst js--prettify-= symbols-alist
+  '(("=3D>" . ?=E2=87=92)
+ &nbs= p;  (">=3D" . ?=E2=89=A5)
+    ("<=3D" . ?= =E2=89=A4))
+  "Alist of symbol prettifications for JavaScri= pt.")
+
 ;;; Indentation
 
 (defconst js--possibly-braceless-keyword-re
@@ -3495,6 +3= 501,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 pars= e-sexp-lookup-properties t)
-- 
2.5.1
<= div>
= --=-ewiT+RYdU0MVQOKmv/qf--