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 #17 received at 11520 <at> debbugs.gnu.org (full text, mbox):

From: Simon Law <sfllaw <at> sfllaw.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 11520 <at> debbugs.gnu.org
Subject: Re: bug#11520: 24.1.50;
	delete-selection-mode conflicts with electric-pair-mode
Date: Mon, 21 May 2012 00:19:38 -0400
On Sun, May 20, 2012 at 12:31 PM, Drew Adams <drew.adams <at> oracle.com> wrote:
> But as you say, Stefan, a pre-command approach like d-s knows nothing about what
> might be expected to happen after the command is done.
>
> It could be possible to let `e-p' know what `d-s' has already done, but I do not
> see how it is possible/practical to let `d-s' know what `e-p' will do.  We could
> make `d-s' aware that `e-p' mode is turned on, and we could even try to let it
> know exactly what `e-p' mode does (not a very modular approach, but perhaps
> doable).
>
> But knowing that, `d-s' would have to not only test for `self-insert-command'
> but also test the character to be inserted.  We would end up, I'm afraid,
> duplicating nearly all of the `e-p' logic inside `d-s'.  (But perhaps I don't
> understand well what you had in mind.)
>
> Anyway, that mismatch (pre-command control vs post) is I guess the problem here.
> If so, it might be seen to be more general than `d-s' vs `e-p'.

It seems to me that delete-selection-mode already knows about four
types of commands: 'yank, 'supercede, 'kill, and non-nil. It looks
like it could take a function, which will inhibit
delete-selection-mode if it returns nil, or return any of the other
commands. This way, electric-pair-mode can register its own behaviour
with delete-selection-mode when it's activated.

-- 
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.