From 8e1c317077e27d90380bc2f718a793511bfd02a4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Aug 2020 14:31:07 -0700 Subject: use cl-defmacro's default values --- .emacs.d/init-spw.el | 13 +++++++++---- 1 file 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) -- cgit v1.2.3