In post-command-hook, this-command for kill-word has turned into kill-region somehow

[亡魂溺海] 提交于 2019-12-08 21:08:46

问题


In my post-command-hook callback, when I do kill-word, the this-command var is kill-region - and not kill-word as expected.

I guess that's because kill-word uses kill-region, but knowing exactly which command was used is essential to my script. Any way to get at that information somehow?

Thanks


回答1:


Turns out all the kill-commands change this-command to kill-region so they can interoperate on appending things to the kill ring. To get to the actual command, emacs has this-original-command - which is not modified.



来源:https://stackoverflow.com/questions/8983758/in-post-command-hook-this-command-for-kill-word-has-turned-into-kill-region-som

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!