abo-abo / hydra

make Emacs bindings that stick around
1.85k stars 113 forks source link

In tty, the help window never closes #144

Open yangchenyun opened 9 years ago

yangchenyun commented 9 years ago

The window will always be there no matter no matter what key I press.

screen shot 2015-07-17 at 10 53 22 pm

I could provide more debug info if you point me to the right place to look at.

$ emacs --version
GNU Emacs 25.0.50.1
Copyright (C) 2014 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
abo-abo commented 9 years ago

Show me the code of defhydra. Then explain how you get the bug in steps, from the Emacs start. I'm guessing you did emacs -nw, then info, then ...

yangchenyun commented 9 years ago

Hi Oleh, I did more test, it seems to only occur in a daemon/client mode. emacs --daemon & emacsclient -t

Then, bring up the `M-x info', try couple times with hydra then the window will become sticky.

screen shot 2015-07-18 at 12 38 00 am
(defhydra hydra-info (:color blue :hint nil :idle 0.4)
        "

╭────────────┐
    Nav Files             Navi Nodes          Action              │
Info-mode  │

╭───────────────────────────────────────────────────────────────┴────────────╯
    [_?_] summary       [_[_] forward          [_g_] goto node
    [_<_] top node      [_]_] backward         [_s_] search
    [_>_] final node    [_f_] follow ref       [_S_] case-search
    [_d_] info dir      [_l_] hist back        [_m_] menu
    [_i_] index         [_r_] hist forward     [_h_] help
    [_I_] virtual index [_n_] next             [_t_] info-to
    [_L_] hist          [_p_] previous
    [_T_] TOC           [_u_] up
        "
        ("?" Info-summary)
        ("]" Info-forward-node)
        ("[" Info-backward-node)
        ("<" Info-top-node)
        (">" Info-final-node)
        ;; ("b" beginning-of-buffer)
        ;; ("e" end-of-buffer)
        ("h" Info-help)
        ("d" Info-directory)
        ("f" Info-follow-reference)
        ("g" Info-goto-node)
        ("l" Info-history-back)
        ("r" Info-history-forward)
        ("i" Info-index)
        ("I" Info-virtual-index)
        ("L" Info-history)
        ("n" Info-next)
        ("p" Info-prev)
        ("s" Info-search)
        ("S" Info-search-case-sensitively)
        ("T" Info-toc)
        ("u" Info-up)
        ("m" Info-menu)
        ("t" hydra-info-to/body))
abo-abo commented 9 years ago

emacs --daemon & emacsclient -t Then, bring up the `M-x info', try couple times with hydra then the window will become sticky.

I can't reproduce this on Linux. If you have access to Linux, try to reproduce it there - it might be an OSX specific bug.

yangchenyun commented 9 years ago

I reproduced it on both linux / mac. I recorded a screen session: https://drive.google.com/file/d/0B3PWs5iiwLQjV3dFRHJhS0tSdmc/view?usp=sharing

yangchenyun commented 9 years ago

The sticky part is now a window (I cannot move cursor there), it seems just a "occupied" portion of the whole frame. New hydra dialog will open up a new window, see below (only the first half is interactive).

screen shot 2015-07-20 at 12 01 38 pm

yangchenyun commented 9 years ago

I also tested on the emacs with GUI on ubuntu, the issue is the same and actually the some hydra definition doesn't even work. (like the snippet I copied from wiki, hydra-org-clock/body)

the Message buffer contains some error message from hydra:

hydra-disable: Invalid function: remove-function Composing main Info directory...done hydra-disable: Invalid function: remove-function

yveszoundi commented 8 years ago

I pretty much encounter the same issue. The menu remains sticky. Note: I only use emacs in the terminal, within tmux sessions, via emacsclient.

Screenshot

I'm calling a function to compose an email in org-mode via an hydra (later on org-mime-org-buffer-htmlize would be called within the buffer).

hydra-menu-issues

Environment

Relevant configuration

(define-key global-map (kbd "C-h M-o")
         (defhydra hydra-org-rimero (:color pink :hint nil)
        "
     ^Main^             ^Rimero^
     ^^^^^^^^------------------------------
     _c_: Capture       _n_: Notes
     _a_: Agenda        _b_: Bills
     _e_: Email         _i_: Inbox
     ^ ^                _A_: Accounting
     ^ ^                _l_: Links
     "
        ("c" org-capture)
        ("a" org-agenda)
        ("e" ers-org-email)
        ("n" (find-file org-ers-notes-file))
        ("b" (find-file org-ers-bills-file))
        ("i" (find-file org-ers-inbox-file))
        ("A" (find-file org-ers-accounting-file))
        ("l" (find-file org-ers-links-file))
        ("q" nil)))

Steps

Expectations

yveszoundi commented 8 years ago

@yangchenyun , @abo-abo , it seems that adding :exit t to the hydra definition fixes it. @yangchenyun can you give it a shot?

Everything works as expected after updating my hydra definition to use :exit t.

(defhydra hydra-org-rimero (:exit t :color pink :hint nil)
        "
     ^Main^             ^Rimero^
     ^^^^^^^^------------------------------
     _c_: Capture       _n_: Notes
     _a_: Agenda        _b_: Bills
     _e_: Email         _i_: Inbox
     ^ ^                _A_: Accounting
     ^ ^                _l_: Links
     "
        ("c" org-capture)
        ("a" org-agenda)
        ("e" ers-org-email)
        ("n" (find-file org-ers-notes-file))
        ("b" (find-file org-ers-bills-file))
        ("i" (find-file org-ers-inbox-file))
        ("A" (find-file org-ers-accounting-file))
        ("l" (find-file org-ers-links-file))
        ("q" nil))
abo-abo commented 8 years ago

@yveszoundi I was just about to reply, but you fould your issue. Swapping pink for teal would also work.

yangchenyun commented 8 years ago

@yveszoundi Thanks, I am giving it a shot and will verify it later.