emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: CUA/delete-selection-mode and remapped keys incompatibility


From: Kim F. Storm
Subject: Re: CUA/delete-selection-mode and remapped keys incompatibility
Date: Thu, 08 Feb 2007 22:58:35 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

David Reitter <address@hidden> writes:

> On 8 Feb 2007, at 20:18, Kim F. Storm wrote:
>
>> This is not a bug in cua or delete-selection-mode.
>>
>> If you define a new command like that, you also have to make it
>> CUA/delete-selection-mode compatible by tagging it like this:
>>
>> (put 'slime-space 'delete-selection t)
>
> Thanks Kim.
>
> 1. Where is this `delete-selection' attribute documented?

It is documented in the commentary in delsel.el.

> I've
> searched the elisp reference, I've checked the docstring of `self- 
> insert-command', I've googled it - couldn't find it documented.

> 2. This appears a bit un-modular, since an externally supplied major
> mode like SLIME has to worry about how CUA and delete-selection-mode
> are implemented. 

On contrary, this is very modular!

CUA / d-s-m doesn't have to know anything about SLIME; and SLIME just
have to mark its commands directly in its own source files.

>                  It appears to be the right way to distinguish
> commands that overwrite the selection (in these minor modes) from
> others. But shouldn't calling self-insert-command (as slime-space
> does) already take care of it? Wouldn't a `self-insert-command-hook'
> be better than counting on pre-command-hook, which doesn't get called
> e.g. if self-insert-command is not called interactively?

No such hooks exist, so that's not possible.  Numerous commands are
marked in various ways for delete-selection-mode and CUA to work
properly; only the author of a command can know what the right
thing to do is for his commands.

Of course, adding some information about how to CUA enable new commands
would be useful, but if you use the existing information in delsel.el,
you will typically cover CUA also, as it checks the delete-selection
property as well.

> Something like that would be more compatible with modes that do what
> SLIME does.

I doubt it; I think it generally would cause more problems than it solves.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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