GNU bug report logs - #70984
30.0.50; Improved support for entering quotation marks

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Thu, 16 May 2024 14:36:02 UTC

Severity: normal

Tags: fixed

Found in version 30.0.50

Fixed in version 30.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stephen.berman <at> gmx.net, 70984 <at> debbugs.gnu.org
Subject: Re: bug#70984: 30.0.50; Improved support for entering quotation
 marks, Re: bug#70984: 30.0.50; Improved support for entering quotation
 marks
Date: Fri, 17 May 2024 14:15:31 +0200
>>>>> On Fri, 17 May 2024 13:44:12 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Robert Pluim <rpluim <at> gmail.com>
    >> Cc: Stephen Berman <stephen.berman <at> gmx.net>,  70984 <at> debbugs.gnu.org
    >> Date: Fri, 17 May 2024 09:45:14 +0200
    >> 
    >> Iʼm assuming this means youʼre both ok with the key sequences I chose.

    Eli> I don't have any objections, but I'm not going to be a frequent user
    Eli> of this, so I guess we'll let the users judge that.

Apropos, what about the following for electric-quote-chars? I think
Iʼve covered most of the common combinations:

diff --git a/lisp/electric.el b/lisp/electric.el
index fee0bf36d7f..406eac2f3a1 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -506,12 +506,55 @@ electric-quote-string
   :version "25.1"
   :type 'boolean :safe 'booleanp :group 'electricity)
 
+(define-widget 'electric-quote-chars-type 'lazy
+  "Display list of electric quote chars."
+  :group 'electricity
+  :format "%t:\n%v\n"
+  :type '(list (character :tag "Left single quote ")
+               (character :tag "Right single quote")
+               (character :tag "Left double quote ")
+               (character :tag "Right double quote")))
+
 (defcustom electric-quote-chars '(?‘ ?’ ?“ ?”)
   "Curved quote characters for `electric-quote-mode'.
 This list's members correspond to left single quote, right single
-quote, left double quote, and right double quote, respectively."
+quote, left double quote, and right double quote, respectively.
+
+There are predefined settings for common styles, or you can define
+your own custom style."
   :version "26.1"
-  :type '(list character character character character)
+  :type '(choice
+          ;; The countries and languages mentioned here are not intended
+          ;; to be an exhaustive list.
+          ;; US English, Canada, India, Brazil…, almost everywhere in
+          ;; fact.
+          (electric-quote-chars-type :tag "Default" (?‘ ?’ ?“ ?”))
+          ;; This style has ?“ and ?” as first level quotation,
+          ;; which is why they're on the single quote, not double quote.
+          ;; UK English
+          (electric-quote-chars-type :tag "Reversed" (?“ ?” ?‘ ?’ ))
+          ;; France
+          (electric-quote-chars-type :tag "Guillemets" (?« ?» ?« ?»))
+          ;; Switzerland
+          (electric-quote-chars-type :tag "Single/double guillemets" (?‹ ?› ?« ?»))
+          ;; Norway
+          (electric-quote-chars-type :tag "Single quote guillemets" (?‘ ?’ ?« ?»))
+          ;; Greece, Italy, Portugal
+          (electric-quote-chars-type :tag "Guillemets double quote" (?« ?» ?“ ?”))
+          ;; This style also has ?“ and ?” as first level quotation,
+          ;; Spain, Ukraine
+          (electric-quote-chars-type :tag "Double quote guillemets" (?“ ?” ?« ?» ))
+          ;; Hebrew, Sweden
+          (electric-quote-chars-type :tag "Right only" (?’ ?’ ?” ?”))
+          ;; Netherlands
+          (electric-quote-chars-type :tag "Low/high right only" (?‚ ?’ ?„ ?”))
+          ;; Germany
+          (electric-quote-chars-type :tag "Low/high right/left" (?‚ ?‘ ?„ ?“))
+          ;; Chinese, simplified.
+          (electric-quote-chars-type :tag "Corners" (?「 ?」 ?『 ?』))
+          ;; Chinese, traditional.
+          (electric-quote-chars-type :tag "Corners reversed" (?『 ?』?「 ?」))
+          (electric-quote-chars-type :tag "Custom" (?‘ ?’ ?“ ?”)))
   :safe (lambda (x)
           (pcase x
             (`(,(pred characterp) ,(pred characterp)

Robert
-- 




This bug report was last modified 1 year and 71 days ago.

Previous Next


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