all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs is lying to me, or curly quotes strike again
@ 2016-07-07 12:54 Marcin Borkowski
  2016-07-07 13:46 ` Kaushal Modi
  0 siblings, 1 reply; 11+ messages in thread
From: Marcin Borkowski @ 2016-07-07 12:54 UTC (permalink / raw)
  To: emacs-devel@gnu.org

Hi all,

Here's a snippet from a *Help* buffer for JSX-IDE mode:

--8<---------------cut here---------------start------------->8---
JSX-IDE mode defined in ‘js2-mode.el’:
Major mode for editing JSX code.

To customize the indentation for this mode, set the SGML offset
variables (‘sgml-basic-offset’ et al) locally, like so:

  (defun set-jsx-indentation ()
    (setq-local sgml-basic-offset js2-basic-offset))
  (add-hook ’js2-jsx-mode-hook #’set-jsx-indentation)
--8<---------------cut here---------------end--------------->8---

While I do understand that I could toggle some switch to turn off these
retarded curly quotes, but a CODE SNIPPET in a HELP BUFFER should be
COPY-PASTEABLE BY DEFAULT.  (I'm sorry for my angry tone, but this is
yet another case of curly quotes causing problems, and giving NOTHING in
return.  And so many people warned about this - and yet this buggy
behavior was made the default...)

I'm on GNU Emacs 25.1.50.3 (commit debd49b).

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 12:54 Emacs is lying to me, or curly quotes strike again Marcin Borkowski
@ 2016-07-07 13:46 ` Kaushal Modi
  2016-07-07 13:52   ` Kaushal Modi
  2016-07-07 14:04   ` Paul Eggert
  0 siblings, 2 replies; 11+ messages in thread
From: Kaushal Modi @ 2016-07-07 13:46 UTC (permalink / raw)
  To: Marcin Borkowski, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]

What is jsx-ide mode? Is it part of emacs? If not, the package author needs
to fix the documentation.

The closest thing in emacs I could find was js-jsx-mode and the quotes show
up correctly for that: http://i.imgur.com/NCPpuzv.png

On Thu, Jul 7, 2016 at 8:54 AM Marcin Borkowski <mbork@mbork.pl> wrote:

> Hi all,
>
> Here's a snippet from a *Help* buffer for JSX-IDE mode:
>
> --8<---------------cut here---------------start------------->8---
> JSX-IDE mode defined in ‘js2-mode.el’:
> Major mode for editing JSX code.
>
> To customize the indentation for this mode, set the SGML offset
> variables (‘sgml-basic-offset’ et al) locally, like so:
>
>   (defun set-jsx-indentation ()
>     (setq-local sgml-basic-offset js2-basic-offset))
>   (add-hook ’js2-jsx-mode-hook #’set-jsx-indentation)
> --8<---------------cut here---------------end--------------->8---
>
> While I do understand that I could toggle some switch to turn off these
> retarded curly quotes, but a CODE SNIPPET in a HELP BUFFER should be
> COPY-PASTEABLE BY DEFAULT.  (I'm sorry for my angry tone, but this is
> yet another case of curly quotes causing problems, and giving NOTHING in
> return.  And so many people warned about this - and yet this buggy
> behavior was made the default...)
>
> I'm on GNU Emacs 25.1.50.3 (commit debd49b).
>
> Best,
>
> --
> Marcin Borkowski
> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
> Faculty of Mathematics and Computer Science
> Adam Mickiewicz University
>
> --

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2136 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 13:46 ` Kaushal Modi
@ 2016-07-07 13:52   ` Kaushal Modi
  2016-07-07 15:05     ` Drew Adams
  2016-07-07 14:04   ` Paul Eggert
  1 sibling, 1 reply; 11+ messages in thread
From: Kaushal Modi @ 2016-07-07 13:52 UTC (permalink / raw)
  To: Marcin Borkowski, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3041 bytes --]

This is how the single quotes are escaped in the js-jsx-mode documentation
in emacs master:
http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/js.el?id=a7e302dc1dc18770aaf9eeedfd638f73b574bc19#n3787

