Helm-SLY: Customize connection/buffer display formatting.

master
Pierre Neidhardt 2021-01-13 11:53:03 +01:00
parent a07348b511
commit b884f0d613
1 changed files with 11 additions and 0 deletions

View File

@ -76,6 +76,17 @@ If REFRESH is non-nil, rebuild the environment."
(define-key sly-mrepl-mode-map (kbd "C-c C-x c") 'helm-sly-list-connections)))
(when (require 'helm-sly nil :noerror)
(defun ambrevar/helm-sly-format-connection (connection buffer)
(let ((fstring "%s%2s %s"))
(format fstring
(if (eq sly-default-connection connection)
"*"
" ")
(helm-sly-connection-number connection)
(replace-regexp-in-string
"*$" ""
(replace-regexp-in-string "*sly-mrepl for " "" (buffer-name buffer))))))
(setq helm-sly-connection-formatter #'ambrevar/helm-sly-format-connection)
(global-helm-sly-mode)
(add-to-list 'helm-source-names-using-follow "Lisp xrefs"))