Pale-Journalist-779 · 2022-04-20 12:17
Hey. I'm in process of creating a package, and I'm stuck with one problem.
When turn on minor mode my package create new window with buffer, and I want to close it by "esc" key in any part of emacs and by \`\`\`"q" in this new created window. How does it possible to do this ?
FrozenOnPluto · 2022-04-20 12:40
I know nothing but you could perhaps .. find out what esc is doing now, then advice it to trigger a callback of your own code that kills your window?
Are you sire you want a global key takeover though even when your window is not front/active? That may confuse people, or screw up their pre-existing bindings?
Pale-Journalist-779 · 2022-04-20 13:29
I try to make the same behavior as in "flycheck-list-errors".
I think they do it globally, except when you are in edit mode (if you use evil)
ieure · 2022-04-20 15:58
Minor mode keymaps override the major/global mode ones. So if you're already turning on a global minor mode, bind `ESC` in its keymap to a function that dismisses the window and turns your minor mode off.
If your minor mode isn't global, you'll either need to make it global, or create a second minor mode which is, just for the ESC binding.