[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can a command specify overwrite selection behavior?
From: |
Ilya Zakharevich |
Subject: |
Re: can a command specify overwrite selection behavior? |
Date: |
Sat, 25 Dec 2010 00:17:45 +0000 (UTC) |
User-agent: |
slrn/0.9.8.1pl1 (Linux) |
On 2010-12-22, Drew Adams <drew.adams@oracle.com> wrote:
>> Drew, what i didn't understand is why the insert-date property makes a
>> distinction on whether a command is called by name or by a keyboard
>> shortcut?
> (defun delete-selection-pre-hook ()
> (when (and delete-selection-mode
> transient-mark-mode mark-active
> (not buffer-read-only))
> (let ((type (and (symbolp this-command)
> (get this-command ; <=======
> 'delete-selection))))
>
> If you debug this (use `message', not `debug-on-entry'!), you'll see that when
> you use `M-x' the value of `this-command' is `execute-extended-command', not
> `insert-date'. And `execute-extended-command' does not have a non-nil
> `delete-selection' property.
>
> `execute-extended-command' is a bit special wrt `this-command' and
> `last-command'. It DTRT in the end, essentially removing itself from the
> party,
> but that's only at the end. While `execute-extended-command' is executing, it
> is the value of `this-command'.
>
> People sometimes get thrown off by this kind of thing, and similar things wrt
> `M-:' (and `C-x C-e', `C-M-x'...).
Essentially, I read this as a detailed explanation of the way this bug
is triggered. If one understands the mechanism of this bug so well,
why not fix it? AFAICS, this subroutine is placed in a wrong hook; it
should be executed later...
Puzzled,
Ilya
- can a command specify overwrite selection behavior?, Xah Lee, 2010/12/08
- Re: can a command specify overwrite selection behavior?, Xah Lee, 2010/12/08
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/10
- Message not available
- Re: can a command specify overwrite selection behavior?, Xah Lee, 2010/12/13
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/13
- Message not available
- Re: can a command specify overwrite selection behavior?, Xah Lee, 2010/12/22
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/22
- Message not available
- Re: can a command specify overwrite selection behavior?, Xah Lee, 2010/12/22
- Message not available
- Re: can a command specify overwrite selection behavior?,
Ilya Zakharevich <=
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/25
- Message not available
- Re: can a command specify overwrite selection behavior?, Ilya Zakharevich, 2010/12/25
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/25
- Message not available
- Re: can a command specify overwrite selection behavior?, Xah Lee, 2010/12/25
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/26
- Message not available
- Re: can a command specify overwrite selection behavior?, Stefan Monnier, 2010/12/27
- RE: can a command specify overwrite selection behavior?, Drew Adams, 2010/12/28
- Re: can a command specify overwrite selection behavior?, Stefan Monnier, 2010/12/28