[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1120: issues on (put 'insert-date 'delete-selection t)
From: |
xah lee |
Subject: |
bug#1120: issues on (put 'insert-date 'delete-selection t) |
Date: |
Thu, 9 Oct 2008 00:45:10 -0700 |
Interesting point.
For elisp programers who wish to write extentions where the command's
behaviors change depending on whether user has delete-selection-mode
on, what should they do? Check for mark-active and delete-selection-
mode before any call to the insert function?
also, the current behavior seems to introduce a complexity, where
command behaves differently depending on whether it is invoked by a
keybinding or by M-x.
Xah
∑ http://xahlee.org/
☄
On Oct 8, 2008, at 7:59 PM, Richard M. Stallman wrote:
according to delete-selection-mode's header file, elisp code that
insert text that wants to respect delete-selection-mode should set
the symbol's delete-selection property to true.
However, this works only when the command is called by a keyboard,
not by M-x.
This appears to be a bug?
It's intentional. This feature implements expectations that users
have for single-character editing operations in other editors,
where those commands don't have names and there's nothing like M-x.
So there's no reason why M-x should delete the region.
It is better for M-x just to call the function.
☄