This is rather a Common Lisp beginner’s question. Not sure if it’s okay to ask this here:
I’m trying to query the CUA keybindings of the document mode via swank.
I don’t know how to get the document-mode
(instance) directly, but I can list all modes of the current buffer:
(modes (current-buffer))
I see that document-mode is the seventh in this case, so I tried:
NYXT-USER> (keyscheme-map (seventh (modes (current-buffer))))
#<HASH-TABLE :TEST EQUAL :COUNT 4 {1006341723}>
Using this function, I can list all keys of the hash table:
(defun hash-keys (hash-table)
(loop for key being the hash-keys of hash-table collect key))
NYXT-USER> (hash-keys (keyscheme-map (seventh (modes (current-buffer)))))
(#<NKEYMAPS/CORE:KEYSCHEME default {1001250413}>
#<NKEYMAPS/CORE:KEYSCHEME cua {1001250473}>
#<NKEYMAPS/CORE:KEYSCHEME emacs {1001250363}>
#<NKEYMAPS/CORE:KEYSCHEME vi-normal {1001250323}>)
When I try to get the cua value, I always get nil:
NYXT-USER> (gethash 'cua (keyscheme-map (seventh (modes (current-buffer)))))
NIL
NIL
I also tried cua
, :cua
, "cua"
, keyscheme:cua
, nkeymaps/core/keyscheme:cua
.
Any hints what I’m doing wrong?