本文介绍了在 Emacs 键映射值中显示键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我查询 keymap 的当前值时,例如使用 M-: (current-local-map),它会向我显示以下内容:

值:(键盘映射(S-mouse-2 . muse-follow-name-at-mouse-other-window)(mouse-2 .muse-follow-name-at-mouse)(33554445 . 缪斯跟随姓名在点其他窗口)(S-return . muse-follow-name-at-point-other-window)(13 . 缪斯跟随姓名在点)(返回 .muse-follow-name-at-point)键盘映射(67108924 . muse-decrease-list-item-indentation)(67108926 . muse-increase-list-item-indentation)(M-return .muse-insert-list-item)(33554441 . 缪斯以前的参考)(S-iso-lefttab . muse-previous-reference)(S-tab . muse-previous-reference)(S-mouse-2 . muse-follow-name-at-mouse-other-window)(mouse-2 .muse-follow-name-at-mouse)(33554445 . 缪斯跟随姓名在点其他窗口)(9 . 缪斯-下一个参考)(标签.缪斯下一个参考)(3 键映射(19 . 缪斯搜索)(2 . muse-find-backlinks)(标签.缪斯插入物)(9 . 缪斯插入物)(16 . 缪斯-项目-发布)(6 . muse-project-find-file)(61 . 缪斯-改变了什么)(22 . 缪斯浏览结果)(27 键映射(20 .缪斯发布此文件))(33554452 . 缪斯发布此文件)(20 . muse-project-publish-this-file)(12 . 字体锁定模式)(5 . muse-edit-link-at-point)(1 . 缪斯索引))键盘映射(27 键映射(9 . ispell-complete-word)))

我希望看到更有意义的东西而不是数字,例如 (control ?c) return .我怎么做 ?

解决方案

这就是你所需要的:库 help-fns+.el.

这为您提供了 命令 describe-keymap,它为您提供了绑定到变量的任何键映射的人类可读描述.例如:

定向模式映射--------------有关更多信息,请查看手册.dired-mode"缓冲区的本地键盘映射.键绑定--- -------e .. f 直接查找文件RET 直接查找文件C-o 定向显示文件C-t 前缀命令ESC 前缀命令SPC直接下线!dired-do-shell-命令#dired-flag-auto-save-files$dired-hide-subdir% 前缀命令& dired-do-async-shell-command* 前缀命令+ 直接创建目录- 否定论点.直接清理目录0 .. 9 位参数: 前缀命令下一个目录?摘要急于求成的搜索B 直接执行字节编译C 直接复制D 直接删除G dired-do-chgrpH 直接做硬链接L 直接加载M dired-do-chmodOdired-do-chown直接打印Q dired-do-query-replace-regexpR 直接重命名S dired-do-symlinkT 害怕做触摸U dired-unmark-all-marksX dired-do-shell-commandZ 直接压缩^ 定向目录一个直接查找替代文件d dired-flag-file-deletiong 恢复缓冲区h 描述模式我dired-maybe-insert-subdirj 直接跳转到文件k 可怕的杀戮线l 直接重新显示m 方向标记n 可怕的下一行o 直接查找文件其他窗口p dired-previous-lineq 退出窗口s 直接排序切换或编辑t 方向切换标记你直接取消标记v 定向视图文件w dired-copy-filename-as-killx dired-do-flagged-deletey 直接显示文件类型z 杀死这个缓冲区~ dired-flag-backup-filesDEL dired-unmark-backward鼠标脸定向鼠标查找文件其他窗口??C-t C-t image-dired-dired-toggle-marked-thumbsC-t .图像导向显示拇指C-t a image-dired-display-thumbs-appendC-t c image-dired-dired-comment-filesC-t d image-dired-display-thumbsC-t e image-dired-dired-edit-comment-and-tagsC-t f image-dired-mark-tagged-filesC-t i image-dired-dired-display-imageC-t j image-dired-jump-thumbnail-bufferC-t r image-dired-delete-tagC-t t image-dired-tag-filesC-t x image-dired-dired-display-externalC-M-d dired-tree-downC-M-n dired-next-subdirC-M-p dired-prev-subdirC-M-u dired-tree-upM-$直接隐藏所有M-= dired-backup-diffM-s 前缀命令M-{ dired-prev-marked-fileM-} dired-next-marked-fileM-DEL 直接取消标记所有文件M-s 前缀命令M-s f 前缀命令% & dired-flag-garbage-files% C dired-do-copy-regexp% H dired-do-hardlink-regexp% R dired-do-rename-regexp% S dired-do-symlink-regexp% d dired-flag-files-regexp% g 目录标记文件包含正则表达式% l 直接小写% m dired-mark-files-regexp% r dired-do-rename-regexp% u dired-upcase* C-n dired-next-marked-file* C-p dired-prev-marked-file* !dired-unmark-all-marks* % dired-mark-files-regexp* * dired-mark-executables*/dired-mark-directories* ?直接取消标记所有文件* @dired-mark-symlinks* c 直接更改标记* m 方向标记* s dired-mark-subdir-files* t dired-toggle-marks* 你直接取消标记* DEL dired-unmark-backward: d epa-dired-do-decrypt: e epa-dired-do-encrypt: s epa-dired-do-sign: v epa-dired-do-verify直接撤销可怕的下一行可怕的前一行直接切换只读直接撤销M-s f C-s dired-isearch-filenamesM-s f ESC 前缀命令M-s a C-s dired-do-isearchM-s ESC 前缀命令M-s f C-M-s dired-isearch-filenames-regexpM-s a C-M-s dired-do-isearch-regexp

