[Top][All Lists]

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

RE: Updated proposal for DEL to delete active region

From: Drew Adams
Subject: RE: Updated proposal for DEL to delete active region
Date: Sat, 22 May 2010 15:14:11 -0700

> >> Why not just attach a property to any existing command 
> >> symbols that you want to become sensitive to this new
> >> feature?  That's the way `delete-selection-mode' does
> >> this sort of thing.
> You could read up on the corresponding discussion.  Tying special
> behavior to symbols rather than functions is a bad idea.

I read the discussion at the time. Hard-coding behavior the way that was
proposed is a worse idea.

With the proposal, any command that you might want to use in place of the new
`delete-(back|for)ward' commands will need to hard-code the same behavior they
have in order to take account of the new option `delete-deletes-active-region'. 

IOW, the proposal would purportedly add flexibility by having an option to
define the alternative behaviors, but overall it would take away flexibility by
hard-coding the behavior that makes use of that option. The option is
made-to-order for those two new commands, and vice versa. Nothing flexible about

That option-respecting behavior should be factored out and made easily
applicable (attachable, hookable, whatever) to any command you like.

If you do not like the mechanism for such loose and easy coupling to be simply
putting a property on a command symbol - (put 'delete-char 'delete-selection
'supersede), then provide another simple and elegant mechanism.  What's your
proposal - defadvice?

Hard-coding the behavior and replacing (only two of) the existing char-deletion
commands is not the answer.

(When can we expect the same approach to be used to transform thingatpt.el?)

reply via email to

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