From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function Date: Fri, 2 Oct 2015 12:50:00 -0400 Message-ID: References: <560C64F5.3060007@cs.ucla.edu> <560E295C.6000402@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e014954acab4f9a052121f688 X-Trace: ger.gmane.org 1443805819 12485 80.91.229.3 (2 Oct 2015 17:10:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2015 17:10:19 +0000 (UTC) Cc: 21588-done@debbugs.gnu.org, Stefan Monnier , Alan Mackenzie To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 19:09:58 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 1Zi3qE-0007AH-Cr for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2015 19:09:54 +0200 Original-Received: from localhost ([::1]:33841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi3qD-0007M1-Vl for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2015 13:09:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi3Y3-0003bx-2n for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 12:51:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi3Xy-0007Ee-Vm for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 12:51:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi3Xy-0007EK-TO for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 12:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zi3Xy-0002gx-Ip for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2015 12:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Oct 2015 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21588 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21588-done@debbugs.gnu.org id=D21588.144380464510318 (code D ref 21588); Fri, 02 Oct 2015 16:51:02 +0000 Original-Received: (at 21588-done) by debbugs.gnu.org; 2 Oct 2015 16:50:45 +0000 Original-Received: from localhost ([127.0.0.1]:52357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zi3Xg-0002gM-4f for submit@debbugs.gnu.org; Fri, 02 Oct 2015 12:50:44 -0400 Original-Received: from mail-ob0-f170.google.com ([209.85.214.170]:35557) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zi3Xc-0002gC-EZ for 21588-done@debbugs.gnu.org; Fri, 02 Oct 2015 12:50:41 -0400 Original-Received: by obbzf10 with SMTP id zf10so86347881obb.2 for <21588-done@debbugs.gnu.org>; Fri, 02 Oct 2015 09:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VKDbtoawX0kRfE/hqepL+QK+fq5uaAErIWY09GErvco=; b=AmLRdIuhGVrYaNv/KKaQ2ZgE9HqfHnO7S9Hw6odzTjM/rnI6M3x10/gyo178X2grIR TGFxDS/VTn3AhzqMqxhz8tjwu1FBkr5oQxDE9VWkRO65RyKOxLFS9OYDCUfs2twLP0of WZRaEiWzXxBdv+dg4oY6MBq7Qg3+ovTEWI8czVpSDCyKV/BNQ7cGYYe66pL0eCDEQw7K Zv0d70vyThFAPhXYyusRC2IhWm1QuILQso+yIYA7FGL8AD9fv6bf8f6dX7goi/NJ1DYu RkLyhmj8J2hFfLZrWacRRYyA6EpD6XbQFistd9rQWX5pUtnKXLYzE4XC4AjbZUw9jgMu xxOQ== X-Received: by 10.182.105.231 with SMTP id gp7mr9856234obb.81.1443804639605; Fri, 02 Oct 2015 09:50:39 -0700 (PDT) Original-Received: by 10.202.172.205 with HTTP; Fri, 2 Oct 2015 09:50:00 -0700 (PDT) In-Reply-To: <560E295C.6000402@cs.ucla.edu> 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:107220 Archived-At: --089e014954acab4f9a052121f688 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tl;dr: Thanks Paul, this is awesome! --- > The GNU coding standards were changed a while ago to recommend against grave quoting in diagnostics and many GNU applications have already changed (e.g., coreutils, GCC). Although Emacs has been one of the holdouts, now is as good a time as any to make the move. I was unaware of that. Thanks for letting me know. For future reference for anyone else, you can learn more about this "C-h i g (standards) Quote Characters". > Thanks, done in the attached patch, which I just installed in the master branch. Thanks! For future reference for anyone else, these clarifications can be viewed in the following info nodes: - (elisp) Displaying Messages - (elisp) Signaling Errors > That discussion was intended to be about text files, so I added a phrase to that effect in the attached patch. This should help resolve the seeming contradiction. - (emacs) Quotation Marks > Any heuristics will go awry sometimes so we need some way to override the heuristics; and once we have such an override, there is a real benefit to keeping the heuristics simple. I agree to that argument. Thanks for fixing the quotes in string formats in few other .el files. In summary: - I agree with you now that the current default value of text-quoting-style is good. - I will stick to that default and find places where the quoting needs to be updated from 'Hey' to `Hey'. - I will submit patches/pull requests wherever I find such instances within emacs or in external packages. Thank you for all your time and effort in making this clear and fixing up the documentation and .el files. -- Kaushal Modi On Fri, Oct 2, 2015 at 2:51 AM, Paul Eggert wrote: > On 09/30/2015 08:54 PM, Kaushal Modi wrote: > > - Can the default be changed to 'grave? > > The GNU coding standards were changed a while ago to recommend against > grave quoting in diagnostics and many GNU applications have already chang= ed > (e.g., coreutils, GCC). Although Emacs has been one of the holdouts, now > is as good a time as any to make the move. > > we need to update the documentation that warns the user to use the correc= t >> style. >> > > Thanks, done in the attached patch, which I just installed in the master > branch. > > > it is mentioned that typewriter quotes are simple and portable. > > That discussion was intended to be about text files, so I added a phrase > to that effect in the attached patch. This should help resolve the seemi= ng > contradiction. > > If we want to keep the default of text-quoting-style as nil (or 'curve), >> more logic needs to be added that decides whether left curly quote or ri= ght >> curly quote should be used, which might have some performance impact as = we >> then need to check what the previous character is, what the next charact= er >> is, etc to decide if the current apostrophe needs to be replaced with a >> left or a right quote. >> > > It=E2=80=99s not a significant performance impact. It=E2=80=99s more a h= assle of > documenting a more-complex approach. That is partly why I gave up on suc= h > an approach after implementing it, and went with the simpler approach tha= t > is in Emacs master now. > > > CASE 1: 'Hey' -> =E2=80=98Hey=E2=80=99 > > CASE 2: it's awesome -> it=E2=80=99s awesome > > CASE 3: my sisters' weddings -> my sisters=E2=80=99 weddings > > CASE 4: He said 'It's awesome!' -> He said =E2=80=98It=E2=80=99s awesom= e!=E2=80=99 > > =E2=80=98message=E2=80=99 already does cases 2 and 3 that way, as well as= the 2nd > apostrophe in case 4. The remaining cases are quite rare in Emacs > diagnostics, as the Emacs style uses directed quotes when single-quoting. > > If there's a non-space character before the apostrophe, replace it with >> right quote, else use left quote. >> > > That would mishandle common English phrases like =E2=80=9C'60s pop cultur= e=E2=80=9D and > =E2=80=9Crock 'n' roll=E2=80=9D. (These phrases don=E2=80=99t occur in E= macs diagnostics either, > but as long as we=E2=80=99re being pedantic....) Any heuristics will go = awry > sometimes so we need some way to override the heuristics; and once we hav= e > such an override, there is a real benefit to keeping the heuristics simpl= e. > --089e014954acab4f9a052121f688 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
tl;dr: Thanks Paul, this is awes= ome!

---=

>=C2= =A0The GNU co= ding standards were changed a while ago to recommend against grave quoting = in diagnostics and many GNU applications have already changed (e.g., coreut= ils, GCC).=C2=A0 Although Emacs has been one of the holdouts, now is as goo= d a time as any to make the move.

I was unaware of that. Thanks for letting me know. For fut= ure reference for anyone else, you can learn more about this "C-h i g= =C2=A0(standards) Quote Characters&= quot;.

>=C2=A0Thanks, done in= the attached patch, which I just installed in the master branch.

Thanks= ! For future reference for anyone else, these clarifications can be viewed = in the following info nodes:=C2=A0

-=C2=A0(elisp) Displaying Messages
-=C2=A0(elisp) Signaling Errors=

>= ;=C2=A0That discussion was intended= to be about text files, so I added a phrase to that effect in the attached= patch.=C2=A0 This should help resolve the seeming contradiction.

-=C2= =A0(emacs) Quotation Marks

>=C2=A0Any heuristics will go awry sometimes so we need s= ome way to override the heuristics; and once we have such an override, ther= e is a real benefit to keeping the heuristics simple.

I agree to that argument.

Thanks for fixing the quotes in str= ing formats in few other .el files.
<= span style=3D"font-size:12.8px;font-family:arial,sans-serif">
In summary:
- I agree with you no= w that the current default value of text-quoting-style is good.
- I will stick to that default and find places where the quot= ing needs to be updated from 'Hey' to `Hey'.
- I will submit patches/pull requests wherever I find such instances= within emacs or in external packages.

=
Thank you for all your time and effort in making this cl= ear and fixing up the documentation and .el files.=C2=A0


=

--
Kaushal Modi

On Fri, Oct 2, 2015 at 2:51 AM, Paul Eggert = <eggert@cs.ucla.edu> wrote:
On 09/30/2015 08:54 PM, Kaushal Modi wrote:
> - Can the default be changed to 'grave?

The GNU coding standards were changed a while ago to recommend against grav= e quoting in diagnostics and many GNU applications have already changed (e.= g., coreutils, GCC).=C2=A0 Although Emacs has been one of the holdouts, now= is as good a time as any to make the move.

we need to update the documentation that warns the user to use the correct = style.

Thanks, done in the attached patch, which I just installed in the master br= anch.

> it is mentioned that typewriter quotes are simple and portable.

That discussion was intended to be about text files, so I added a phrase to= that effect in the attached patch.=C2=A0 This should help resolve the seem= ing contradiction.

If we want to keep the default of text-quoting-style as nil (or 'curve)= , more logic needs to be added that decides whether left curly quote or rig= ht curly quote should be used, which might have some performance impact as = we then need to check what the previous character is, what the next charact= er is, etc to decide if the current apostrophe needs to be replaced with a = left or a right quote.

It=E2=80=99s not a significant performance impact.=C2=A0 It=E2=80=99s more = a hassle of documenting a more-complex approach.=C2=A0 That is partly why I= gave up on such an approach after implementing it, and went with the simpl= er approach that is in Emacs master now.

> CASE 1: 'Hey' -> =E2=80=98Hey=E2=80=99
> CASE 2: it's awesome -> it=E2=80=99s awesome
> CASE 3: my sisters' weddings -> my sisters=E2=80=99 weddings
> CASE 4: He said 'It's awesome!' -> He said =E2=80=98It= =E2=80=99s awesome!=E2=80=99

=E2=80=98message=E2=80=99 already does cases 2 and 3 that way, as well as t= he 2nd apostrophe in case 4.=C2=A0 The remaining cases are quite rare in Em= acs diagnostics, as the Emacs style uses directed quotes when single-quotin= g.

If there's a non-space character before the apostrophe, replace it with= right quote, else use left quote.

That would mishandle common English phrases like =E2=80=9C'60s pop cult= ure=E2=80=9D and =E2=80=9Crock 'n' roll=E2=80=9D.=C2=A0 (These phra= ses don=E2=80=99t occur in Emacs diagnostics either, but as long as we=E2= =80=99re being pedantic....)=C2=A0 Any heuristics will go awry sometimes so= we need some way to override the heuristics; and once we have such an over= ride, there is a real benefit to keeping the heuristics simple.

--089e014954acab4f9a052121f688--