OSX Emacs:解除绑定恰到好处?
我正在使用 emacsformacosx.com 并希望停止 Meta_R(右元,或右我的 Apple 键盘上的 option 键)不再是 Emacs 元键。
原因是我希望能够继续使用正确的选项键作为字符修饰符,以便在 emacs 中写入时可以输入 UTF-8 字符。例如,我知道我可以执行 Cx 8 RET
并输入 em dash
,但这比 Alt_R -
需要更多工作!
有什么方法可以将键码传递给 global-unset-key
吗?或者我忽略了其他什么?
我应该清楚我仍然希望能够使用 Meta_L 绑定:)
I'm using emacsformacosx.com and would like to stop the Meta_R (right meta, or right option key) on my Apple keyboard from being an Emacs meta key.
The reason is that I want to be able to continue using the right option key as a character modifier so that I can enter UTF-8 chars when writing in emacs. I know I can do a C-x 8 RET
and type em dash
, for example, but that's a lot more work than Alt_R -
!
Is there some way of passing the keycode to global-unset-key
? Or something else I'm overlooking?
I should be clear that I still want to be able to use the Meta_L binding :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要在 GNU Emacs 的 Mac OS X 版本上映射左 Alt 键与 META 和右 Alt 键与 ALT,我使用
:您期望的行为。
To map the the left alt key with META and the right alt key with ALT, on the Mac OS X version of GNU Emacs, I use:
It should do the job for the behaviour you expect.
Aquamacs 有一个名为 ns-右替代修饰符。如果我正确阅读文档,这应该可以满足您的要求:
我不确定现有的 GNU Emacs 是否支持此功能。
Aquamacs has a variable called ns-right-alternate-modifier. If I am reading the documentation correctly, this should do what you want:
I am unsure whether this is supported on stock GNU Emacs.
我找到了适用于带有法语键盘的 MacBook Pro 的解决方案。
考虑到我在这里几乎不使用 Fn 键,我做了什么:
; ALT 被视为 ALT 而不是解释为 META
(setq-default mac-option-modifier nil)
; Fn 被视为 META,而不是解释为 Fn
(setq-default mac-function-modifier 'meta)
所以我可以在 emacs 中随意使用任意数量的反斜杠!
\\[伟大的!!!]\\
I found a solution for my macbook pro with french keyboard.
Considering that I hardly ever use the Fn key here what i did:
; ALT is considered as ALT and not interpreted as META
(setq-default mac-option-modifier nil)
; Fn is considered as META and not interpreted as Fn
(setq-default mac-function-modifier 'meta)
So I can fool around with as many backslash as I want in emacs!
\\[GREAT!!!]\\
这并不完全是你想要的,但这就是我所做的,可能会帮助某人(例如在只有一个选项键的 Macbook 键盘上):你可以只绑定你想要的键:
对于 em dash 等。只需绑定无论你常用什么。在极少数情况下,您想要输入未绑定的内容,您可以(在 Aquamacs 中,在其他 Emacsen 中也应该可以)点击绑定到
的
,使Option键不再是Meta,输入字符,然后再次点击C-;
切换-mac-option-modifierC-;
。This is not exactly what you want, but this is what I do and may help someone (for instance on the Macbook keyboard which has only one option key): You could bind just the keys you want:
for em dash, etc. Just bind whatever you use commonly. In the rare case you want to type something you haven't bound, you can (in Aquamacs, and it should be possible in other Emacsen as well) hit
C-;
which is bound totoggle-mac-option-modifier
, so that Option key is no longer Meta, type the character, and hitC-;
again.