easy-menu-get-map:错误的参数类型:keymapp,nil

时间:2019-04-12 13:16:43

标签: emacs dired evil-mode

我具有以下绑定,它在大多数情况下都有效,除了少数情况下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吗?还是有其他解决方案?

0 个答案:

没有答案