[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-25 26b56dc: Fix some single quotes in documentat

From: Clément Pit--Claudel
Subject: Re: [Emacs-diffs] emacs-25 26b56dc: Fix some single quotes in documentation
Date: Mon, 14 Mar 2016 13:19:42 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 03/14/2016 12:42 PM, Dmitry Gutov wrote:
> On 03/14/2016 06:39 PM, John Wiegley wrote:
>>>>>>> Paul Eggert <address@hidden> writes:
>>> Yes, and it's easy enough to do that, so I installed that further change.
>> Thanks!
> Will everyone have to put curly quotes into NEWS now? Or will Paul go and 
> follow up on every change?

Hey Dmitry,

This is a bit of a tangent, but I find the following function rather convenient 
for this:

(defun quote-region (beg end)
  "Insert quotes aroung BEG..END."
  (interactive (if (region-active-p)
                   (list (region-beginning) (region-end))
                 (list (point) nil)))
  (let ((quotes (pcase (read-char "Quote type?")
                  (?\` `(?` . ?'))
                  (?\' `(?‘ . ?’))
                  (?\" `(?“ . ?”))
                  (?\[ `(?[ . ?]))
                  (?\{ `(?{ . ?}))
                  (c   `(,c . ,c)))))
      (goto-char (or end beg))
      (insert (cdr quotes)))
      (goto-char beg)
      (insert (car quotes)))
    (if end
        (goto-char (+ 2 end))
      (goto-char (+ 1 beg)))))

With (global-set-key (kbd "M-\"") 'quote-region), this allows me to press ‘M-" 
'’ to insert a pair of ‘’, ‘M-" "’ for a pair of “”, and ‘M-" `’ for a pair of 


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]