]> code.delx.au - gnu-emacs-elpa/commitdiff
Add a work-around for pop-to-buffer / dedicated bug
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 28 Apr 2015 16:40:00 +0000 (18:40 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 28 Apr 2015 16:42:07 +0000 (18:42 +0200)
* hydra.el (hydra--work-around-dedicated): New defvar.
(hydra-keyboard-quit): Update.

Fixes #124
Fixes #119

hydra.el

index 45daf2f608abdc1abcb5e33d6dcc9dd7fe80156d..f94cdd4ac39a016f389e53285746027100ca5916 100644 (file)
--- a/hydra.el
+++ b/hydra.el
@@ -381,13 +381,18 @@ Return DEFAULT if PROP is not in H."
 (defvar hydra-message-timer (timer-create)
   "Timer for the hint.")
 
+(defvar hydra--work-around-dedicated t
+  "When non-nil, assume there's no bug in `pop-to-buffer'
+  selecting a dedicated window.")
+
 (defun hydra-keyboard-quit ()
   "Quitting function similar to `keyboard-quit'."
   (interactive)
   (hydra-disable)
   (cancel-timer hydra-timeout-timer)
   (cancel-timer hydra-message-timer)
-  (unless hydra--ignore
+  (unless (and hydra--ignore
+               (null hydra--work-around-dedicated))
    (if hydra-lv
        (lv-delete-window)
      (message "")))