Closed shadowrylander closed 3 years ago
I think the cdr
part might be quoted inside the macro, and therefore is evaluated as a list instead of the result of the function call. Try using ryo-modal-key
instead and see if that works.
I attempted the following, but it gave me the same error:
(ryo-modal-key "ll" '(cdr (assoc "wq" evil-ex-commands)))
I also tried an interactive lambda, but that gave me the same error with lambda
instead of cdr
.
Should I perhaps put them in a let statement and then assign them to the keys?
Fascinating; so it worked after I did the following:
ryo-modal-key[s]
in a let statement, and moving the cdr
statement to a let variable, thenevil-mode
I think this should allow me to use ryo-modal's use-package
keyword, correct?
I'm not sure, I haven't used the use-package
keyword myself. However I think that you shouldn't quote the cdr
statement, since I guess you're trying to get an element from the evil-ex-commands
alist. Does the following work?
(ryo-modal-key "ll" (cdr (assoc "wq" evil-ex-commands)))
Ah; yes, yes it does. However, I'm still getting a Error (use-package): ryo-modal/:config: Symbol’s value as variable is void: evil-ex-commands
error when putting it in the ryo-modal
config section; putting it in the evil-mode
section works. I do want to implement it using the :ryo
keyword, though, and none of the following work; the first gives no error, but just flat out doesn't work, while the latter two are giving me the same errors as before:
:ryo
(let ((wq (cdr (assoc "wq" evil-ex-commands))))
("ll" wq))
:ryo ("ll" (cdr (assoc "wq" evil-ex-commands)))
:ryo ("ll" '(cdr (assoc "wq" evil-ex-commands)))
Oh, and neither does this work; same effect as the first example in the previous message:
:ryo
(let ((wq (cdr (assoc "wq" evil-ex-commands))))
("ll" 'wq))
The reason for the Error (use-package): ryo-modal/:config: Symbol’s value as variable is void: evil-ex-commands
is probably that ryo-modal
is loaded before evil-ex-commands
is known.
I surmised as much; however, I still cannot use your use-package
keyword.
This user on reddit mentions using the eval
method from your prefix keys section; could you possibly explain that to me? I don't quite understand it.
The aforementioned reddit user gave me this snippet that works:
(eval
`(ryo-modal-keys
("l l" ,(general-simulate-key ":wq <RET>") :first '(evil-normal-state) :name "wq")
("l p" ,(general-simulate-key ":q <RET>") :first '(evil-normal-state) :name "q")
("l o" ,(general-simulate-key ":w <RET>") :first '(evil-normal-state) :name "w")
("l q" ,(general-simulate-key ":q! <RET>") :first '(evil-normal-state) :name "q!"))
Could you show me how to convert this to a use-package
keyword format, i.e. using :ryo
?
I don't use the :ryo
keyword in use-package
myself, and if I remember correctly it was submitted as a pull request by another user. So I'm sorry, I can not.
Ah; that is understandable. I may have a solution for the keyword on hand, so I'll post that here in a little bit if it works!
Unfortunately, the keyword solution didn't work. But thank you kindly for all the help! I'll go ahead and close this, then!
Hello!
I would like some help in configuring your package, via
use-package
, to run a command from theevil-ex-commands
alist, using("ll" (cdr (assoc "wq" evil-ex-commands)))
; however, I'm getting theError (use-package): ryo-modal/:config: Wrong type argument: listp, cdr
error. Here is the wholeryo-modal + use-package
code I'm using:Any help would be greatly appreciated!