:then keyword not working
sriramkswamy opened this issue · comments
I used a similar configuration as shown in the blog post
;; mapping for change
(ryo-modal-keys
("c"
(("c" kill-whole-line :then '(open-line) :exit t)
("e" kill-word :exit t))))
But the above definition leads to the following error
Error (use-package): ryo-modal :config: Invalid function: (open-line)
However, defining it individually works
(ryo-modal-key "c c" 'kill-whole-line :then '(open-line) :exit t)
Hi! Thank you for reporting. I should probably test the code properly before writing a blog post ;)
When using "prefixes", the "subkey" forms seems to be quoted automatically, in some way. I haven't used macros and this kind of elisp before, so its all a bit new to me. Anyway, when using prefixes you just unquote the list after the :then
keyword:
;; mapping for change
(ryo-modal-keys
("c"
(("c" kill-whole-line :then (open-line) :exit t)
("e" kill-word :exit t))))
I'll keep this open, and see if I can make it more uniform, or update the blog post and documentation.
Ah, I see. No worries. I'm kind of new to elisp too but I really like the improvements you have made to modalka. I'll be trying to build a config around this and I'll let you know if I face any other issues.
As a sidenote, I just wanted to know if you use multiple-cursors. If you do, I face the same issue with ryo-modal
as the one I faced with modalka - described here.
Yes, I do use multiple-cursors and I've noticed that problem too.
A good idea would probably be to whitelist all ryo: functions in
multiple-cursors by default, and provide a keyword in case the user wants
to blacklist them. I'll see if I can add that, thanks for the suggestion!
On Mon, Nov 14, 2016 at 3:00 PM Sriram Krishnaswamy <
notifications@github.com> wrote:
Ah, I see. No worries. I'm kind of new to elisp too but I really like the
improvements you have made to modalka. I'll be trying to build a config
around this and I'll let you know if I face any other issues.As a sidenote, I just wanted to know if you use multiple-cursors
https://github.com/magnars/multiple-cursors.el. If you do, I face the
same issue with ryo-modal as the one I faced with modalka - described here
mrkkrp/modalka#13.—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysuctsi3Yq7VVj8Ih3BN3GhbWLngIKks5q-GmIgaJpZM4Kwmk_
.
A good idea would probably be to whitelist all ryo: functions in
multiple-cursors by default
By whitelist, do you mean to list them in the variable where ALL cursors perform that action?
I'll see if I can add that
That'll be great!
Yes, by default all commands created by ryo-key
or ryo-keys
would end
up in mc/cmds-to-run-for-all
, but with a keyword like mc-one: t
it
would end up in mc/cmds-to-run-once
instead.
On Mon, Nov 14, 2016 at 3:18 PM Sriram Krishnaswamy <
notifications@github.com> wrote:
A good idea would probably be to whitelist all ryo: functions in
multiple-cursors by defaultBy whitelist, do you mean to list them in the variable where ALL cursors
perform that action?I'll see if I can add that
That'll be great!
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysuVWZu_npY-ADI_KBjJf2u9HBCZ1nks5q-G2agaJpZM4Kwmk_
.
Yes, by default all commands created by
ryo-key
orryo-keys
would end
up inmc/cmds-to-run-for-all
I don't think that will solve the problem though. I already have added the maps I use, like ryo:C-b
and ryo:C-f
, to the mc/cmds-to-run-for-all
variable but using them while using multiple cursors just merges everything into one cursor.
Probably this gif might explain what I'm trying to say.
The latest commit changes how ryo
creates bindings. They are now defined as commands, just like every other command in Emacs. This has both pros and cons. The main con is that it clutters the command namespace, and that the commands get ugly names (since they need to have unique names). The biggest pro is that Ryo now works with multiple-cursors
!