[Top][All Lists]

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

bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-m

From: Stefan Monnier
Subject: bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode
Date: Wed, 18 Jul 2012 08:13:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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



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

reply via email to

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