Emacs 中的一键宏
我正在尝试使用一键宏(如 此处 所写)
(defun toggle-kbd-macro-recording-on ()
"One-key keyboard macros: turn recording on."
(interactive)
(define-key
global-map
(events-to-keys (this-command-keys) t)
'toggle-kbd-macro-recording-off)
(start-kbd-macro nil))
(defun toggle-kbd-macro-recording-off ()
"One-key keyboard macros: turn recording off."
(interactive)
(define-key
global-map
(events-to-keys (this-command-keys) t)
'toggle-kbd-macro-recording-on)
(end-kbd-macro))
(global-set-key '[(f1)] 'call-last-kbd-macro)
(global-set-key '[(shift f1)] 'toggle-kbd-macro-recording-on)
但是当我按 Shift- F1 我收到错误:
define-key:符号的功能 定义无效:事件到键
我该如何修复它?
I am trying to use One-Key Macros (as was written here)
(defun toggle-kbd-macro-recording-on ()
"One-key keyboard macros: turn recording on."
(interactive)
(define-key
global-map
(events-to-keys (this-command-keys) t)
'toggle-kbd-macro-recording-off)
(start-kbd-macro nil))
(defun toggle-kbd-macro-recording-off ()
"One-key keyboard macros: turn recording off."
(interactive)
(define-key
global-map
(events-to-keys (this-command-keys) t)
'toggle-kbd-macro-recording-on)
(end-kbd-macro))
(global-set-key '[(f1)] 'call-last-kbd-macro)
(global-set-key '[(shift f1)] 'toggle-kbd-macro-recording-on)
But when I press Shift-F1 I get error:
define-key: Symbol's function
definition is void: events-to-keys
How can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
events-to-keys
函数似乎已经过时了。据我所知,它应该通过编写以下内容来工作:The
events-to-keys
function seems to be something obsolete. From what I can tell, it should work by just writing: