GNU bug report logs -
#11520
24.1.50; delete-selection-mode conflicts with electric-pair-mode
Previous Next
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 #39 received at 11520 <at> debbugs.gnu.org (full text, mbox):
> 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.
That sounds like a reasonable plan, yes.
An alternative is to change self-insert-command so that it pays
attention to delete-selection-mode (and provides some hook for
electric-pair-mode to indicate when it would use the region).
> 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?
Yes.
Stefan
PS: I don't much like delete-selection-mode because of its implementation
strategy (using a pre-command-hook along with symbol properties, as
opposed to modifying the commands themselves). I can fully understand
why it was done this way, but I'd be happy to see it changed, along the
same lines as what we did for the shift-select-mode.
AFAICT, of the various `delete-selection' properties, `kill' is only
used for `open-line' (for no good reason) and could be eliminated.
`supersede' is only used by command which should obey
`delete-active-region' or close enough, `yank' is only used for commands
which end up calling `yank' (so adding code to the `yank' command would
cover them), and t is used for commands which end up calling
`self-insert-command' (with a few minor exceptions like open-line).
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.