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

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

[nongnu] elpa/idris-mode c84ed5a733 05/12: Remove idris-mode event hooks


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode c84ed5a733 05/12: Remove idris-mode event hooks on closing Idris connection
Date: Tue, 13 Dec 2022 05:59:07 -0500 (EST)

branch: elpa/idris-mode
commit c84ed5a733212949b25de95ac8a7173170ea4ccc
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Remove idris-mode event hooks on closing Idris connection
    
    Why:
    to allow change hooks after restart of Idris connection
---
 idris-commands.el | 5 +++++
 inferior-idris.el | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/idris-commands.el b/idris-commands.el
index fe5646bd5f..c068305808 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -940,6 +940,10 @@ type-correct, so loading will fail."
   (let ((bufs (list :connection :repl :proof-obligations :proof-shell 
:proof-script :log :info :notes :holes :tree-viewer)))
     (dolist (b bufs) (idris-kill-buffer b))))
 
+(defun idris-remove-event-hooks ()
+  "Remove Idris event hooks set after connection with Idris established."
+  (dolist (h idris-event-hooks) (remove-hook 'idris-event-hooks h)))
+
 (defun idris-pop-to-repl ()
   "Go to the REPL, if one is open."
   (interactive)
@@ -988,6 +992,7 @@ https://github.com/clojure-emacs/cider";
         (setq idris-loaded-region-overlay nil)))
     (idris-prover-end)
     (idris-kill-buffers)
+    (idris-remove-event-hooks)
     (setq idris-process-current-working-directory nil)
     (setq idris-protocol-version 0
           idris-protocol-version-minor 0)))
diff --git a/inferior-idris.el b/inferior-idris.el
index 8c2ae7b89c..6eaf1823db 100644
--- a/inferior-idris.el
+++ b/inferior-idris.el
@@ -270,7 +270,7 @@ directory variables.")
 (defvar idris-continuation-counter 1
   "Continuation serial number counter.")
 
-(defvar idris-event-hooks)
+(defvar idris-event-hooks '())
 
 (defun idris-dispatch-event (event process)
   (or (run-hook-with-args-until-success 'idris-event-hooks event)



reply via email to

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