Skip to content

Commit

Permalink
Don't clutter Echo Area
Browse files Browse the repository at this point in the history
* lv.el (lv-wnd): New variable.
(lv-window): New defun to get a window similar in properties to Echo Area.
(lv-message): New defun, a replacement for `message', that writes to `lv-window'.

* hydra.el (hydra-lv): New defcustom. If nil, use the Echo Area,
  otherwise, use LV.
(hydra-disable): Add optional arg KILL-LV.
(hydra--message): New defun to dispatch on `hydra-lv'.
(hydra--make-defun): Prematurely disable with LV only for blue heads,
since regenerating LV window would cause screen tearing. No need for
timeouts between `message' when using LV.  HINT argument is now a
function symbol that returns a string, instead of a plain string.
(defhydra): Generate a new defun with name `NAME/hint'.

* Makefile: Load lv.

* hydra-test.el: Update all tests.

* README.md: Update.
  • Loading branch information
abo-abo committed Feb 17, 2015
1 parent 06b35f7 commit 806e04b
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 331 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EMACS = emacs
# EMACS = emacs-24.3

LOAD = -l hydra.el -l hydra-test.el
LOAD = -l lv.el -l hydra.el -l hydra-test.el

.PHONY: all test clean

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,14 @@ to a head. This sexp will be wrapped in an interactive lambda. Here's an example
("q" nil "cancel"))
(global-set-key (kbd "C-c r") 'hydra-launcher/body)
```

## Define Hydra heads that don't show up in the hint at all

This can be done by setting the head's hint explicitly to `nil`, instead of the usual string.

## Use a dedicated window for Hydra hints

Since version `0.10.0`, setting `hydra-lv` to `t` (the default setting) will make it use a dedicated
window right above the Echo Area for hints. This has the advantage that you can immediately see
any `message` output from the functions that you call, since Hydra no longer uses `message` to display
the hint. You can still have the old behavior by setting `hydra-lv` to `nil`.
Loading

2 comments on commit 806e04b

@kaushalmodi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does lv stand for?

@abo-abo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does lv stand for?

Nothing really, "lower view" if you like.

Please sign in to comment.