about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-03-12 12:53:39 -0600
committerCase Duckworth2021-03-12 12:53:57 -0600
commit49c282f301911fd37451d34170472b63bf21650b (patch)
tree3be1e2b8703e8917600ded7f6a77d7432bf46d58
parentChange `add-hook' to `acdw/hooks' (diff)
downloademacs-49c282f301911fd37451d34170472b63bf21650b.tar.gz
emacs-49c282f301911fd37451d34170472b63bf21650b.zip
Add `acdw/binds' to bind more than one key at once
I should probably change `acdw/bind-after-map' to use this macro...
-rw-r--r--init.el8
-rw-r--r--lisp/acdw.el8
2 files changed, 13 insertions, 3 deletions
diff --git a/init.el b/init.el index ee57b11..3466c12 100644 --- a/init.el +++ b/init.el
@@ -151,9 +151,11 @@
151 (scroll-preserve-screen-position 1))) 151 (scroll-preserve-screen-position 1)))
152 152
153;; Bindings 153;; Bindings
154(acdw/bind "C-h" ehelp-command :after ("ehelp" nil nil 'keymap)) 154(acdw/binds (("C-h" ehelp-command :after ("ehelp" nil nil 'keymap))
155(acdw/bind [remap just-one-space] cycle-spacing) 155 ([remap just-one-space] cycle-spacing)
156(acdw/bind "M-/" hippie-expand) 156 ("M-/" hippie-expand)
157 ("M-=" count-words)
158 ("C-x C-b" ibuffer)))
157 159
158;;; Startup 160;;; Startup
159(acdw/set `((inhibit-startup-screen t) 161(acdw/set `((inhibit-startup-screen t)
diff --git a/lisp/acdw.el b/lisp/acdw.el index 3ae480d..c9a2d9f 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -205,6 +205,14 @@ The following keywords are recognized:
205 `(progn 205 `(progn
206 ,@command-list))) 206 ,@command-list)))
207 207
208(defmacro acdw/binds (bindings)
209 "Bind multiple keys at once."
210 (let (bind-list)
211 (dolist (bind bindings)
212 (push `(acdw/bind ,@bind) bind-list))
213 `(progn
214 ,@bind-list)))
215
208;; convenience 216;; convenience
209(defmacro acdw/bind-after-map (file keymap bindings) 217(defmacro acdw/bind-after-map (file keymap bindings)
210 "Wrap multiple calls of `acdw/bind' after FILE and with KEYMAP. 218 "Wrap multiple calls of `acdw/bind' after FILE and with KEYMAP.