【问题标题】:emacs artist-mode bind right click to menuemacs 艺术家模式绑定右键菜单
【发布时间】:2014-06-04 18:42:36
【问题描述】:

我真的很想使用 emacs-artist 模式来记录我的代码,如下所示:http://www.cinsk.org/emacs/emacs-artist.html

但我无法访问屏幕投射中的菜单。菜单似乎与第三个(中间)鼠标按钮有关。但是我的鼠标只有两个按钮。

如何为 emacs 艺术家模式重新配置我的 emacs 键绑定,它使用第二个(右)鼠标按钮作为菜单?

我当然想为艺术家模式设置绑定。

感谢您的帮助!

【问题讨论】:

  • 如果您还没有这样做,请继续打开artist.el 并查看artist-mode-map 的关键分配。了解分配的内容后,您可以按照 Stefan 在答案中的建议开始修改分配。

标签: emacs key-bindings


【解决方案1】:

这是我在 .emacs.el 中放入的内容

(eval-after-load "artist"
   '(define-key artist-mode-map [(down-mouse-3)] 'artist-mouse-choose-operation)
   )

感谢您的正确提示!

【讨论】:

    【解决方案2】:

    FWIW,右边的按钮是 Emacs 调用的mouse-3,中间的按钮是 Emacs 调用的mouse-2。您应该通过M-x report-emacs-bug 报告此问题,因为我认为这是一个错误。

    您可以通过以下方式解决此问题:

    (define-key artist-mode-map [down-mouse-3] 'artist-mouse-choose-operation)
    

    【讨论】:

    • 感谢您的回答。我尝试将此 (eval-after-load "artist-mode" '(progn (define-key artist-mode-map [down-mouse-2] 'artist-mouse-choose-operation) ) ) 添加到我的 .emacs.el 中,但它不起作用。
    • 我不认为键绑定是一个错误。默认情况下,左键为“绘画”,右键为“擦除”,中键为上下文菜单。
    • 我知道,但我认为这可能是一个错误,因为 Emacs 通常使用右键来调出菜单,所以艺术家可能也应该这样做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-19
    • 1970-01-01
    相关资源
    最近更新 更多