From 8e1fdb293989f570478c647b046d085183aba5ab Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 2 Apr 2021 14:24:18 -0700 Subject: move Sly config --- .emacs.d/init-spw.el | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index 49c3c6e6..20479f21 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -533,35 +533,6 @@ I use by default)." (slot . 0) (side . bottom)))) -;; WIP Sly config; see FLOSS.org - -(when (file-directory-p (expand-file-name "~/src/sly")) - (add-to-list 'load-path (expand-file-name "~/src/sly")) - (load "sly.el")) - -(with-eval-after-load 'sly - ;; restore SLIME's a/q debugger keys - (define-key sly-db-mode-map "q" #'sly-db-quit) - (define-key sly-db-mode-map "Q" nil) - - ;; have C-c C-z obey `display-buffer-alist' - ;; https://github.com/joaotavora/sly/issues/428 - (defun spw/sly-mrepl () - (interactive) - (sly-mrepl #'pop-to-buffer)) - (define-key sly-mode-map "\C-c\C-z" #'spw/sly-mrepl) - - (defun spw/sly-db-show-first-line () - (unless (pos-visible-in-window-p (point-min)) - (goto-char (point-min)))) - (add-hook 'sly-db-hook #'spw/sly-db-show-first-line) - - ;; C-r should always search buffer text - ;; (define-key sly-mrepl-mode-map "\M-r" #'comint-history-isearch-backward) - (defun spw/reset-comint-history-isearch () - (setq-local comint-history-isearch nil)) - (add-hook 'sly-mrepl-hook #'spw/reset-comint-history-isearch)) - ;; C-c s would be another option (global-set-key [f9] #'window-toggle-side-windows) @@ -2743,6 +2714,29 @@ mutt's review view, after exiting EDITOR." (defslime-repl-shortcut nil ("clear-source-registry") (:handler #'spw/slime-clear-source-registry))) +(with-eval-after-load 'sly + ;; restore SLIME's a/q debugger keys + (define-key sly-db-mode-map "q" #'sly-db-quit) + (define-key sly-db-mode-map "Q" nil) + + ;; have C-c C-z obey `display-buffer-alist' + ;; https://github.com/joaotavora/sly/issues/428 + (defun spw/sly-mrepl () + (interactive) + (sly-mrepl #'pop-to-buffer)) + (define-key sly-mode-map "\C-c\C-z" #'spw/sly-mrepl) + + (defun spw/sly-db-show-first-line () + (unless (pos-visible-in-window-p (point-min)) + (goto-char (point-min)))) + (add-hook 'sly-db-hook #'spw/sly-db-show-first-line) + + ;; C-r should always search buffer text + ;; (define-key sly-mrepl-mode-map "\M-r" #'comint-history-isearch-backward) + (defun spw/reset-comint-history-isearch () + (setq-local comint-history-isearch nil)) + (add-hook 'sly-mrepl-hook #'spw/reset-comint-history-isearch)) + ;;;; Text mode -- cgit v1.2.3