bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19526: 24.4; Wrapping text with pairs in electrical-pair-mode


From: Sebastien Vauban
Subject: bug#19526: 24.4; Wrapping text with pairs in electrical-pair-mode
Date: Thu, 29 Jan 2015 16:20:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Stefan Monnier wrote:
>  Sebastien Vauban:
>> Selecting a region and hitting one "pair" character does not wrap the
>> selected text with that character.
>
> I don't see that here:
>
>    % emacs -Q -f electric-pair-mode
>    C-SPC C-b C-b "
>
> wraps the two newlines in ".." for me.

I must have changed things over time, as it now works for me as well as
I expect it.  Like what you show as well.  Sorry for the noise.

Now, I've added:

--8<---------------cut here---------------start------------->8---
  (defvar org-electric-pairs
    '((?\* . ?\*)
      (?/ . ?/)
      (?_ . ?_)
      (?= . ?=)
      (?~ . ?~))
    "Electric pairs for Org mode.")     ; See `org-emphasis-alist'.

  (defun org-add-electric-pairs ()
    (setq-local electric-pair-pairs (append electric-pair-pairs 
org-electric-pairs)))

  (add-hook 'org-mode-hook 'org-add-electric-pairs)
--8<---------------cut here---------------end--------------->8---

to get added support of markers *, /, _, = and ~ in Org mode.  And that
works OK.

Small question regarding the double quotes: would there be a way to
convert them to « | » (instead of "|", where | is the cursor) when
`ispell-local-dictionary' or `ispell-dictionary' is equal to "francais"?

A few hings on how could we implement this in our .emacs (if it's not
foreseen in electric-pair-mode)?

Best regards,
  Seb

-- 
Sebastien Vauban





reply via email to

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