diff options
Diffstat (limited to '.emacs.d/site-lisp')
-rw-r--r-- | .emacs.d/site-lisp/transient-cycles.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/.emacs.d/site-lisp/transient-cycles.el b/.emacs.d/site-lisp/transient-cycles.el index 083a5338..e8580fb7 100644 --- a/.emacs.d/site-lisp/transient-cycles.el +++ b/.emacs.d/site-lisp/transient-cycles.el @@ -492,17 +492,19 @@ take you back there." recent-buffer)) :keymap transient-cycles-window-buffers-mode-map :cycle-forwards-key transient-cycles-window-buffers-cycle-forwards-key - :cycle-backwards-key transient-cycles-window-buffers-cycle-backwards-key) + :cycle-backwards-key transient-cycles-window-buffers-cycle-backwards-key)) - (defun transient-cycles--reset-window-recent-buffer (&rest _ignore) - (setq param nil)) +(defun transient-cycles--reset-window-recent-buffer (&rest _ignore) + (set-window-parameter nil 'transient-cycles--window-recent-bufer nil)) - (defun transient-cycles-window-buffers-back-and-forth () - "Switch to the buffer most recently accessed using the bindings +(defun transient-cycles-window-buffers-back-and-forth () + "Switch to the buffer most recently accessed using the bindings established by `transient-cycles-window-buffers-mode', on the condition that no other commands have set this window's buffer since then. Otherwise, call `previous-buffer'." - (interactive) + (interactive) + (cl-symbol-macrolet + ((param (window-parameter nil 'transient-cycles--window-recent-bufer))) (cond (param (let ((new (and (window-next-buffers) (* -1 param)))) (cond ((cl-plusp param) (next-buffer param)) |