[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a71b76e 35/72: Intercept quit signals
From: |
Oleh Krehel |
Subject: |
[elpa] master a71b76e 35/72: Intercept quit signals |
Date: |
Fri, 06 Mar 2015 13:04:12 +0000 |
branch: master
commit a71b76e3852bbba90630c6005a70abe9a31bf7e6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Intercept quit signals
* hydra.el (hydra--format): Make keys wider.
(hydra--make-defun): Catch quit.
(hydra-pink-fallback): Catch quit.
* hydra-test.el: Update tests.
---
hydra-test.el | 30 +++++++++++++++---------------
hydra.el | 8 ++++----
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/hydra-test.el b/hydra-test.el
index 31519dc..7b3d24b 100644
--- a/hydra-test.el
+++ b/hydra-test.el
@@ -49,9 +49,9 @@ Call the head: `first-error'."
(hydra-disable)
(catch (quote hydra-disable)
(condition-case err (prog1 t (call-interactively (function
first-error)))
- (error (message "%S" err)
- (unless hydra-lv (sit-for 0.8))
- nil))
+ ((quit error) (message "%S" err)
+ (unless hydra-lv (sit-for 0.8))
+ nil))
(when hydra-is-helpful (hydra-error/hint))
(setq hydra-last
(hydra-set-transient-map
@@ -96,9 +96,9 @@ Call the head: `next-error'."
(hydra-disable)
(catch (quote hydra-disable)
(condition-case err (prog1 t (call-interactively (function
next-error)))
- (error (message "%S" err)
- (unless hydra-lv (sit-for 0.8))
- nil))
+ ((quit error) (message "%S" err)
+ (unless hydra-lv (sit-for 0.8))
+ nil))
(when hydra-is-helpful (hydra-error/hint))
(setq hydra-last
(hydra-set-transient-map
@@ -143,9 +143,9 @@ Call the head: `previous-error'."
(hydra-disable)
(catch (quote hydra-disable)
(condition-case err (prog1 t (call-interactively (function
previous-error)))
- (error (message "%S" err)
- (unless hydra-lv (sit-for 0.8))
- nil))
+ ((quit error) (message "%S" err)
+ (unless hydra-lv (sit-for 0.8))
+ nil))
(when hydra-is-helpful (hydra-error/hint))
(setq hydra-last
(hydra-set-transient-map
@@ -392,9 +392,9 @@ Call the head: `next-line'."
(hydra-disable)
(catch (quote hydra-disable)
(condition-case err (prog1 t (call-interactively (function
next-line)))
- (error (message "%S" err)
- (unless hydra-lv (sit-for 0.8))
- nil))
+ ((quit error) (message "%S" err)
+ (unless hydra-lv (sit-for 0.8))
+ nil))
(when hydra-is-helpful (hydra-vi/hint))
(setq hydra-last
(hydra-set-transient-map
@@ -450,9 +450,9 @@ Call the head: `previous-line'."
(hydra-disable)
(catch (quote hydra-disable)
(condition-case err (prog1 t (call-interactively (function
previous-line)))
- (error (message "%S" err)
- (unless hydra-lv (sit-for 0.8))
- nil))
+ ((quit error) (message "%S" err)
+ (unless hydra-lv (sit-for 0.8))
+ nil))
(when hydra-is-helpful (hydra-vi/hint))
(setq hydra-last
(hydra-set-transient-map
diff --git a/hydra.el b/hydra.el
index 1b23eaf..578d879 100644
--- a/hydra.el
+++ b/hydra.el
@@ -345,7 +345,7 @@ The expressions can be auto-expanded according to NAME."
varlist)
(while (setq start
(string-match
- "\\(?:%\\(
?-?[0-9]*\\)`\\([a-z-A-Z/0-9]+\\)\\)\\|\\(?:_\\([a-z-A-Z]+\\)_\\)"
+ "\\(?:%\\(
?-?[0-9]*\\)`\\([a-z-A-Z/0-9]+\\)\\)\\|\\(?:_\\([a-z-~A-Z]+\\)_\\)"
docstring start))
(if (eq ?_ (aref (match-string 0 docstring) 0))
(let* ((key (match-string 3 docstring))
@@ -353,7 +353,7 @@ The expressions can be auto-expanded according to NAME."
(if head
(progn
(push (propertize key 'face (hydra--face head body)) varlist)
- (setq docstring (replace-match "%s" nil nil docstring)))
+ (setq docstring (replace-match "% 3s" nil nil docstring)))
(error "Unrecognized key: _%s_" key)))
(push (hydra--unalias-var (match-string 2 docstring) prefix) varlist)
(setq docstring (replace-match (concat "%" (match-string 1 docstring)
"S") nil nil docstring 0))))
@@ -407,7 +407,7 @@ BODY-COLOR, BODY-PRE, BODY-POST, and OTHER-POST are used as
well."
`(condition-case err
(prog1 t
(call-interactively #',cmd))
- (error
+ ((quit error)
(message "%S" err)
(unless hydra-lv
(sit-for 0.8))
@@ -433,7 +433,7 @@ BODY-COLOR, BODY-PRE, BODY-POST, and OTHER-POST are used as
well."
(if (commandp kb)
(condition-case err
(call-interactively kb)
- (error
+ ((quit error)
(message "%S" err)
(unless hydra-lv
(sit-for 0.8))))
- [elpa] master 7010772 32/72: hydra.el (hydra--head-color): Improve, (continued)
- [elpa] master 7010772 32/72: hydra.el (hydra--head-color): Improve, Oleh Krehel, 2015/03/06
- [elpa] master d0e8d57 33/72: hydra.el (hydra-add-font-lock): Add `defhydradio', Oleh Krehel, 2015/03/06
- [elpa] master 0881733 28/72: hydra.el (defhydra): Fix typo, Oleh Krehel, 2015/03/06
- [elpa] master a4c4eb6 36/72: Add example for `Buffer-menu-mode', Oleh Krehel, 2015/03/06
- [elpa] master 88b32d5 24/72: hydra.el (hydra--hint): Add exception, Oleh Krehel, 2015/03/06
- [elpa] master c41c932 31/72: README.md: fix tables, Oleh Krehel, 2015/03/06
- [elpa] master 1eebfed 34/72: Allow `format'-style width specifiers in docstring, Oleh Krehel, 2015/03/06
- [elpa] master e962ff1 39/72: hydra.el: remove no :pre, :post restriction for Emacs<24.4, Oleh Krehel, 2015/03/06
- [elpa] master a6c6a55 38/72: Improve compatibility for Emacs <= 24.3, Oleh Krehel, 2015/03/06
- [elpa] master 2c01db0 42/72: hydra.el (hydra--handle-nonhead): Update signature, Oleh Krehel, 2015/03/06
- [elpa] master a71b76e 35/72: Intercept quit signals,
Oleh Krehel <=
- [elpa] master ae70e9a 41/72: Fix pink and teal Hydras running :post, Oleh Krehel, 2015/03/06
- [elpa] master 71d70f6 46/72: Add :body-pre switch, Oleh Krehel, 2015/03/06
- [elpa] master cb28124 44/72: Allow sexps in Ruby-style docstrings, Oleh Krehel, 2015/03/06
- [elpa] master ace99b3 51/72: hydra.el (hydra--make-defun): Update signature, Oleh Krehel, 2015/03/06
- [elpa] master efcffc0 45/72: hydra-examples.el: Add example 9, Oleh Krehel, 2015/03/06
- [elpa] master ef1f61d 40/72: hydra.el (hydra--handle-nonhead): Fix bug, Oleh Krehel, 2015/03/06
- [elpa] master 2eddb83 43/72: hydra-test.el (hydra-format): New test, Oleh Krehel, 2015/03/06
- [elpa] master 5242aad 48/72: Fix :exit t / :exit nil inheritance issue, Oleh Krehel, 2015/03/06
- [elpa] master 0f733d8 37/72: Add an option to fontify heads in a custom way, Oleh Krehel, 2015/03/06
- [elpa] master c413b5f 54/72: Allow for a custom key format spec in docstrings, Oleh Krehel, 2015/03/06