Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evil-redirect-digit-argument removed from evil #93

Closed
sballert opened this issue Oct 22, 2021 · 7 comments
Closed

evil-redirect-digit-argument removed from evil #93

sballert opened this issue Oct 22, 2021 · 7 comments

Comments

@sballert
Copy link

Hi, I get the following error message when I try to execute a command from org-mode:

evil-org--populate-base-bindings: Symbol’s function definition is void: evil-redirect-digit-argument

I think this issue results from the following evil mode change:

emacs-evil/evil#1519

This commit removes the evil-redirect-digit-argument function from evil.

@sballert sballert changed the title evil-redirect-digit-argument evil-redirect-digit-argument removed from evil Oct 22, 2021
@dchrzanowski
Copy link

dchrzanowski commented Oct 22, 2021

As a quick solution I've deleted lines 635 and 636, recompiled the evil-org source and restarted Emacs. All is good again.

@erganemic
Copy link
Contributor

erganemic commented Oct 23, 2021

Yeah, apologies to evil-org users - I thought my PR would go through another round of cleanup by people more experienced with package development than me before it got merged, where we'd add a more idiomatic way of gracefully retiring a function. For those out of the loop though, evil-redirect-digit-argument was pretty broken: its use in evil-org caused any motion with a 0 in the count argument to fail, per #91. At least #93 is an obvious bug, and not an upstream one that causes your motions to fail silently and makes you comb through keypress parsers for a week!

@dchrzanowski
Copy link

@jmmathena Not to worry, things like that happen. Especially when there's so many packages that rely on each other as dependencies.
I don't know if anyone is actually maintaining evil-org. Last commit was a while back.

@tshu-w
Copy link
Contributor

tshu-w commented Oct 24, 2021

This code should fix this issue temporary

(fset 'evil-redirect-digit-argument 'ignore) ;; before evil-org loaded

(add-to-list 'evil-digit-bound-motions 'evil-org-beginning-of-line)
(evil-define-key 'motion 'evil-org-mode
    (kbd "0") 'evil-org-beginning-of-line)

@erganemic
Copy link
Contributor

Also, update: I'm nearly done with a PR for evil that will remove the evil-digit-bound-motions custom var added in my PR in favor of a more seamless strategy for handling motions bound to "0". If or when it's merged in, you'll just be able to treat the binding to "0" the same as any other keybinding; e.g. have

(defun evil-org--populate-base-bindings ()
  "Bindings that are always available."
  (evil-define-key 'motion 'evil-org-mode
    (kbd "0") 'evil-org-beginning-of-line
    (kbd "$") 'evil-org-end-of-line
. . . ;; Remainder of evil-org

This won't fix the issue with evil-org being broken by the removal of evil-redirect-digit-argument, but it does mean you won't have to futz around with a clunky custom variable.

@kassick
Copy link

kassick commented Oct 27, 2021

I've been using this kludge to avoid the bug while the packages upstream are not fixed (only evil-iedit and evil-org use the function in my setup)

(when (not (boundp 'evil-redirect-digit-argument))
  (defmacro evil-redirect-digit-argument (map keys target)
     `(define-key ,map ,keys ,target)))

0 seems to behave as expected in iedit and org

aam-at added a commit to aam-at/dotfiles that referenced this issue Oct 28, 2021
mcwitt added a commit to mcwitt/nixos-config that referenced this issue Nov 1, 2021
wagk added a commit to wagk/.emacs.d that referenced this issue Nov 3, 2021
sballert added a commit to sballert/nixos-config that referenced this issue Nov 3, 2021
mcwitt added a commit to mcwitt/nixos-config that referenced this issue Nov 5, 2021
leezu added a commit to leezu/dotfiles that referenced this issue Nov 8, 2021
@Somelauw
Copy link
Owner

Solved by #96

Phundrak added a commit to Phundrak/config.phundrak.com that referenced this issue Nov 20, 2021
Issue Somelauw/evil-org-mode#93 finally got
solved by PR Somelauw/evil-org-mode#96,
workaround code can now be removed
tshu-w added a commit to tshu-w/.emacs.d that referenced this issue Jul 12, 2023
tshu-w added a commit to tshu-w/.emacs.d that referenced this issue Jul 18, 2023
tshu-w added a commit to tshu-w/.emacs.d that referenced this issue Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants