emacs-evil / evil-collection

A set of keybindings for evil-mode
GNU General Public License v3.0
1.22k stars 272 forks source link

Problem deleting chars in eval-expression #244

Closed dieggsy closed 5 years ago

dieggsy commented 5 years ago

When doing M-x eval-expression, I can't actually delete characters with DEL (<backspace>). I get the error:

Debugger entered--Lisp error: (wrong-number-of-arguments #f(compiled-function (count) (interactive (list (prefix-numeric-value current-prefix-arg))) #<bytecode 0x156c3113f325>) 0)
  #f(compiled-function (count) (interactive (list (prefix-numeric-value current-prefix-arg))) #<bytecode 0x156c3113f325>)()
  apply(#f(compiled-function (count) (interactive (list (prefix-numeric-value current-prefix-arg))) #<bytecode 0x156c3113f325>) nil)
  evil-collection-hungry-delete(#f(compiled-function (count) (interactive (list (prefix-numeric-value current-prefix-arg))) #<bytecode 0x156c3113f325>))
  apply(evil-collection-hungry-delete #f(compiled-function (count) (interactive (list (prefix-numeric-value current-prefix-arg))) #<bytecode 0x156c3113f325>) nil)
  evil-delete-backward-char-and-join()
  funcall-interactively(evil-delete-backward-char-and-join)
  call-interactively(evil-delete-backward-char-and-join nil nil)
  command-execute(evil-delete-backward-char-and-join)
  read-from-minibuffer("Eval: " nil (keymap (9 . completion-at-point) (27 keymap (9 . completion-at-point)) keymap (18 . counsel-minibuffer-history) (escape . minibuffer-keyboard-quit) (31 . minibuffer-keyboard-quit) (67108911 . minibuffer-keyboard-quit) (insert-state keymap "Auxiliary keymap for Insert state" (18 . counsel-minibuffer-history)) (normal-state keymap "Auxiliary keymap for Normal state" (13 . exit-minibuffer) (escape . abort-recursive-edit)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) t read-expression-history)
  read--expression("Eval: ")
  byte-code("\301\302!\303\10!B\207" [current-prefix-arg read--expression "Eval: " eval-expression-get-print-arguments] 3)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
jojojames commented 5 years ago

Woops, sorry I missed this.

Looks like evil-collection-hungry-delete needs to account for this case.

My backspace in the minibuffer doesn't use hungry delete (or evil though).

I'm guessing you're using the minibuffer code for evil-collection too?

dieggsy commented 5 years ago

@jojojames yeah, I have (evil-collection-setup-minibuffer t) in my init

jojojames commented 5 years ago

Config?

dieggsy commented 5 years ago

For evil-collection, just this:

(use-package evil-collection
  :custom
  (evil-collection-company-use-tng nil)
  (evil-collection-setup-minibuffer t)
  (evil-collection-term-sync-state-and-mode-p t)
  :init
  (evil-collection-init))
jojojames commented 5 years ago

My lisp-fu isn't that great so I just hacked up a solution. I'm sure there's a cleaner way to fix this..

I didn't test the case where hungry-delete is on in the minibuffer, not sure if that's even possible.

dieggsy commented 5 years ago

thanks, that does seem to be working :)