GNU bug report logs - #21568
[PATCH] Add prettify-symbols-alist for js-mode

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> gmail.com>

Date: Sat, 26 Sep 2015 11:51:02 UTC

Severity: normal

Tags: patch

Done: Simen Heggestøyl <simenheg <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21568 in the body.
You can then email your comments to 21568 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sat, 26 Sep 2015 11:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simen Heggestøyl <simenheg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 26 Sep 2015 11:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sat, 26 Sep 2015 13:49:48 +0200
[Message part 1 (text/plain, inline)]
With the introduction of the fat arrow (=>) 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 >=
and <= while we're at it:


From fa37953359f50748801717d259350d7e352cff60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg <at> 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 | 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 
`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)
-- 
2.5.1


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sat, 26 Sep 2015 13:33:03 GMT) Full text and rfc822 format available.

Message #8 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sat, 26 Sep 2015 16:32:42 +0300
> Date: Sat, 26 Sep 2015 13:49:48 +0200
> From: Simen Heggestøyl <simenheg <at> gmail.com>
> 
> With the introduction of the fat arrow (=>) 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 >=
> and <= while we're at it:

Thanks, but please add a coding cookie to the file, so that UTF-8
encoded characters in it will always decoded correctly.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sat, 26 Sep 2015 16:01:01 GMT) Full text and rfc822 format available.

Message #11 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sat, 26 Sep 2015 17:59:58 +0200
[Message part 1 (text/plain, inline)]
On Sat, Sep 26, 2015 at 3:32 PM, Eli Zaretskii <eliz <at> 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 <at> 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


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 00:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: Simen Heggestøyl <simenheg <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, dancol <at> dancol.org, 21568 <at> debbugs.gnu.org,
 dgutov <at> yandex.ru
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 08:39:20 +0800
On Sat, Sep 26, 2015 at 11:59 PM, Simen Heggestøyl <simenheg <at> 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 <at> 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
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 02:03:02 GMT) Full text and rfc822 format available.

Message #17 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Xue Fuqiao <xfq.free <at> gmail.com>, Simen Heggestøyl
 <simenheg <at> gmail.com>
Cc: 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 05:01:51 +0300
On 09/27/2015 03:39 AM, Xue Fuqiao wrote:

> LGTM.  WDYT, Dmitry and Daniel?

The patch looks fine to me, but I have no idea if Eli meant to add the 
cookie at the bottom, or whether that request really makes sense at all.

So I'd prefer if he replies as well.

> BTW, Dmitry, maybe you can also apply it to js2-mode.

No need: it inherits from js-mode already.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 06:05:02 GMT) Full text and rfc822 format available.

Message #20 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 09:04:09 +0300
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 05:01:51 +0300
> Cc: 21568 <at> debbugs.gnu.org
> 
> On 09/27/2015 03:39 AM, Xue Fuqiao wrote:
> 
> > LGTM.  WDYT, Dmitry and Daniel?
> 
> The patch looks fine to me, but I have no idea if Eli meant to add the 
> cookie at the bottom

I have no preferences in this regard.

> or whether that request really makes sense at all.

In general, ELisp files don't have to have these cookies, but I'd
prefer such changes to trigger adding them, if only for educational
purposes, so our contributors are aware of this subtle issue.

> So I'd prefer if he replies as well.

The patch is fine with me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 06:13:02 GMT) Full text and rfc822 format available.

Message #23 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 09:12:43 +0300
On 09/27/2015 09:04 AM, Eli Zaretskii wrote:

> I have no preferences in this regard.

Thanks. Simen, please install.

> In general, ELisp files don't have to have these cookies, but I'd
> prefer such changes to trigger adding them, if only for educational
> purposes, so our contributors are aware of this subtle issue.

I'd prefer there not to be any subtle issues here, or that, at least, 
most contributors wouldn't have to be aware of them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 07:29:01 GMT) Full text and rfc822 format available.

Message #26 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 10:28:57 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 09:12:43 +0300
> 
> > In general, ELisp files don't have to have these cookies, but I'd
> > prefer such changes to trigger adding them, if only for educational
> > purposes, so our contributors are aware of this subtle issue.
> 
> I'd prefer there not to be any subtle issues here, or that, at least, 
> most contributors wouldn't have to be aware of them.

Me too.  But we don't have a better solution yet.




Reply sent to Simen Heggestøyl <simenheg <at> gmail.com>:
You have taken responsibility. (Sun, 27 Sep 2015 08:11:02 GMT) Full text and rfc822 format available.

Notification sent to Simen Heggestøyl <simenheg <at> gmail.com>:
bug acknowledged by developer. (Sun, 27 Sep 2015 08:11:03 GMT) Full text and rfc822 format available.

Message #31 received at 21568-done <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>,
 21568-done <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 10:10:55 +0200
[Message part 1 (text/plain, inline)]
On Sun, Sep 27, 2015 at 8:12 AM, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> Thanks. Simen, please install.

Done!

-- Simen
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 08:23:02 GMT) Full text and rfc822 format available.

Message #34 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 11:21:53 +0300
On 09/27/2015 10:28 AM, Eli Zaretskii wrote:

> Me too.  But we don't have a better solution yet.

Do we have a clear statement of the problem (and a bug number, maybe)? 
Is it new? Is it likely to be unsolved until the upcoming release?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 08:40:02 GMT) Full text and rfc822 format available.

Message #37 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 11:39:55 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 11:21:53 +0300
> 
> On 09/27/2015 10:28 AM, Eli Zaretskii wrote:
> 
> > Me too.  But we don't have a better solution yet.
> 
> Do we have a clear statement of the problem (and a bug number, maybe)? 

I just added a few recommendations to CONTRIBUTE about that.

Other than that, we don't have a bug number.  I don't think it's a
bug, more like inconvenient feature: Emacs cannot determine the
encoding of arbitrary text with 100% reliability, so files whose
encoding is not unequivocally determined by their file-name extension
or some other meta-data need a coding cookie to avoid incorrect
decoding.  With UTF-8 encoded files (which is the encoding we prefer
in Emacs), the problem happens in locales whose codeset is not UTF-8,
because Emacs prefers the locale's encoding when no other information
is available.

> Is it new?

No, it's very old.

> Is it likely to be unsolved until the upcoming release?

I'm not aware of anyone working on that, nd it's a large and
complicated problem, so the answer is probably yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 08:51:01 GMT) Full text and rfc822 format available.

Message #40 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 11:50:20 +0300
On 09/27/2015 11:39 AM, Eli Zaretskii wrote:

> I just added a few recommendations to CONTRIBUTE about that.

Thank you, but as long as that's true:

"As of Emacs 24.4, it is no longer necessary to have
explicit 'coding' cookies in *.el files if they are encoded in UTF-8,
but other files need them even if encoded in UTF-8.  And even for *.el
files, having an explicit encoding specification facilitates correct
display of non-ASCII characters when the file is visited in older
Emacs versions."

...we really shouldn't bother contributors with that detail, not should 
we annotate code Elisp files with explicit cookies. Use UTF-8 in them, 
it works fine in Emacs 24.4+, end of story.

If anyone's working on Emacs master using 24.3 or earlier, I'm sure 
there are other footguns they can encounter as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 10:04:02 GMT) Full text and rfc822 format available.

Message #43 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 13:03:48 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 11:50:20 +0300
> 
> On 09/27/2015 11:39 AM, Eli Zaretskii wrote:
> 
> > I just added a few recommendations to CONTRIBUTE about that.
> 
> Thank you, but as long as that's true:
> 
> "As of Emacs 24.4, it is no longer necessary to have
> explicit 'coding' cookies in *.el files if they are encoded in UTF-8,
> but other files need them even if encoded in UTF-8.  And even for *.el
> files, having an explicit encoding specification facilitates correct
> display of non-ASCII characters when the file is visited in older
> Emacs versions."
> 
> ...we really shouldn't bother contributors with that detail

I don't see that as a bother, just as useful information that can do
no harm.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 14:12:02 GMT) Full text and rfc822 format available.

Message #46 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 17:11:37 +0300
On 09/27/2015 01:03 PM, Eli Zaretskii wrote:

> I don't see that as a bother, just as useful information that can do
> no harm.

I'd have been happy not be have been imparted this "information". 
Especially in the form it was presented: adding those cookies everywhere 
conflicts with that bit of knowledge I've had in my head that since some 
recent Emacs version having UTF-8 in Elisp files is not a problem.

We shouldn't treat them like that just because this problem occurs in 
other files. Nor bring it up in discussions on submitted patches.

There are other ways to raise awareness. Like CONTRIBUTE, which now 
features that information. Most contributors aren't going to touch 
anything but Elisp, ever.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 14:29:01 GMT) Full text and rfc822 format available.

Message #49 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Simen Heggestøyl <simenheg <at> gmail.com>,
 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 22:28:54 +0800
On Sun, Sep 27, 2015 at 10:01 AM, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
>> BTW, Dmitry, maybe you can also apply it to js2-mode.
>
> No need: it inherits from js-mode already.

I didn't know that.  Thanks for pointing out this!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 18:38:01 GMT) Full text and rfc822 format available.

Message #52 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 21:37:07 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 17:11:37 +0300
> 
> On 09/27/2015 01:03 PM, Eli Zaretskii wrote:
> 
> > I don't see that as a bother, just as useful information that can do
> > no harm.
> 
> I'd have been happy not be have been imparted this "information". 

Then please ignore it.  No harm done.

> Especially in the form it was presented: adding those cookies everywhere 
> conflicts with that bit of knowledge I've had in my head that since some 
> recent Emacs version having UTF-8 in Elisp files is not a problem.

That's a misrepresentation of what the text says.  It explicitly does
NOT require cookies in ELisp files that are encoded in UTF-8.

> We shouldn't treat them like that just because this problem occurs in 
> other files. Nor bring it up in discussions on submitted patches.

With all due respect, I will bring up whatever issues I think are
important when discussing patches.  Please feel free to bring up those
that you feel to be important.

> There are other ways to raise awareness. Like CONTRIBUTE, which now 
> features that information.

I did both.  Where's the harm?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 19:14:02 GMT) Full text and rfc822 format available.

Message #55 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 22:13:20 +0300
On 09/27/2015 09:37 PM, Eli Zaretskii wrote:

>> Especially in the form it was presented: adding those cookies everywhere
>> conflicts with that bit of knowledge I've had in my head that since some
>> recent Emacs version having UTF-8 in Elisp files is not a problem.
>
> That's a misrepresentation of what the text says. It explicitly does
> NOT require cookies in ELisp files that are encoded in UTF-8.

Right (so I'd only change CONTRIBUTE to say that one needn't bother with 
cookies in *.el files, except in those that are also distributed 
separately).

What I'm referring to is requests such as this one, which I believe 
was/is misleading:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21568#8

Let's not add that to the general practice.

> With all due respect, I will bring up whatever issues I think are
> important when discussing patches.  Please feel free to bring up those
> that you feel to be important.

But there was no issue with that patch. js-mode is not distributed 
separately from Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 19:47:02 GMT) Full text and rfc822 format available.

Message #58 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 22:46:45 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 22:13:20 +0300
> 
> On 09/27/2015 09:37 PM, Eli Zaretskii wrote:
> 
> >> Especially in the form it was presented: adding those cookies everywhere
> >> conflicts with that bit of knowledge I've had in my head that since some
> >> recent Emacs version having UTF-8 in Elisp files is not a problem.
> >
> > That's a misrepresentation of what the text says. It explicitly does
> > NOT require cookies in ELisp files that are encoded in UTF-8.
> 
> Right (so I'd only change CONTRIBUTE to say that one needn't bother with 
> cookies in *.el files, except in those that are also distributed 
> separately).

No, please leave that text alone.  It's okay the way it is.

> What I'm referring to is requests such as this one, which I believe 
> was/is misleading:
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21568#8

I disagree that it was misleading.

> Let's not add that to the general practice.

Now that we have that text in CONTRIBUTE, that's all there is to say.

> > With all due respect, I will bring up whatever issues I think are
> > important when discussing patches.  Please feel free to bring up those
> > that you feel to be important.
> 
> But there was no issue with that patch. js-mode is not distributed 
> separately from Emacs.

I explained my reasons right there and then.

I really don't understand what this attack on me is about.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 20:19:01 GMT) Full text and rfc822 format available.

Message #61 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Sun, 27 Sep 2015 23:18:12 +0300
On 09/27/2015 10:46 PM, Eli Zaretskii wrote:

> No, please leave that text alone.  It's okay the way it is.

I feel that the last sentence causes unnecessary doubt on the part of 
the reader. After all, CONTRIBUTE is intended as a guideline for 
developing Emacs, and the less ambiguous it is, the better.

>> What I'm referring to is requests such as this one, which I believe
>> was/is misleading:
>>
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21568#8
>
> I disagree that it was misleading.

It implied that without that cookie, something in that code might not 
work well.

> Now that we have that text in CONTRIBUTE, that's all there is to say.

All right, thank you.

> I explained my reasons right there and then.

As a counterpoint, I don't believe educational purpose is a good enough 
cause to ask people to use coding cookies in UTF-8 encoded Elisp files.

Even for external packages, over time, Emacs versions where they're 
necessary will sail off into distant past. No need to add to the baggage 
the future people will have to deal with.

> I really don't understand what this attack on me is about.

Please excuse any offense, but I'm not calling you names, or anything 
like that.

I see an attempt to bring in extraneous practice into writing Elisp 
files (as well as reviewing the patches), and speak against it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21568; Package emacs. (Sun, 27 Sep 2015 21:02:02 GMT) Full text and rfc822 format available.

Message #64 received at 21568 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
Subject: Re: bug#21568: [PATCH] Add prettify-symbols-alist for js-mode
Date: Mon, 28 Sep 2015 00:01:50 +0300
> Cc: xfq.free <at> gmail.com, simenheg <at> gmail.com, 21568 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Sun, 27 Sep 2015 23:18:12 +0300
> 
> On 09/27/2015 10:46 PM, Eli Zaretskii wrote:
> 
> > No, please leave that text alone.  It's okay the way it is.
> 
> I feel that the last sentence causes unnecessary doubt on the part of 
> the reader. After all, CONTRIBUTE is intended as a guideline for 
> developing Emacs, and the less ambiguous it is, the better.

I see no ambiguity there.  There are requirements, and there's "a good
idea" with an explanation that is left to the contributors to consider
and decide.  I see nothing wrong with leaving the decision with them.

> >> What I'm referring to is requests such as this one, which I believe
> >> was/is misleading:
> >>
> >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21568#8
> >
> > I disagree that it was misleading.
> 
> It implied that without that cookie, something in that code might not 
> work well.

Then I'm sorry that my wording made such interpretation possible.  It
was certainly not intended.

> > I explained my reasons right there and then.
> 
> As a counterpoint, I don't believe educational purpose is a good enough 
> cause to ask people to use coding cookies in UTF-8 encoded Elisp files.

Let's agree to disagree about that, okay?

> Even for external packages, over time, Emacs versions where they're 
> necessary will sail off into distant past. No need to add to the baggage 
> the future people will have to deal with.

I cannot see how a dozen-character string most users will never even
notice could possibly be a "baggage" of any significance.

> I see an attempt to bring in extraneous practice into writing Elisp 
> files (as well as reviewing the patches), and speak against it.

The form and the intense of the objections are out of proportions,
for such an insignificant issue/disagreement.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 26 Oct 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.