Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; What I want to write:
- ; (the-general-keybinds "h" "Help"
- ; (
- ; ("h" helpful-at-point "at point")
- ; )
- ; )
- ; What I want to generate:
- ; (mmap
- ; :prefix "SPC"
- ; "h" '(:ignore t :which-key "Help")
- ; "hh" '(helpful-at-point :which-key "at point"))
- ; Given a list l like ("h" helpful-at-point "at point")
- ; I want to write (the--general-binding-form "h" "h" 'helpful-at-point "at point)
- ; via (apply 'the--general-binding-form (cons "h" l)) and have it generate
- ; "hh" '(helpful-at-point :which-key "at point")
- ; This doesn't work
- (defun the--general-binding-form (prefix key fn desc)
- `(,(s-concat prefix) '(,fn :which-key ,desc)))
- ; it generates ("hh" '(helpful-at-point :which-key "at point"))
- ; Is there a sensible way to omit the extra parens around the output?
- ; For the whole expression, I have this:
- (defun the--general-bindings-form (prefix category bindings)
- `(mmap
- :prefix "SPC"
- ,prefix '(:ignore t :which-key ,category)
- ; something goes here, but I can't seem to get it right
- ))
- ; I'm not sure what I can put in the blank spot to iterate through the list of bindings and
- ; apply the--general-binding-form. I tried dolist, but no dice (and it's quite possible I
- ; was just using it wrong
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement