[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 03771f4 01/18: hydra.el: Turn on lexical-binding
From: |
Oleh Krehel |
Subject: |
[elpa] master 03771f4 01/18: hydra.el: Turn on lexical-binding |
Date: |
Sat, 28 Mar 2015 15:04:22 +0000 |
branch: master
commit 03771f4225738487232fa3eaf34a966c30b1fe0f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra.el: Turn on lexical-binding
* hydra.el (hydra-set-transient-map): Fix warning.
(hydra--head-color): Fix warning.
(hydra--hint): Update signature.
(hydra--format): Update.
(hydra--matrix): Fix warning.
(defhydra): Fix warning.
(defhydradio): Fix warning.
---
hydra.el | 57 +++++++++++++++++++++++++++------------------------------
1 files changed, 27 insertions(+), 30 deletions(-)
diff --git a/hydra.el b/hydra.el
index a3e8b9b..17948ec 100644
--- a/hydra.el
+++ b/hydra.el
@@ -1,11 +1,11 @@
-;;; hydra.el --- Make bindings that stick around
+;;; hydra.el --- Make bindings that stick around. -*- lexical-binding: t -*-
;; Copyright (C) 2015 Free Software Foundation, Inc.
;; Author: Oleh Krehel <address@hidden>
;; Maintainer: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/hydra
-;; Version: 0.11.0
+;; Version: 0.12.0
;; Keywords: bindings
;; Package-Requires: ((cl-lib "0.5"))
@@ -82,7 +82,7 @@
(defalias 'hydra-set-transient-map
(if (fboundp 'set-transient-map)
'set-transient-map
- (lambda (map keep-pred &optional on-exit)
+ (lambda (map _keep-pred &optional on-exit)
(with-no-warnings
(set-temporary-overlay-map map (hydra--pred on-exit))))))
@@ -321,26 +321,25 @@ Return DEFAULT if PROP is not in H."
'blue))
(t
(error "Unknown :exit %S" exit)))))
- (let ((body-exit (plist-get (cddr body) :exit)))
- (cond ((null (cadr h))
- (when head-color
- (hydra--complain
- "Doubly specified blue head - nil cmd is already blue: %S" h))
- 'blue)
- ((null head-color)
- (hydra--body-color body))
- ((null foreign-keys)
- head-color)
- ((eq foreign-keys 'run)
- (if (eq head-color 'red)
- 'pink
- 'blue))
- ((eq foreign-keys 'warn)
- (if (memq head-color '(red amaranth))
- 'amaranth
- 'teal))
- (t
- (error "Unexpected %S %S" h body))))))
+ (cond ((null (cadr h))
+ (when head-color
+ (hydra--complain
+ "Doubly specified blue head - nil cmd is already blue: %S" h))
+ 'blue)
+ ((null head-color)
+ (hydra--body-color body))
+ ((null foreign-keys)
+ head-color)
+ ((eq foreign-keys 'run)
+ (if (eq head-color 'red)
+ 'pink
+ 'blue))
+ ((eq foreign-keys 'warn)
+ (if (memq head-color '(red amaranth))
+ 'amaranth
+ 'teal))
+ (t
+ (error "Unexpected %S %S" h body)))))
(defun hydra--body-foreign-keys (body)
"Return what BODY does with a non-head binding."
@@ -420,9 +419,9 @@ Otherwise, add PREFIX to the symbol name."
sym
(intern (concat prefix "/" str)))))
-(defun hydra--hint (name body docstring heads)
+(defun hydra--hint (body heads)
"Generate a hint for the echo area.
-NAME, BODY, DOCSTRING and HEADS are parameters to `defhydra'."
+BODY, and HEADS are parameters to `defhydra'."
(let (alist)
(dolist (h heads)
(let ((val (assoc (cadr h) alist))
@@ -473,8 +472,7 @@ HEAD's binding is returned as a string wrapped with [] or
{}."
NAME, BODY, DOCSTRING and HEADS are parameters of `defhydra'.
The expressions can be auto-expanded according to NAME."
(setq docstring (replace-regexp-in-string "\\^" "" docstring))
- (let ((rest (hydra--hint name body docstring heads))
- (body-color (hydra--body-color body))
+ (let ((rest (hydra--hint body heads))
(prefix (symbol-name name))
(start 0)
varlist
@@ -726,7 +724,7 @@ In duplicate HEADS, :cmd-name is modified to whatever they
duplicate."
The matrix size is ROWS times COLS."
(let ((ls (copy-sequence lst))
res)
- (dotimes (c cols)
+ (dotimes (_c cols)
(push (hydra--pad (hydra-multipop ls rows) rows) res))
(nreverse res)))
@@ -881,7 +879,6 @@ result of `defhydra'."
(let ((keymap (copy-keymap hydra-base-map))
(body-name (intern (format "%S/body" name)))
(body-key (cadr body))
- (body-color (hydra--body-color body))
(body-pre (plist-get (cddr body) :pre))
(body-body-pre (plist-get (cddr body) :body-pre))
(body-post (plist-get (cddr body) :post))
@@ -972,7 +969,7 @@ result of `defhydra'."
(or body-body-pre body-pre) body-post
'(setq prefix-arg current-prefix-arg))))))
-(defmacro defhydradio (name body &rest heads)
+(defmacro defhydradio (name _body &rest heads)
"Create radios with prefix NAME.
BODY specifies the options; there are none currently.
HEADS have the format:
- [elpa] master updated (059c3d5 -> da45e68), Oleh Krehel, 2015/03/28
- [elpa] master 84f4fe7 06/18: Don't default `hydra-repeat--prefix-arg' to 1, Oleh Krehel, 2015/03/28
- [elpa] master 6c6fc0b 07/18: Allow `hydra-repeat' to take a numeric arg, Oleh Krehel, 2015/03/28
- [elpa] master 87e4574 05/18: Mention the leading newline in `defhydra' docstring, Oleh Krehel, 2015/03/28
- [elpa] master 71491b9 04/18: Fix argument to `replace-match', Oleh Krehel, 2015/03/28
- [elpa] master f6697f3 02/18: Allow for the "%s`foo" spec., Oleh Krehel, 2015/03/28
- [elpa] master 5c3ab46 08/18: hydra.el (hydra--format): Amend regex, Oleh Krehel, 2015/03/28
- [elpa] master 1bad0c4 09/18: hydra.el (hydra--format): Update regex order, Oleh Krehel, 2015/03/28
- [elpa] master 03771f4 01/18: hydra.el: Turn on lexical-binding,
Oleh Krehel <=
- [elpa] master fe1cfee 10/18: hydra-examples.el (hydra-rectangle): Update, Oleh Krehel, 2015/03/28
- [elpa] master c8c6b8c 03/18: Fix blue/red heads with same cmd, Oleh Krehel, 2015/03/28
- [elpa] master 1290237 12/18: Disable key-chord for the duration of the hydra, Oleh Krehel, 2015/03/28
- [elpa] master cb4b78a 11/18: hydra-test.el (hydra-format-4): Add test, Oleh Krehel, 2015/03/28
- [elpa] master 640af46 13/18: hydra.el (defhydra): Improve docstring, Oleh Krehel, 2015/03/28
- [elpa] master 7843563 14/18: hydra.el (hydra--make-funcall): Add, Oleh Krehel, 2015/03/28
- [elpa] master e403363 16/18: hydra.el (defhydra): Avoid eager macroexpansion failure, Oleh Krehel, 2015/03/28
- [elpa] master 5032ec7 15/18: hydra.el (defhydra): Simplify and improve the key binding code, Oleh Krehel, 2015/03/28
- [elpa] master 4a6a31d 17/18: hydra.el: Bump version, Oleh Krehel, 2015/03/28
- [elpa] master da45e68 18/18: Merge commit '4a6a31d6d4d479720f4b66091892b0cda2377346' from hydra, Oleh Krehel, 2015/03/28