我正在尝试重新定义用于导航历史的键,这些键用于接受正则表达式并提供C-p / C-n历史导航的几个命令.除了C-p / C-n之外,我还想使用其他键.例如,当使用occurrence或replace-
regexp时,可以使用C-p和C-n转到上一个和下一个元素.
我已经尝试了几件事,但无法使其发挥作用.我想我在这里错过了“大局”.
我需要修改哪种模式图,何时以及如何修改?我试过的一切都失败了.
P.S:请注意,我已经有了自己的次要模式,我的所有键盘图都在这里建议.
我假设你只需要miniuffer-local-map.使用先前分配给该键映射的键的后续定义将胜过先前的定义.要禁用先前的键分配,只需创建一个新定义并将最后一部分设置为nil而不是’function-name.
(define-key minibuffer-local-map (kbd "<f6>") 'help-for-help)
以下是Emacs Trunk的摘录… / lisp / bindings.el:
(let ((map minibuffer-local-map)) (define-key map "\en" 'next-history-element) (define-key map [next] 'next-history-element) (define-key map [down] 'next-history-element) (define-key map [XF86Forward] 'next-history-element) (define-key map "\ep" 'prevIoUs-history-element) (define-key map [prior] 'prevIoUs-history-element) (define-key map [up] 'prevIoUs-history-element) (define-key map [XF86Back] 'prevIoUs-history-element) (define-key map "\es" 'next-matching-history-element) (define-key map "\er" 'prevIoUs-matching-history-element) ;; Override the global binding (which calls indent-relative via ;; indent-for-tab-command). The alignment that indent-relative tries to ;; do doesn't make much sense here since the prompt messes it up. (define-key map "\t" 'self-insert-command) (define-key map [C-tab] 'file-cache-minibuffer-complete))