devil icon indicating copy to clipboard operation
devil copied to clipboard

devil-mode seems ignores delete-selection-mode

Open 3ncor opened this issue 2 years ago • 1 comments

After delete-selection-mode turned on, C-y will replace the active region with yanked text, but , y still behave like delete-selection-mode is not active, , y till just insert yanked text at cursor position.

3ncor avatar Jun 17 '23 05:06 3ncor

Stumbled over this, too. Seems to be similar to what is described in this old thread: https://mail.gnu.org/archive/html/help-gnu-emacs/2008-10/msg00402.html

The problem here is that the pre-command-hook, which is used for delete-selection-mode, isn't fired at all if a command is executed via M-x or call-interactively as used by devil.

Calling the delete-selection-pre-hook explicitly just before invoking the command seems to work. I'm honestly not sure, why exactly this-command is already set to the right value at that point, but as long as I don't find any problems, I'm using it.

Happy to create a pull request if someone else confirms, that this is a safe thing to do. s.a. https://github.com/fbrosda/devil/commit/73e5fc11a3cbe590ad0250e13be3be13f3cefece

fbrosda avatar Nov 20 '24 21:11 fbrosda