tj64/outshine

Conflicting bindings

Closed this issue · 3 comments

outshine works great, but it sets up bindings that completely mess up my environment.

Is there a way to selectively enable these bindings? For example, I use M- to move between windows (which outshine uses to move around the file).

I also found out that it breaks my TAB semantics, although it's hard to keep everyone happy. If I hit tab anywhere else than the end of the (non-empty) line, it always tries to do some folding, while I was instead hoping to do some line re-indenting or code completion.

tj64 commented

Hi, its hard to find bindings that please everyone. However, outshine should definitely not mess up your environment.

  1. I just pushed a commit changing defcustom 'outline-cycle-emulate-tab' to nil again as default value. Maybe that solves your TAB issues, if not - you can customize this variable via 'M-x customize-variable RET outline-cycle-emulate-tab'.

  2. Do you have the newest version of outshine? Not long ago I included a macro for conditional keybindings, that applies some (not all) outline navigation/visibility commands only when point is on a headline, but uses your usual command bound to that key-combination in all other places. "TAB", "M-RET", "M-", "M-", "C-c J", "C-c L" are defined with 'outshine-define-key-with-fallback', thus should not conflict with your bindings except when point is on a headline. Only "M-, "M- and "BACKTAB" are defined unconditionally, because they are useful everwhere in an outshine buffer.

  3. I'm surprised about your problems with M-, because I use M-1, M-2 etc too to move between windows, with no problems. So you probably use M- etc for window navigation, what conflicts with Org-mode's bindings too.

    "C-c I" 'outline-previous-visible-heading
    "C-c K" 'outline-next-visible-heading
    "C-c J" 'outline-hide-more
    "C-c L" 'outline-show-more
    

are alternative bindings for M- etc already defined. If you override the outshine M- bindings in your .emacs, you could use these for outshine and your own M- bindings for window navigation. Something like this (untested!) code should do the job:

(add-hook 'outshine-hook
      (lambda ()
        (define-key outline-minor-mode-map (kbd "M-<left>") nil)))

Hope that helps, let me know if it works or if there are remaining problems.

I updated to latest version and "TAB" works "as expected", and redefining the "M-" keys to nil maintains my previous bindings for window movement.

Thanks a lot!

tj64 commented

Glad I could help!