0

What is the syntax necessary to make the binding to key t work in the below?

(evil-leader/set-key
  "f" 'find-file
  "o" 'other-window
  "b" 'switch-to-buffer
  "k" 'kill-buffer
  "1" 'delete-other-windows
  "2" 'split-window-below
  "3" 'split-window-right
  "c" 'winner-undo
  "w" 'enlarge-window-horizontally
  "t" (lambda () (enlarge-window 5))
  "d" 'ido-dired)

I've tried several variations, including quoting the entire expression, quoting just the enlarge-window call and others. Perhaps you can't do it this way?

Drew
  • 29,895
  • 7
  • 74
  • 104
johnbakers
  • 24,158
  • 24
  • 130
  • 258

1 Answers1

3

The function needs to be interactive. e.g.

(evil-leader/set-key
  ...
  "t" (lambda () (interactive) (enlarge-window 5)))

A side-note: if the verbosity bugs you, this macro can fix that:

(defmacro λ! (&rest body)
  `(lambda () (interactive) ,@body))

(evil-leader/set-key
  "t" (λ! (enlarge-window 5)))
Henrik
  • 982
  • 1
  • 8
  • 10