如何绑定<打印屏幕>到 emacs 中的宏?
我希望能够在 emacs 中点击
并触发 git 存储库中的提交。我的 lisp 很生锈,知道它坏了,但不知道在哪里:
( defun tip-local-write nil "Write to store" ( interactive )
( save-buffer )
( change-directory "~/tip" )
( shell-command "git commit -m checkpoint ." )
( shell-command "git submodule foreach git commit -m checkpoint . \\\|\\\| true" ) ) )
( global-set-key [?\M-1] 'tip-local-write )
目前它绑定到 ^1 因为我不知道如何表示
按钮。
I would like to be able to hit <Print Screen>
in emacs and trigger a commit in a git repository. My lisp is pretty rusty and know this is broken, but don't know where:
( defun tip-local-write nil "Write to store" ( interactive )
( save-buffer )
( change-directory "~/tip" )
( shell-command "git commit -m checkpoint ." )
( shell-command "git submodule foreach git commit -m checkpoint . \\\|\\\| true" ) ) )
( global-set-key [?\M-1] 'tip-local-write )
Currently it is binding to ^1 because I don't know how to represent the <Print Screen>
button.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
用于绑定您不知道 Emacs 名称的击键的通用技巧:
Mx global-set-key RET; RET <函数名称>
然后,点击Cx ESC ESC(即
repeat-complex-command
)。在迷你缓冲区中,您应该看到一个全局设置键函数调用,您可以将其复制到 .emacs 文件中。A general trick that works for binding keystrokes you don't know the Emacs names for:
M-x global-set-key RET <your keystroke> RET <name of function>
Then, hit C-x ESC ESC (which is
repeat-complex-command
). In the minibufer, you should see a global-set-key function invocation that you can copy into your .emacs file.