我正处于为 Emacs 创建主要模式以浏览 Stack Exchange 网络并与之交互的早期阶段。
涉及到几种主要模式,都具有类似于dired
. 我查看了 的来源dired
,并提取了我认为可行的内容:
(defvar stack-network-mode-map
(let ((map (make-keymap)))
(define-key map "n" 'stack-network-next-site)
(define-key map "p" 'stack-network-previous-site)
(define-key map "," 'stack-network-move-site-up)
(define-key map "." 'stack-network-move-site-down)
(define-key map "j" 'stack-network-jump-to-bookmarks)
(define-key map "\C-m" 'stack-network-do-enter-site) ; ret
(define-key map "o" 'stack-network-do-enter-site)
(define-key map "u" 'stack-network-do-profile-summary)
(define-key map "\C-uu" 'stack-network-do-profile-summary-for-user)
(define-key map "i" 'stack-network-do-inbox)
(define-key map "b" 'stack-network-toggle-bookmark)
(define-key map "?" 'stack-network-list-functions) ; [1]
(define-key map "\C-i" 'stack-network-display-details) ; tab
map)
"Keymap for Stack Exchange: Network Browser major mode")
但不幸的是,这似乎完全没有效果;像任何其他普通缓冲区一样简单地编辑缓冲区。如果不是这样,我如何实现单键键绑定?(顺便说一句,我敢肯定。这里肯定发生了其他事情。)