Hi I am trying to define an interactive menu when using 'm' in neotree to give me similar options to what I used in Nerdtree.
I binded this key:
(evil-define-key
'normal neotree-mode-map
... More keybindings ...
(kbd "m") 'neotree-modify-mode-menu)
and my function is:
(defun neotree-modify-mode-menu (option)
"Asks for a mode and execute associated Neotree command"
(interactive "c(a)dd node | (d)elete node | (r)ename node")
(cond
((eq option ?a) (neotree-create-node))
((eq option ?d) (neotree-delete-node))
((eq option ?c) (neotree-copy-node))
((eq option ?r) (neotree-rename-node))
(:else (message (format "Invalid option %c" option)))))
it works for every option but not create-node. The reason is because create-node takes one argument as I can see here: https://github.com/jaypei/emacs-neotree/blob/dev/neotree.el#L1921 and the rest take no arguments.
So I get this error when calling the function from the keybinding:
Wrong number of arguments: #[(filename) "Å2w^@Æ^X GÇU\203^R^@ÈÅÆ\"\210 ÉÆOÊ\232?^PË !\203*^@ÌÍ \"\210ÈÅÆ\"\210^H\203[^@
ÎÏ \"!\203[^@Ð ÇÑÒ ÓÔ$TOÔ\"\210ÕÖÆ #\210× !\210ØÆ!\210^K\203[^@Ù !\210^H?\205u^@^LÎÚ \"!\205u^@Ð Ô\"\210× !\210ØÆ!)0\207" [is-file filename neo-confirm-create-file neo-create-file-auto-o\
pen neo-confirm-create-directory rlt nil 0 throw -1 ...] 8 ("/home/panavtec/.emacs.d/elpa/neotree-20170522.758/neotree.elc" . 64641) (let* ((current-dir (neo-buffer--get-filename-current-lin\
e neo-buffer--start-node)) (current-dir (neo-path--match-path-directory current-dir)) (filename (read-file-name "Filename:" current-dir))) (if (file-directory-p filename) (setq filename (con\
cat filename "/"))) (list filename))], 0
If i bind the key to neotree-create-node function it works:
(evil-define-key normal neotree-mode-map
(kbd "m") 'neotree-create-node)
How I can fix it?