unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Disable electric quotes in the Emacs codebase.
@ 2019-01-02 21:21 Philipp Stephani
  2019-01-02 21:58 ` Paul Eggert
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Stephani @ 2019-01-02 21:21 UTC (permalink / raw)
  To: emacs-devel; +Cc: Philipp Stephani

* .dir-locals.el: Disable electric quotes in comments and strings, as
the Emacs codebase doesn't use them.
---
 .dir-locals.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 68eb58fa18..1089b1f892 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,6 +1,8 @@
 ((nil . ((tab-width . 8)
          (sentence-end-double-space . t)
-         (fill-column . 70)))
+         (fill-column . 70)
+         (electric-quote-comment . nil)
+         (electric-quote-string . nil)))
  (c-mode . ((c-file-style . "GNU")
             (c-noise-macro-names . ("UNINIT" "CALLBACK" "ALIGN_STACK"))))
  (objc-mode . ((c-file-style . "GNU")))
-- 
2.17.2 (Apple Git-113)




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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-02 21:21 [PATCH] Disable electric quotes in the Emacs codebase Philipp Stephani
@ 2019-01-02 21:58 ` Paul Eggert
  2019-01-02 22:16   ` Dmitry Gutov
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Paul Eggert @ 2019-01-02 21:58 UTC (permalink / raw)
  To: Philipp Stephani, emacs-devel; +Cc: Philipp Stephani

Philipp Stephani wrote:
> +         (electric-quote-comment . nil)
> +         (electric-quote-string . nil)))

Why is this needed? Electric quote mode isn't on by default.

I find it helpful to use electric-quote mode for some files, and if there's a 
need to disable it it'd be better to limit it to files where it should be 
disabled rather than have a blanket prohibition.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-02 21:58 ` Paul Eggert
@ 2019-01-02 22:16   ` Dmitry Gutov
  2019-01-03 13:48   ` Eli Zaretskii
  2019-01-06  0:40   ` Philipp Stephani
  2 siblings, 0 replies; 13+ messages in thread
From: Dmitry Gutov @ 2019-01-02 22:16 UTC (permalink / raw)
  To: Paul Eggert, Philipp Stephani, emacs-devel; +Cc: Philipp Stephani

On 03.01.2019 0:58, Paul Eggert wrote:
> Why is this needed? Electric quote mode isn't on by default.

Because it's a global mode? And people usually turn on modes that they 
use via their init script, rather than manually with M-x?



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-02 21:58 ` Paul Eggert
  2019-01-02 22:16   ` Dmitry Gutov
@ 2019-01-03 13:48   ` Eli Zaretskii
  2019-01-03 19:14     ` Paul Eggert
  2019-01-06  0:40   ` Philipp Stephani
  2 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-01-03 13:48 UTC (permalink / raw)
  To: Paul Eggert; +Cc: phst, p.stephani2, emacs-devel

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 2 Jan 2019 13:58:14 -0800
> Cc: Philipp Stephani <phst@google.com>
> 
> Philipp Stephani wrote:
> > +         (electric-quote-comment . nil)
> > +         (electric-quote-string . nil)))
> 
> Why is this needed? Electric quote mode isn't on by default.

It would be good to hear the rationale, yes.

I can think about one: to void inserting curved quotes into Emacs
messages and doc strings.  Are there other reasons?

> I find it helpful to use electric-quote mode for some files, and if there's a 
> need to disable it it'd be better to limit it to files where it should be 
> disabled rather than have a blanket prohibition.

Maybe we should indeed do this only in Lisp and C modes.  (In Lisp we
could allow this in comments, though.)

Paul, can you tell in which files you find electric quote mode
helpful?

Thanks.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-03 13:48   ` Eli Zaretskii
@ 2019-01-03 19:14     ` Paul Eggert
  2019-01-03 19:34       ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Eggert @ 2019-01-03 19:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: phst, p.stephani2, emacs-devel

Eli Zaretskii wrote:
> Paul, can you tell in which files you find electric quote mode
> helpful?

