lispy
lispy copied to clipboard
Conflict with org-mode
Enabling lispy-mode inside orgmode buffers causes some minor issues because both org and lispy implementations redefine many common keys from self-insert to their own versions to hook into it.
This causes org-use-speed-commands to not work anymore:
- Enable org-use-speed-commands using customize
- Open .org file
- Enable lispy-mode
- Go to beginning of headline "* foo"
- Press n/p to move to next/prev headline - nothing happens
Also editing in tables is broken:
- In org mode buffer create a small table
- Enable lispy-mode
- Move to prev/next field using tab
- Start editing. Without lispy-mode the table cell gets overwritten by the first key stroke. When lispy-mode is enabled this does not happen anymore.
A possible fix might be to look up the binding of the given key w/o lispy-mode-map in lispy--insert-or-call like this (not tested, this is a sketch)
(let ((lispy-mode nil))
(key-binding (this-single-command-keys t))
Why are you using it in org-mode? I can't imagine how this could be useful.
Mostly inside code blocks for quick edits. I agree that this is somewhat of a fringe use case, though. [edit: and I totally understand if this will be a no-fix. Just wanted to make sure to document the issue and its source]
You're aware of org-edit-special, right? I use it all the time.
It will give you the source buffer already in appropriate LISP mode with lispy on.
I actually think there could be a good use case for this, where the handler in lispy--eval is selected based on the source block you are in. Feels more ergonomic than reaching for org-edit-special, when ideally you want to stay in the org file.
@joshcho Sounds like a useful feature. But I think the place to ask for it is either in org-mode or even better in Emacs core. This should be solved by multiple major modes support per file.