(define-derived-mode js-jsx-mode js-mode "JSX"
  "Major mode for editing JSX.

To customize the indentation for this mode, set the SGML offset
variables (`sgml-basic-offset', `sgml-attribute-offset' et al.)
locally, like so:

  (defun set-jsx-indentation ()
    (setq-local sgml-basic-offset js-indent-level))
  (add-hook \\='js-jsx-mode-hook #\\='set-jsx-indentation)"


The js2-jsx-mode docstring (
https://github.com/mooz/js2-mode/blob/49f9761af75f8df2f73bef61a7742acd8c50d7fb/js2-mode.el#L11615-11623
)
is missing those escapes. You need to open an issue on that package's
github/send PR to fix it.

(define-derived-mode js2-jsx-mode js2-mode "JSX-IDE"
  "Major mode for editing JSX code.

To customize the indentation for this mode, set the SGML offset
variables (`sgml-basic-offset' et al) locally, like so:

  (defun set-jsx-indentation ()
    (setq-local sgml-basic-offset js2-basic-offset))
  (add-hook 'js2-jsx-mode-hook #'set-jsx-indentation)"             ;
Missing escapes for single quotes on this line

PS: I was against the curly quotes too. But now I like them :)

On Thu, Jul 7, 2016 at 9:46 AM Kaushal Modi <kaushal.modi@gmail.com> wrote:

> What is jsx-ide mode? Is it part of emacs? If not, the package author
> needs to fix the documentation.
>
> The closest thing in emacs I could find was js-jsx-mode and the quotes
> show up correctly for that: http://i.imgur.com/NCPpuzv.png
>
> On Thu, Jul 7, 2016 at 8:54 AM Marcin Borkowski <mbork@mbork.pl> wrote:
>
>> Hi all,
>>
>> Here's a snippet from a *Help* buffer for JSX-IDE mode:
>>
>> --8<---------------cut here---------------start------------->8---
>> JSX-IDE mode defined in ‘js2-mode.el’:
>> Major mode for editing JSX code.
>>
>> To customize the indentation for this mode, set the SGML offset
>> variables (‘sgml-basic-offset’ et al) locally, like so:
>>
>>   (defun set-jsx-indentation ()
>>     (setq-local sgml-basic-offset js2-basic-offset))
>>   (add-hook ’js2-jsx-mode-hook #’set-jsx-indentation)
>> --8<---------------cut here---------------end--------------->8---
>>
>> While I do understand that I could toggle some switch to turn off these
>> retarded curly quotes, but a CODE SNIPPET in a HELP BUFFER should be
>> COPY-PASTEABLE BY DEFAULT.  (I'm sorry for my angry tone, but this is
>> yet another case of curly quotes causing problems, and giving NOTHING in
>> return.  And so many people warned about this - and yet this buggy
>> behavior was made the default...)
>>
>> I'm on GNU Emacs 25.1.50.3 (commit debd49b).
>>
>> Best,
>>
>> --
>> Marcin Borkowski
>> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
>> Faculty of Mathematics and Computer Science
>> Adam Mickiewicz University
>>
>> --
>
> --
> Kaushal Modi
>
-- 

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 4552 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 13:46 ` Kaushal Modi
  2016-07-07 13:52   ` Kaushal Modi
@ 2016-07-07 14:04   ` Paul Eggert
  2016-07-07 14:16     ` Kaushal Modi
  2016-07-07 14:24     ` Dmitry Gutov
  1 sibling, 2 replies; 11+ messages in thread
From: Paul Eggert @ 2016-07-07 14:04 UTC (permalink / raw)
  To: Kaushal Modi, Marcin Borkowski, emacs-devel@gnu.org

On 07/07/2016 03:46 PM, Kaushal Modi wrote:
> What is jsx-ide mode? Is it part of emacs? If not, the package author 
> needs to fix the documentation.

It's not part of Emacs. I filed a patch for the glitch with the package 
authors, here:

https://github.com/mooz/js2-mode/issues/352

and we are now repeating the pull-request versus sending-patches 
discussion there. :-)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 14:04   ` Paul Eggert
@ 2016-07-07 14:16     ` Kaushal Modi
  2016-07-07 14:24     ` Dmitry Gutov
  1 sibling, 0 replies; 11+ messages in thread
From: Kaushal Modi @ 2016-07-07 14:16 UTC (permalink / raw)
  To: Paul Eggert, Marcin Borkowski, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

Alright, I have submitted the PR: https://github.com/mooz/js2-mode/pull/353

On Thu, Jul 7, 2016 at 10:04 AM Paul Eggert <eggert@cs.ucla.edu> wrote:

> On 07/07/2016 03:46 PM, Kaushal Modi wrote:
> > What is jsx-ide mode? Is it part of emacs? If not, the package author
> > needs to fix the documentation.
>
> It's not part of Emacs. I filed a patch for the glitch with the package
> authors, here:
>
> https://github.com/mooz/js2-mode/issues/352
>
> and we are now repeating the pull-request versus sending-patches
> discussion there. :-)
>
-- 

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1086 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 14:04   ` Paul Eggert
  2016-07-07 14:16     ` Kaushal Modi
@ 2016-07-07 14:24     ` Dmitry Gutov
  2016-07-07 14:45       ` Marcin Borkowski
  1 sibling, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2016-07-07 14:24 UTC (permalink / raw)
  To: Paul Eggert, Kaushal Modi, Marcin Borkowski, emacs-devel@gnu.org

On 07/07/2016 05:04 PM, Paul Eggert wrote:

> It's not part of Emacs.

It is part of GNU ELPA, though. I think it would be appropriate for you 
to go over all packages in there and see if any others need fixing.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 14:24     ` Dmitry Gutov
@ 2016-07-07 14:45       ` Marcin Borkowski
  0 siblings, 0 replies; 11+ messages in thread
From: Marcin Borkowski @ 2016-07-07 14:45 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Paul Eggert, emacs-devel@gnu.org, Kaushal Modi


On 2016-07-07, at 16:24, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 07/07/2016 05:04 PM, Paul Eggert wrote:
>
>> It's not part of Emacs.
>
> It is part of GNU ELPA, though. I think it would be appropriate for you 
> to go over all packages in there and see if any others need fixing.

Yes, someone who broke Emacs should fix it.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Emacs is lying to me, or curly quotes strike again
  2016-07-07 13:52   ` Kaushal Modi
@ 2016-07-07 15:05     ` Drew Adams
  2016-07-07 15:24       ` Clément Pit--Claudel
  0 siblings, 1 reply; 11+ messages in thread
From: Drew Adams @ 2016-07-07 15:05 UTC (permalink / raw)
  To: Kaushal Modi, Marcin Borkowski, emacs-devel

FWIW, having to do this kind of thing now to doc strings is nuts:

 "Major mode for editing JSX.

 To customize the indentation for this mode, set the SGML offset
 variables (`sgml-basic-offset', `sgml-attribute-offset' et al.)
 locally, like so:

   (defun set-jsx-indentation ()
     (setq-local sgml-basic-offset js-indent-level))
   (add-hook \\='js-jsx-mode-hook #\\='set-jsx-indentation)"
             ^^^                   ^^^
              |                     |

And some who write doc strings will sometimes not bother to be
so careful as to do it.  And the resulting rendered "code" will
not be copy+pastable.  So there will be questions here & there
about why code that was copied doesn't work...

Yes, I know the mantra: "That ship has sailed."  It should never
have made it out of the shipyard.  Nay; it should never have even
been constructed.  It was built and launched overnight, with only
a few nightowls sounding the alarm and those in charge turning
their backs.  This will be a sizable pebble in our shoe for a
long time to come...

(And why the extra newline after the first docstring line, BTW?
That's not conventional, and it doesn't help users, IMHO.)

(And please consider using plain text for mail to the list.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 15:05     ` Drew Adams
@ 2016-07-07 15:24       ` Clément Pit--Claudel
  2016-07-07 15:55         ` Drew Adams
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Pit--Claudel @ 2016-07-07 15:24 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 235 bytes --]

On 2016-07-07 11:05, Drew Adams wrote:
> (And why the extra newline after the first docstring line, BTW?
> That's not conventional, and it doesn't help users, IMHO.)

Isn't it? It seems fairly common in my (limited) experience.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Emacs is lying to me, or curly quotes strike again
  2016-07-07 15:24       ` Clément Pit--Claudel
@ 2016-07-07 15:55         ` Drew Adams
  2016-07-07 16:00           ` Clément Pit--Claudel
  0 siblings, 1 reply; 11+ messages in thread
From: Drew Adams @ 2016-07-07 15:55 UTC (permalink / raw)
  To: Clément Pit--Claudel, emacs-devel

> > (And why the extra newline after the first docstring line, BTW?
> > That's not conventional, and it doesn't help users, IMHO.)
> 
> Isn't it? It seems fairly common in my (limited) experience.

No, it isn't.

It is sometimes found in libraries not distributed with Emacs,
but it is not commonly found in libraries distributed with
Emacs (yes, there are some occurrences- the doc-string police
are understaffed ;-)).



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Emacs is lying to me, or curly quotes strike again
  2016-07-07 15:55         ` Drew Adams
@ 2016-07-07 16:00           ` Clément Pit--Claudel
  0 siblings, 0 replies; 11+ messages in thread
From: Clément Pit--Claudel @ 2016-07-07 16:00 UTC (permalink / raw)
  To: Drew Adams, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 593 bytes --]

On 2016-07-07 11:55, Drew Adams wrote:
>>> (And why the extra newline after the first docstring line, BTW?
>>> That's not conventional, and it doesn't help users, IMHO.)
>>
>> Isn't it? It seems fairly common in my (limited) experience.
> 
> No, it isn't.
> 
> It is sometimes found in libraries not distributed with Emacs,
> but it is not commonly found in libraries distributed with
> Emacs (yes, there are some occurrences- the doc-string police
> are understaffed ;-)).

Ok, thanks for the clarification! :) Indeed, most of the examples I've seen are in external packages.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-07-07 16:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 12:54 Emacs is lying to me, or curly quotes strike again Marcin Borkowski
2016-07-07 13:46 ` Kaushal Modi
2016-07-07 13:52   ` Kaushal Modi
2016-07-07 15:05     ` Drew Adams
2016-07-07 15:24       ` Clément Pit--Claudel
2016-07-07 15:55         ` Drew Adams
2016-07-07 16:00           ` Clément Pit--Claudel
2016-07-07 14:04   ` Paul Eggert
2016-07-07 14:16     ` Kaushal Modi
2016-07-07 14:24     ` Dmitry Gutov
2016-07-07 14:45       ` Marcin Borkowski

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.