I like the way org-capture
works, it promotes a buffer for selecting
predefined templates. I am trying to do something similar for setting
variables.
For example, I have three HTML themes, one for office, one general
use, and one for journal. I am trying to define a
choose-html-themes()
function which has similar behaviour.
I defined a list of options,
(setq html-themes-list
'((Office . "<link rel=\"stylesheet\" ..... " )
(General . "<link rel=\"stylesheet\" ..... ")
(Journal . "<link rel=\"stylesheet\" ..... "))
When I call choose-html-themes
function, then type
- "o" to set the /entry/ variable to "Office"
- "g" to "General"
- "j" to "Journal".
Then it will look up the list using entry as key, and set the org-html-head variable to the returning value, something like
(setq org-html-head (assoc entry html-themes-list))
I wonder how to popup a buffer, and capture keyboard input from that buffer?
hydra
package to do something similar? – Kaushal Modi Aug 8 '15 at 2:33hydra
, it can solve the problem, butcomplting-read
is more elegant for this case. Thanks. – yi.tang.uni Aug 10 '15 at 8:19