When I query the current value of the keymap, eg with M-: (current-local-map), it shows me something along these lines:

Value:
(keymap
 (S-mouse-2 . muse-follow-name-at-mouse-other-window)
 (mouse-2 . muse-follow-name-at-mouse)
 (33554445 . muse-follow-name-at-point-other-window)
 (S-return . muse-follow-name-at-point-other-window)
 (13 . muse-follow-name-at-point)
 (return . muse-follow-name-at-point)
 keymap
 (67108924 . muse-decrease-list-item-indentation)
 (67108926 . muse-increase-list-item-indentation)
 (M-return . muse-insert-list-item)
 (33554441 . muse-previous-reference)
 (S-iso-lefttab . muse-previous-reference)
 (S-tab . muse-previous-reference)
 (S-mouse-2 . muse-follow-name-at-mouse-other-window)
 (mouse-2 . muse-follow-name-at-mouse)
 (33554445 . muse-follow-name-at-point-other-window)
 (9 . muse-next-reference)
 (tab . muse-next-reference)
 (3 keymap
    (19 . muse-search)
    (2 . muse-find-backlinks)
    (tab . muse-insert-thing)
    (9 . muse-insert-thing)
    (16 . muse-project-publish)
    (6 . muse-project-find-file)
    (61 . muse-what-changed)
    (22 . muse-browse-result)
    (27 keymap
        (20 . muse-publish-this-file))
    (33554452 . muse-publish-this-file)
    (20 . muse-project-publish-this-file)
    (12 . font-lock-mode)
    (5 . muse-edit-link-at-point)
    (1 . muse-index))
 keymap
 (27 keymap
     (9 . ispell-complete-word)))

I want instead of numbers see something more meaningful like (control ?c) return for example. How do I do that ?

解决方案

This is what you need: library help-fns+.el.

That gives you, as , command describe-keymap, which gives you a human-readable description of any keymap bound to a variable. E.g.:


    dired-mode-map
    --------------



    For more information check the manuals.

    Local keymap for `dired-mode' buffers.

    key             binding
    ---             -------

    e .. f      dired-find-file

    RET     dired-find-file
    C-o     dired-display-file
    C-t     Prefix Command
    ESC     Prefix Command
    SPC     dired-next-line
    !       dired-do-shell-command
    #       dired-flag-auto-save-files
    $       dired-hide-subdir
    %       Prefix Command
    &       dired-do-async-shell-command
    *       Prefix Command
    +       dired-create-directory
    -       negative-argument
    .       dired-clean-directory
    0 .. 9      digit-argument
    :       Prefix Command
           dired-next-dirline
    ?       dired-summary
    A       dired-do-search
    B       dired-do-byte-compile
    C       dired-do-copy
    D       dired-do-delete
    G       dired-do-chgrp
    H       dired-do-hardlink
    L       dired-do-load
    M       dired-do-chmod
    O       dired-do-chown
    P       dired-do-print
    Q       dired-do-query-replace-regexp
    R       dired-do-rename
    S       dired-do-symlink
    T       dired-do-touch
    U       dired-unmark-all-marks
    X       dired-do-shell-command
    Z       dired-do-compress
    ^       dired-up-directory
    a       dired-find-alternate-file
    d       dired-flag-file-deletion
    g       revert-buffer
    h       describe-mode
    i       dired-maybe-insert-subdir
    j       dired-goto-file
    k       dired-do-kill-lines
    l       dired-do-redisplay
    m       dired-mark
    n       dired-next-line
    o       dired-find-file-other-window
    p       dired-previous-line
    q       quit-window
    s       dired-sort-toggle-or-edit
    t       dired-toggle-marks
    u       dired-unmark
    v       dired-view-file
    w       dired-copy-filename-as-kill
    x       dired-do-flagged-delete
    y       dired-show-file-type
    z       kill-this-buffer
    ~       dired-flag-backup-files
    DEL     dired-unmark-backward
       mouse-face
       dired-mouse-find-file-other-window
         ??

    C-t C-t     image-dired-dired-toggle-marked-thumbs
    C-t .       image-dired-display-thumb
    C-t a       image-dired-display-thumbs-append
    C-t c       image-dired-dired-comment-files
    C-t d       image-dired-display-thumbs
    C-t e       image-dired-dired-edit-comment-and-tags
    C-t f       image-dired-mark-tagged-files
    C-t i       image-dired-dired-display-image
    C-t j       image-dired-jump-thumbnail-buffer
    C-t r       image-dired-delete-tag
    C-t t       image-dired-tag-files
    C-t x       image-dired-dired-display-external

    C-M-d       dired-tree-down
    C-M-n       dired-next-subdir
    C-M-p       dired-prev-subdir
    C-M-u       dired-tree-up
    M-$     dired-hide-all
    M-=     dired-backup-diff
    M-s     Prefix Command
    M-{     dired-prev-marked-file
    M-}     dired-next-marked-file
    M-DEL       dired-unmark-all-files

    M-s a       Prefix Command
    M-s f       Prefix Command

    % &     dired-flag-garbage-files
    % C     dired-do-copy-regexp
    % H     dired-do-hardlink-regexp
    % R     dired-do-rename-regexp
    % S     dired-do-symlink-regexp
    % d     dired-flag-files-regexp
    % g     dired-mark-files-containing-regexp
    % l     dired-downcase
    % m     dired-mark-files-regexp
    % r     dired-do-rename-regexp
    % u     dired-upcase

    * C-n       dired-next-marked-file
    * C-p       dired-prev-marked-file
    * !     dired-unmark-all-marks
    * %     dired-mark-files-regexp
    * *     dired-mark-executables
    * /     dired-mark-directories
    * ?     dired-unmark-all-files
    * @     dired-mark-symlinks
    * c     dired-change-marks
    * m     dired-mark
    * s     dired-mark-subdir-files
    * t     dired-toggle-marks
    * u     dired-unmark
    * DEL       dired-unmark-backward

    : d     epa-dired-do-decrypt
    : e     epa-dired-do-encrypt
    : s     epa-dired-do-sign
    : v     epa-dired-do-verify

        dired-undo
          dired-next-line
          dired-previous-line
       dired-toggle-read-only
               dired-undo

    M-s f C-s   dired-isearch-filenames
    M-s f ESC   Prefix Command

    M-s a C-s   dired-do-isearch
    M-s a ESC   Prefix Command

    M-s f C-M-s dired-isearch-filenames-regexp

    M-s a C-M-s dired-do-isearch-regexp

这篇关于在 Emacs 键映射值中显示键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 04:47