Closed ianyepan closed 3 years ago
;; Won't work (eaf-bind-key zoom-out "C--" eaf-pdf-viewer-keybinding) (eaf-bind-key zoom-in "C-=" eaf-pdf-viewer-keybinding) (eaf-bind-key zoom-reset "C-0" eaf-pdf-viewer-keybinding) ;; Works (eaf-bind-key scroll_up "C-d" eaf-pdf-viewer-keybinding) (eaf-bind-key scroll_up "d" eaf-pdf-viewer-keybinding) (eaf-bind-key scroll_down "C-u" eaf-pdf-viewer-keybinding) (eaf-bind-key scroll_down "u" eaf-pdf-viewer-keybinding)
Have a closer look, you need zoom_out
/zoom_in
/zoom_reset
instead of zoom-out
/zoom-in
/zoom-reset
. I see you were checking out M-EMACS
the other day, you can have a look at its EAF section.
This is because they're Python function bindings, you shouldn't use the Elisp function naming conventions, it was intentionally set this way so one can clearly differentiate Python functions from ELisp functions.
Maybe, maybe we should give an option to internally convert -
to _
, to avoid further confusion.
you need zoom_out/zoom_in/zoom_reset instead of zoom-out/zoom-in/zoom-reset
Oh man, of course! How did I miss that typo (😅)
Thanks, changing "-" to "_" completely fixed it!
Describe the bug Binding keys for zoom/in/out/reset won't work, while binding keys for scrolling up/down works flawlessly.
To Reproduce Use the following snippet to reproduce:
Expected behavior I expect binding keys for zooming in/out/reset to work.
Versions (please complete the following info):
Additional context These are the first couple of lines of the variable "eaf-pdf-viewer-keybinding". Note that the zoom in/out/reset that I personally bound does NOT have double quotes around them. This is perhaps the entry point to the bug.