Random text files other than .el, .c, .texi. This includes ChangeLog files, 
notes, and so forth. Even in .el and .c files I often prefer electric quote mode 
for comments, and for strings in the occasional files that deal with quotes 
themeselves.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-03 19:14     ` Paul Eggert
@ 2019-01-03 19:34       ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2019-01-03 19:34 UTC (permalink / raw)
  To: Paul Eggert; +Cc: phst, p.stephani2, emacs-devel

> Cc: p.stephani2@gmail.com, emacs-devel@gnu.org, phst@google.com
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 3 Jan 2019 11:14:22 -0800
> 
> Eli Zaretskii wrote:
> > Paul, can you tell in which files you find electric quote mode
> > helpful?
> 
> Random text files other than .el, .c, .texi. This includes ChangeLog files, 
> notes, and so forth. Even in .el and .c files I often prefer electric quote mode 
> for comments, and for strings in the occasional files that deal with quotes 
> themeselves.

It's problematic to use these in C files, since we don't necessarily
visit them with UTF-8.  No such problems in .el files, where we should
only avoid doing that in strings, to avoid breaking related features.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-02 21:58 ` Paul Eggert
  2019-01-02 22:16   ` Dmitry Gutov
  2019-01-03 13:48   ` Eli Zaretskii
@ 2019-01-06  0:40   ` Philipp Stephani
  2019-01-06  2:12     ` Paul Eggert
  2 siblings, 1 reply; 13+ messages in thread
From: Philipp Stephani @ 2019-01-06  0:40 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Philipp Stephani, Emacs developers

Am Mi., 2. Jan. 2019 um 22:58 Uhr schrieb Paul Eggert <eggert@cs.ucla.edu>:
>
> Philipp Stephani wrote:
> > +         (electric-quote-comment . nil)
> > +         (electric-quote-string . nil)))
>
> Why is this needed? Electric quote mode isn't on by default.

That is true, but I have it enabled by default, and it's fine most of
the time, except when working on the Emacs codebase, where using C-q
for every quote is quite annoying.

>
> I find it helpful to use electric-quote mode for some files, and if there's a
> need to disable it it'd be better to limit it to files where it should be
> disabled rather than have a blanket prohibition.

I'm happy to implement alternative solutions. Which files shouldn't
have Unicode quotes?



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-06  0:40   ` Philipp Stephani
@ 2019-01-06  2:12     ` Paul Eggert
  2019-01-06  3:38       ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Eggert @ 2019-01-06  2:12 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: Philipp Stephani, Emacs developers

Philipp Stephani wrote:
> Which files shouldn't
> have Unicode quotes?

How about if we start with *.el, *.c, *.h, *.m, and *.texi? We can tune the list 
later as needed.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-06  2:12     ` Paul Eggert
@ 2019-01-06  3:38       ` Eli Zaretskii
  2019-01-06 21:34         ` Philipp Stephani
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-01-06  3:38 UTC (permalink / raw)
  To: Paul Eggert; +Cc: phst, p.stephani2, emacs-devel

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sat, 5 Jan 2019 18:12:59 -0800
> Cc: Philipp Stephani <phst@google.com>, Emacs developers <emacs-devel@gnu.org>
> 
> Philipp Stephani wrote:
> > Which files shouldn't
> > have Unicode quotes?
> 
> How about if we start with *.el, *.c, *.h, *.m, and *.texi? We can tune the list 
> later as needed.

Sounds good to me, thanks.



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

* Re: [PATCH] Disable electric quotes in the Emacs codebase.
  2019-01-06  3:38       ` Eli Zaretskii
@ 2019-01-06 21:34         ` Philipp Stephani
  2019-01-06 21:58           ` [PATCH] Disable electric quotes for most files " Philipp Stephani
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Stephani @ 2019-01-06 21:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Philipp Stephani, Paul Eggert, Emacs developers

Am So., 6. Jan. 2019 um 04:39 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
>
> > From: Paul Eggert <eggert@cs.ucla.edu>
> > Date: Sat, 5 Jan 2019 18:12:59 -0800
> > Cc: Philipp Stephani <phst@google.com>, Emacs developers <emacs-devel@gnu.org>
> >
> > Philipp Stephani wrote:
> > > Which files shouldn't
> > > have Unicode quotes?
> >
> > How about if we start with *.el, *.c, *.h, *.m, and *.texi? We can tune the list
> > later as needed.
>
> Sounds good to me, thanks.

OK, I'll send a follow-up patch in a second.



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

