在Emacs中巧用鼠标右键菜单, 解放您的双手

个人的一点点分享…
在 Emasc 如果仅仅是用作浏览内容, 我觉得使用鼠标会更合理, 所以在 Emacs 中添加了鼠标右键菜单.
以下是我在 Emacs 中仅仅使用鼠标在nov模式阅读书籍:
右键

如果单纯使用键盘的时候做到这些就比较麻烦了, 因为在阅读的时候光标应该是不动的,
当你想捕获笔记时还需要将光标定位到文本, 选中, 捕获这相当困难, 使用鼠标就很快

;; 右键弹窗示例
  (defun freedom-context-menu (event)
    "鼠标右键菜单"
    (interactive "e")
    (popup-menu
     '("Freedom Menu"
       ["Kill this buffer"     (kill-this-buffer)]
       ["Delete window"        (delete-window)]
       ["Spilt window right"   (split-window-right)]
       ["Spilt winodw below"   (split-window-below)]
       ["Scroll down"          (scroll-down-command)]
       ["Scroll up"            (scroll-up-command)]
       ["Translate text"       (google-translate-at-point)]
       ["Translate paragraphs" (google-translate-paragraphs-overlay)]
       ("Code"
        ["Go to definitions"  (eglot-find-declaration)]
        ["<Back"              (xref-go-back)])
       ("Bm"
        ["Bm toggle"    (bm-toggle)]
        ["Bm show file" (bm-show)]
        ["Bm show all"  (bm-show-all)]
        ["Bm next"      (bm-next)]
        ["Bm previous"  (bm-previous)])
       ("Book Capture"
        ["Harry Potter"         (org-capture nil "Bc")])
       ("Nov"
        ["Up page"          (nov-previous-document)]
        ["Down page"        (nov-next-document)]
        ["<Back history"    (nov-history-back)]
        ["Forward history>" (nov-history-forward)]
        ["Toc"              (nov-goto-toc)]))))
  (global-set-key [mouse-3] 'freedom-context-menu)
``
10 个赞

就翻译文本而言,可能键盘结合鼠标更好。鼠标选中区域,然后按下翻译的按键(如 C-c t),可能比右键菜单更快

是个好思路,直接抄走

好办法,请问如何做到按右键后先获得点击窗口的焦点