emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/meow ba0cf4d160: Add shim for sly (#503)


From: ELPA Syncer
Subject: [nongnu] elpa/meow ba0cf4d160: Add shim for sly (#503)
Date: Sat, 16 Sep 2023 04:00:05 -0400 (EDT)

branch: elpa/meow
commit ba0cf4d1607971374351a68e48581d3ff4184c0e
Author: jgart <jgart@dismail.de>
Commit: GitHub <noreply@github.com>

    Add shim for sly (#503)
---
 meow-shims.el | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/meow-shims.el b/meow-shims.el
index 6bc7f83129..3d8a429032 100644
--- a/meow-shims.el
+++ b/meow-shims.el
@@ -231,6 +231,25 @@ Argument ENABLE non-nil means turn on."
       (add-hook 'cider--debug-mode-hook 'meow--cider-debug-hook-function)
     (remove-hook 'cider--debug-mode-hook 'meow--cider-debug-hook-function)))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; sly (db)
+
+(defvar meow--sly-setup nil)
+
+(defun meow--sly-debug-hook-function ()
+  "Switch meow state when entering/leaving sly-db-mode."
+  (if (bound-and-true-p sly-db-mode-hook)
+      (meow--switch-to-motion)
+    (meow--switch-to-motion)))
+
+(defun meow--setup-sly (enable)
+  "Setup sly.
+Argument ENABLE non-nil means turn on."
+  (setq meow--sly-setup enable)
+  (if enable
+      (add-hook 'sly-db-hook 'meow--sly-debug-hook-function)
+    (remove-hook 'sly-db-hook 'meow--sly-debug-hook-function)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; which-key
 
@@ -305,6 +324,7 @@ Argument ENABLE non-nil means turn on."
   (eval-after-load "company" (lambda () (meow--setup-company t)))
   (eval-after-load "polymode" (lambda () (meow--setup-polymode t)))
   (eval-after-load "cider" (lambda () (meow--setup-cider t)))
+  (eval-after-load "sly" (lambda () (meow--setup-sly t)))
   (eval-after-load "which-key" (lambda () (meow--setup-which-key t)))
   (eval-after-load "undo-tree" (lambda () (meow--setup-undo-tree t)))
   (eval-after-load "diff-hl" (lambda () (meow--setup-diff-hl t)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]