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: Fri, 09 Feb 2007 10:08:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Maybe delete-selection-mode could do what you propose: when
> self-insert-command is called, it should kill the current command, delete
> the region, and re-run the command that it just killed.  It's also bound to
> risk introducing bugs.

Suppose you had defined slime-space as

(defun slime-space ()
  (interactive)
  (insert " "))

its effect would be identical, but how would CUA / delete-selection-mode
know what to do?

> So the only safe solution that I can think of is the one currently used.

I agree.

> Maybe it could be improved by making self-insert-command output a warning if
> the region is active and delete-selection-mode is activated as well.

That's a dead end -- delete-selection-mode is not enabled when you use
CUA, so it would have to check for CUA-mode too, and so would
self-insert-iso, and numerous other commands.

I don't think we can "improve" this without creating other problems.

I used to have CUA explicitly know about the commands it "modified",
but it soon fell apart exactly because people added commands which
failed to work with CUA in various ways ... and the only pratical
interface is the current one:

- where CUA / d-s-m does not have to know the commands explicitly,
but can just investigate the properties of the current command,

- and those commands can be marked in a trivial way which does
not require loading the CUA and delete-selection-mode packages
to do the marking ((this is a very good thing about the current
approach)).

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





reply via email to

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