Fixes#9, this is also what guide-key uses.
When quoting functions, using "#'" tells the compiler that you're
quoting a function, and allows it to catch void function errors.
Summary of changes:
- add emacs 24.3 as a dependency, because
`display-buffer-in-major-side-window` doesn't exist in older emacsen
- add option to show which-key buffer in a popup frame
`(setq which-key-popup-type 'frame)`
- stop close timer when disabling which-key-mode
- don't hide which-key buffer before showing it. instead, show methods
handle the case that the buffer is already shown
- `which-key/hide-popup` calls function depending on popup
type (similar to `which-key/show-popup`)
- use `display-buffer-in-major-side-window` instead of
`display-buffer-in-side-window`, for popup type side-window. ensures
new side window is created properly even if other side windows already
exist.
- erase previous contents of which-key buffer before inserting new
contents, and adjust buffer display in window by moving point to
the buffer's beginning
The primary config variable is now which-key-popup-type, which
supports 'minibuffer and 'side-window. 'side-window has further
associated options, primarily which-key-side-window-location
Wanted to add support for using display-buffer or popwin, ran into some
bugs, had to make changes to the code so future work will be easier.
Details below:
- separate between code to display window and code to populate buffer
contents
- add `which-key-horizontal-buffer-height` similar to
`which-key-vertical-buffer-width`
- abstract handling of different display methods into
`which-key/show-buffer` and `which-key/hide-buffer`, instead of mixed
in other functions
- remove `which-key/make-display-method-aliases`
- support two display methods: `minibuffer` and `side-window`, will add
popwin later
- create start/stop functions for which-key--close-timer
- a few other changes
There are a lot of changes here.
1. Reorganized and factored a bunch of code.
2. Rewrote the logic to calculate line breaks (much cleaner).
3. Switched to using the minibuffer by default, which seems more
foolproof and saves line space (I'm sure there's something wrong with
this).