【问题标题】:Getting help from the `C-h k`-command for named extensions从命名扩展的“C-h k”命令中获得帮助
【发布时间】:2021-10-21 09:03:06
【问题描述】:

是否有 emacs 命令来获取命名扩展的帮助?

使用C-h k 通常会为后面的命令提供帮助,但如果我试图获得帮助的命令以M-x 开头,emacs 会为我提供M-x 的帮助,而不是等待听到我需要帮助的命名扩展。

我已尝试阅读随附手册的相关部分,但我要么没有找到正确的部分,要么误解了我所阅读的内容。

【问题讨论】:

    标签: emacs key-bindings


    【解决方案1】:

    你要找的肯定是:

    • C-h fdescribe-functionM-x … 命令或非交互式函数的文档)

    另外,你也可以使用:

    • C-h kdescribe-key:键绑定的文档)

    请注意,emacs 的info 手册中更深入地记录了部分功能/键,因此您也可以尝试输入:

    • C-h F (Info-goto-emacs-command-node)
    • C-h K (Info-goto-emacs-key-command-node)

    在您感兴趣的功能或键绑定之前。

    旁注

    您可能也有兴趣安装一些模式以增加功能的可发现性,即:

    如果您是use-package 用户,安装它们相当于在.emacs 末尾添加:

    (use-package which-key
      :ensure t
      :config
      (which-key-mode))
    
    (use-package discover-my-major
      :ensure t
      :config
      (global-set-key (kbd "C-h C-m") #'discover-my-major)
      (global-set-key (kbd "C-h M-m") #'discover-my-mode))
    
    ;; Recall we also have the standard keybinding "C-h m".
    
    (use-package helpful
      :ensure t
      :config
      (global-set-key (kbd "C-h f") #'helpful-callable)
      (global-set-key (kbd "C-h v") #'helpful-variable)
      (global-set-key (kbd "C-h k") #'helpful-key)
      ;;; Look up Functions (excludes macros).
      ;; (global-set-key (kbd "C-h F") #'helpful-function)
      ;;; Look up Commands (= keybindings).
      ;; (global-set-key (kbd "C-h K") #'helpful-command)
      ;;; COMMENTED-OUT as "Info-goto-emacs[-key]-command-node" are more useful.
      (add-hook 'emacs-lisp-mode-hook #'(lambda ()
        (local-set-key (kbd "C-c C-.") #'helpful-at-point))))
    
    ;; Note we can also type "C-h" after a prefix to list its expansions.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-30
      • 1970-01-01
      • 2021-05-23
      • 1970-01-01
      相关资源
      最近更新 更多