* [PATCH] Disable electric quotes for most files in the Emacs codebase.
  2019-01-06 21:34         ` Philipp Stephani
@ 2019-01-06 21:58           ` Philipp Stephani
  2019-01-09 15:30             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Stephani @ 2019-01-06 21:58 UTC (permalink / raw)
  To: eggert, emacs-devel, eliz; +Cc: Philipp Stephani

* .dir-locals.el: Disable electric quotes in comments and strings, as
the Emacs codebase doesn't use them.
---
 .dir-locals.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 68eb58fa18..96473a7086 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -2,8 +2,12 @@
          (sentence-end-double-space . t)
          (fill-column . 70)))
  (c-mode . ((c-file-style . "GNU")
-            (c-noise-macro-names . ("UNINIT" "CALLBACK" "ALIGN_STACK"))))
- (objc-mode . ((c-file-style . "GNU")))
+            (c-noise-macro-names . ("UNINIT" "CALLBACK" "ALIGN_STACK"))
+            (electric-quote-comment . nil)
+            (electric-quote-string . nil)))
+ (objc-mode . ((c-file-style . "GNU")
+               (electric-quote-comment . nil)
+               (electric-quote-string . nil)))
  (log-edit-mode . ((log-edit-font-lock-gnu-style . t)
                    (log-edit-setup-add-author . t)))
  (change-log-mode . ((add-log-time-zone-rule . t)
@@ -11,4 +15,8 @@
 		     (bug-reference-url-format . "https://debbugs.gnu.org/%s")
 		     (mode . bug-reference)))
  (diff-mode . ((mode . whitespace)))
- (emacs-lisp-mode . ((indent-tabs-mode . nil))))
+ (emacs-lisp-mode . ((indent-tabs-mode . nil)
+                     (electric-quote-comment . nil)
+                     (electric-quote-string . nil)))
+ (texinfo-mode . ((electric-quote-comment . nil)
+                  (electric-quote-string . nil))))
-- 
2.17.2 (Apple Git-113)




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

* Re: [PATCH] Disable electric quotes for most files in the Emacs codebase.
  2019-01-06 21:58           ` [PATCH] Disable electric quotes for most files " Philipp Stephani
@ 2019-01-09 15:30             ` Eli Zaretskii
  2019-01-15  0:40               ` Philipp Stephani
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-01-09 15:30 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: phst, eggert, emacs-devel

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun,  6 Jan 2019 22:58:02 +0100
> Cc: Philipp Stephani <phst@google.com>
> 
> * .dir-locals.el: Disable electric quotes in comments and strings, as
> the Emacs codebase doesn't use them.

LGTM, but please say in the log message in which modes we disable
that, as this is no longer about all modes.

Thanks.



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

* Re: [PATCH] Disable electric quotes for most files in the Emacs codebase.
  2019-01-09 15:30             ` Eli Zaretskii
@ 2019-01-15  0:40               ` Philipp Stephani
  0 siblings, 0 replies; 13+ messages in thread
From: Philipp Stephani @ 2019-01-15  0:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Philipp Stephani, Paul Eggert, Emacs developers

Am Mi., 9. Jan. 2019 um 16:31 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
>
> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sun,  6 Jan 2019 22:58:02 +0100
> > Cc: Philipp Stephani <phst@google.com>
> >
> > * .dir-locals.el: Disable electric quotes in comments and strings, as
> > the Emacs codebase doesn't use them.
>
> LGTM, but please say in the log message in which modes we disable
> that, as this is no longer about all modes.

Done (commit 9530108fbc8bbf1ad5c1debe4b4f21da1238325b).



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

end of thread, other threads:[~2019-01-15  0:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-02 21:21 [PATCH] Disable electric quotes in the Emacs codebase Philipp Stephani
2019-01-02 21:58 ` Paul Eggert
2019-01-02 22:16   ` Dmitry Gutov
2019-01-03 13:48   ` Eli Zaretskii
2019-01-03 19:14     ` Paul Eggert
2019-01-03 19:34       ` Eli Zaretskii
2019-01-06  0:40   ` Philipp Stephani
2019-01-06  2:12     ` Paul Eggert
2019-01-06  3:38       ` Eli Zaretskii
2019-01-06 21:34         ` Philipp Stephani
2019-01-06 21:58           ` [PATCH] Disable electric quotes for most files " Philipp Stephani
2019-01-09 15:30             ` Eli Zaretskii
2019-01-15  0:40               ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).