diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-08-21 14:31:07 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-08-21 14:31:07 -0700 |
commit | 8e1c317077e27d90380bc2f718a793511bfd02a4 (patch) | |
tree | 2b16b6afaed4c77e4444f2f8389e860b72d94a7c | |
parent | b4925785dc5e10726b08b3d8c1af60aae0da4560 (diff) | |
download | dotfiles-8e1c317077e27d90380bc2f718a793511bfd02a4.tar.gz |
use cl-defmacro's default values
-rw-r--r-- | .emacs.d/init-spw.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index 08155f77..e27b2b59 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -80,14 +80,19 @@ add places the library might be available to `load-path'." (list bindings) bindings)))) -(cl-defmacro spw/buffer-ring-cycle-lambda (&optional ring action &key start) - `(when-let ((buffers ,(or ring '(spw/buffer-siblings-ring ret-val))) - (buffers-pos ,(or start 0))) +(cl-defmacro spw/buffer-ring-cycle-lambda + (&optional + (ring '(spw/buffer-siblings-ring ret-val)) + (action '(switch-to-buffer buffer nil t)) + &key + (start 0)) + `(when-let ((buffers ,ring) + (buffers-pos ,start)) (lambda (count) (interactive "p") (setq buffers-pos (+ count buffers-pos)) (let ((buffer (ring-ref buffers buffers-pos))) - ,(or action '(switch-to-buffer buffer nil t)))))) + ,action)))) (defun spw/bind-command-with-cycling* (bindings generator &optional on-exit map) (dolist (binding bindings) |