GNU bug report logs - #11520
24.1.50; delete-selection-mode conflicts with electric-pair-mode

Previous Next

Package: emacs;

Reported by: Simon Law <sfllaw <at> sfllaw.ca>

Date: Sat, 19 May 2012 20:10:01 UTC

Severity: normal

Found in version 24.1.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Simon Law <sfllaw <at> sfllaw.ca>
To: Chong Yidong <cyd <at> gnu.org>
Cc: 11520 <at> debbugs.gnu.org
Subject: Re: bug#11520: 24.1.50;
	delete-selection-mode conflicts with electric-pair-mode
Date: Sun, 15 Jul 2012 12:33:37 -0400
On Sun, Jul 15, 2012 at 10:39 AM, Chong Yidong <cyd <at> gnu.org> wrote:
> Simon Law <sfllaw <at> sfllaw.ca> writes:
>
>> I tested your fix and it makes electric-pair-mode insert pairs in the
>> right order now.
>>
>> But the bug is that delete-selection-mode destroys
>> electric-pair-mode's auto-wrapping ability. Unfortunately, your fix
>> does not address that.
>
> Hmm, I guess I misunderstood the bug.  I'll re-open it.
>
> Trying to work up a patch that does the right thing is not so
> straightforward, though, as electric-pair-post-self-insert-function does
> not have a simple triggering condition.

I proposed making delete-selection-pre-hook understand a function as
one of the legitimate types. If it were a function, it gets called and
its results would be interpreted as type, either: 'yank, 'kill,
'supersede, t, or nil.

That way, electric-pair-mode can override the (put
'self-insert-command 'delete-selection ...) with its own function that
understands the triggering condition. The triggering condition would
be extracted from electric-pair-post-self-insert-function so it could
be used in two places.

Sound good?

P.S. I don't have an bzr checkout of Emacs right now. Would this be
something useful to target against Emacs 24 as a bugfix?

-- 
Cheers,
Simon - http://ca.linkedin.com/in/sfllaw/




This bug report was last modified 10 years and 359 days ago.

Previous Next


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