Kungsgeten / ryo-modal

Roll your own modal mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trouble with ryo key assignments

kahironimashte opened this issue · comments

Hi, am having some trouble getting the keys in ryo-mode assigned.

If I uncomment the assignments below I get errors on startup. The "w" assignment works fine, so basically things should work.
I use a configuration.org for settings. If I mark the expression and evaluate the region, things work fine, till I restart emacs.

*** Additional Keys
#+BEGIN_SRC emacs-lisp
  (ryo-modal-keys 
  ;;  ("d"
  ;;   (("u" "C-c C-u")
  ;;    ("l" "C-c C-f")
  ;;    ("h" "C-c C-b")
  ;;    ("j" "C-c C-n")
  ;;    ("k" "C-c C-p")))
  ;;  ("ö" "<tab>")
  ("w" "M-w")
  )
#+END_SRC

The error output (--debug-init) is as follows:

Debugger entered--Lisp error: (void-function nil)
  documentation(nil)
  ryo-modal-key("d u" "C-c C-u")
  apply(ryo-modal-key ("d u" "C-c C-u"))
  #f(compiled-function (x) #<bytecode 0xf51b7b>)(("u" "C-c C-u"))
  mapc(#f(compiled-function (x) #<bytecode 0xf51b7b>) (("u" "C-c C-u") ("l" "C-c C-f") ("h" "C-c C-b") ("j" "C-c C-n") ("k" "C-c C-p")))
  ryo-modal-key("d" (("u" "C-c C-u") ("l" "C-c C-f") ("h" "C-c C-b") ("j" "C-c C-n") ("k" "C-c C-p")))
  eval-buffer(#<buffer  *load*-432127> nil "/home/pi/.emacs.d/configuration.el" nil t)  ; Reading at buffer position 989
  load-with-code-conversion("/home/pi/.emacs.d/configuration.el" "/home/pi/.emacs.d/configuration.el" nil nil)
  load("/home/pi/.emacs.d/configuration.el" nil nil t)
  load-file("/home/pi/.emacs.d/configuration.el")
  org-babel-load-file("~/.emacs.d/configuration.org")
  eval-buffer(#<buffer  *load*> nil "/home/pi/.emacs" nil t)  ; Reading at buffer position 4555
  load-with-code-conversion("/home/pi/.emacs" "/home/pi/.emacs" t t)
  load("~/.emacs" t t)
  #f(compiled-function () #<bytecode 0xaa6bf>)()
  command-line()
  normal-top-level()

Both assignments ("d" ...) and ("ö" ...) cause errors, if I uncomment them individually.

Hi! Unfortunately ryo have issues with long key sequences (such as "C-c C-u" in your example). I couldn't get it to work last time I tried (see #28). My recommendation would be to refer to the command bound to the key sequence instead.

Thank you!
This seems to work.
Love the ryo-mode so far.

When I try to set keys with ryo-modal-major-mode-keys I have trouble with prefixes.

 (ryo-modal-major-mode-keys
   'org-agenda-mode
 ("c"
	  (("a" org-agenda-deadline))))

throws the error

ryo-modal-key: Key sequence c a starts with non-prefix key c

But this synthax worked with the ryo-modal-keys

What did I do wrong?

The example you give works fine for me. Are you using the latest version of ryo-modal?

Yes I use the latest version.

It seems something got stuck while using a lot of M-x eval-region to test out the settings. After restarting emacs everything worked as expected. Thanks for the feedback!

commented

This error occurs for me with the example given in the README

(ryo-modal-keys
   (:norepeat t)
   ("0" "M-0")
   ("1" "M-1")
   ("2" "M-2")
   ("3" "M-3")
   ("4" "M-4")
   ("5" "M-5")
   ("6" "M-6")
   ("7" "M-7")
   ("8" "M-8")
   ("9" "M-9"))

Would I have to define a separate function for each instance of digit-argument? Lambdas don't seem to work

@trev-dev The code you posted works for me. Are you using the latest version from MELPA?

commented

@trev-dev The code you posted works for me. Are you using the latest version from MELPA?

At the time I was! When I get a change to play with RYO again I will let you know if it works.