diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el index db55360e..8941ef52 100644 --- a/.emacs.d/lisp/init-exwm.el +++ b/.emacs.d/lisp/init-exwm.el @@ -124,6 +124,7 @@ KEYS is passed to `kbd'." (ambrevar/exwm-global-set-key "s-p" #'helm-pass)) (autoload 'ambrevar/slime-to-repl "lisp") +(autoload 'ambrevar/helm-selector-sly-non-ambrevar "init-sly") (ambrevar/exwm-global-set-key "s-" #'ambrevar/helm-selector-sly-non-ambrevar) ;; TODO: Apparently, S-s- is not recognized. (ambrevar/exwm-global-set-key "M-s-" #'ambrevar/helm-selector-sly-non-ambrevar-other-window) diff --git a/.emacs.d/lisp/init-sly-selector.el b/.emacs.d/lisp/init-sly-selector.el index 2a4469cc..ebeeb39f 100644 --- a/.emacs.d/lisp/init-sly-selector.el +++ b/.emacs.d/lisp/init-sly-selector.el @@ -84,13 +84,16 @@ :predicate #'ambrevar/helm-sly-buffer-non-ambrevar-p :make-buffer-fn (lambda () ; Copied from helm-selector-sly.el. (interactive) - (if (and (null sly-net-processes) - (< 1 (length sly-lisp-implementations))) + (let ((current-connection (car (sly--purge-connections)))) + (if (and current-connection + (sly-mrepl--find-buffer current-connection) + (ambrevar/helm-sly-buffer-non-ambrevar-p + (sly-mrepl--find-buffer current-connection))) + ;; Make sure to call interactively so that last + ;; connection is reused. + (call-interactively #'sly) (let ((current-prefix-arg '-)) - (call-interactively #'sly)) - ;; Make sure to call interactively so that last - ;; connection is reused. - (call-interactively #'sly))) + (call-interactively #'sly))))) :helm-sources #'ambrevar/helm-sly-mini-non-ambrevar)) (defun ambrevar/helm-selector-sly-non-ambrevar-other-window ()