From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?iso-8859-9?Q?G=F6ktu=F0_Kayaalp?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Enable customisation for electric-quote-mode chars Date: Mon, 29 Aug 2016 19:27:42 +0300 Message-ID: <874m631qwx.fsf@xi.bootis> References: <83fupnbok6.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1472487468 16183 195.159.176.226 (29 Aug 2016 16:17:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Aug 2016 16:17:48 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 29 18:17:43 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bePFi-0003Bm-0r for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2016 18:17:38 +0200 Original-Received: from localhost ([::1]:44705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bePFf-0006c4-LQ for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2016 12:17:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bePFa-0006bz-2u for emacs-devel@gnu.org; Mon, 29 Aug 2016 12:17:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bePFX-0005Bl-P1 for emacs-devel@gnu.org; Mon, 29 Aug 2016 12:17:28 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bePFR-00059u-1J; Mon, 29 Aug 2016 12:17:21 -0400 Original-Received: from mfilter25-d.gandi.net (mfilter25-d.gandi.net [217.70.178.153]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id EF64CC5A73; Mon, 29 Aug 2016 18:16:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter25-d.gandi.net Original-Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter25-d.gandi.net (mfilter25-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id XC3QpbdQC7m7; Mon, 29 Aug 2016 18:16:58 +0200 (CEST) X-Originating-IP: 78.181.205.50 Original-Received: from localhost (unknown [78.181.205.50]) (Authenticated sender: self@gkayaalp.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 64F41C5A71; Mon, 29 Aug 2016 18:16:57 +0200 (CEST) In-Reply-To: <83fupnbok6.fsf@gnu.org> (message from Eli Zaretskii on Mon, 29 Aug 2016 18:08:25 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.194 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206881 Archived-At: > From: Eli Zaretskii > Date: 2016-08-29 06:08:25 PM +0300 > Eli Zaretskii wrote: >> From: G=C3=B6ktu=C4=9F Kayaalp >> Cc: eliz@gnu.org, emacs-devel@gnu.org >> Date: Mon, 29 Aug 2016 08:28:19 +0300 (I'm sorry for /borrowing/ your citation style, but it's very nice, I couldn't refuse. Hope that doesn't annoy you :) I've made it a bit different though.) >> +@vindex electric-quote-chars >> Electric Quote mode makes it easier to type curved quotes. As you >> type characters it optionally converts @t{`} to @t{=E2=80=98}, @t{'} to= @t{=E2=80=99}, >> @t{``} to @t{=E2=80=9C}, and @t{''} to @t{=E2=80=9D}. These conversion= s are >> suppressed in buffers whose coding systems cannot represent curved >> -quote characters. >> +quote characters. It's possible to change the default quotes listed >> +above, by customizing the variable @code{electric-quote-chars}, a list >> +of four characters, where the items correspond to the left single >> +quote, the right single quote, the left double quote and the right >> +double quote, respectively, whose default value is >> +@code{'(?=E2=80=98 ?=E2=80=99 ?=E2=80=9C ?=E2=80=9D)}. > > There's no need to go to such detail when describing a customizable > option. The Customize interface should be enough for the user to > figure out what to do. Then I can remove the part after reference to the variable name, and improve the defcustom's documentation (see below). Is that okay? > Which brings me to this: > >> +(defcustom electric-quote-chars '(?=E2=80=98 ?=E2=80=99 ?=E2=80=9C ?=E2= =80=9D) >> + "Curved quote characters for `electric-quote-mode'. >> +The items correspond to the left single quote, the right single >> +quote, the left double quote, and the right double quote, respectively." >> + :version "25.1" >> + :type 'list :safe 'listp :group 'electricity) >> + > > Making it a list with minimal explanations sounds like not very > user-friendly. How about offering several ready out-of-the-box sets, > each one for some culture we know about? We could also allow a raw > list, for the power users, but I think less advanced Emacs users will > appreciate something like > > Default (=E2=80=98..=E2=80=99 =E2=80=9C..=E2=80=9D) > Arabic (".." =E2=80=9D..=E2=80=9C) > German (=E2=80=9A..=E2=80=9B =E2=80=9E..=E2=80=9C) > French (=E2=80=B9..=E2=80=BA =C2=AB..=C2=BB) > Cyrillic (=E2=80=9A..=E2=80=98 =C2=AB..=C2=BB) > > etc. WDYT? (See https://en.wikipedia.org/wiki/Quotation_mark for > some more.) Well I think we'd rather not do that but improve the docstring instead, because, looking at the big summary table on the page you linked [1] there's not only a lot of variance among languages, but some of them have multiple standard and alternative forms, and some don't have single quotes (e.g. Persian). I think we'd better keep the defaults and improve the documentation, and not have implement all the languages nor have to pick a subset. Maybe we could leave setting these variables to the language environment if that's possible? Though I'm not familiar with that feature, but maybe we apply this as is after I update the documentation and developers of that feature would extend it as need appears. Please direct me on how to proceed, and I'll update the patch as soon as I can (I'll mail my copyright assignment tomorrow, which'll take one to two weeks to arrive). This is my first patch to Emacs, so I'm sorry if I'm making newbie mistakes. [1] https://en.wikipedia.org/wiki/Quotation_mark#Summary_table > Thanks. > Best, -goktug. --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp. http://gkayaalp.com/