我具有以下绑定,它在大多数情况下都有效,除了少数情况下fundamental-mode
中的文件。
(define-key evil-motion-state-map "gd" 'dired-jump)
调用此错误消息
Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
define-key(nil [menu-bar Operate] ("Operate" keymap "Operate"))
easy-menu-get-map(nil ("Operate") nil)
easy-menu-add-item(nil ("Operate") ["Find Files" dired-do-find-marked-files :help "Find current or marked files"] "Shell Command...")
byte-code
autoload-do-load((autoload "dired-x" "Jump to Dired buffer corresponding to current buffer.\nIf in a file, Dired the current directory and move to file's line.\nIf in Dired already, pop up a level and goto old directory's line.\nIn case the proper Dired file line cannot be found, refresh the dired\nbuffer and try again.\nWhen OTHER-WINDOW is non-nil, jump to Dired buffer in other window.\nWhen FILE-NAME is non-nil, jump to its line in Dired.\nInteractively with prefix argument, read FILE-NAME.\n\n(fn &optional OTHER-WINDOW FILE-NAME)" t nil) dired-jump)
command-execute(dired-jump)
我怀疑这行
(let ((menu (lookup-key dired-mode-map [menu-bar])))
(easy-menu-add-item menu '("Operate")
["Find Files" dired-do-find-marked-files
:help "Find current or marked files"]
"Shell Command...")
在dired-x.el
中返回menu
作为nil
。我可以为[menu-bar]
定义dired-mode-map
吗?还是有其他解决方案?