[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure e1a93c7 121/313: Add lock around REPL type det
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure e1a93c7 121/313: Add lock around REPL type detection |
Date: |
Wed, 11 Aug 2021 09:59:59 -0400 (EDT) |
branch: elpa/inf-clojure
commit e1a93c73a24dd35914642725d351010a0909aa41
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add lock around REPL type detection
The patch solves, maybe not in the best way, a couple of problems
detected when emacs triggers multiple process output filters. See
http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filter.html
---
inf-clojure.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index fe6aa7d..c8aa815 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -195,17 +195,23 @@ often connecting to a remote REPL process."
Its root binding is nil and it can be further customized using
either `setq-local` or an entry in `.dir-locals.el`." )
-(defun inf-clojure--detect-type (proc)
+(defvar inf-clojure--repl-type-lock nil
+ "Global lock for protecting against proc filter race conditions.
+See
http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filter.html")
+
+(defun inf-clojure--detect-repl-type (proc)
"Identifies the current REPL type for PROC."
- (cond
- ((inf-clojure--lumo-p proc) 'lumo)
- (t 'clojure)))
+ (when (not inf-clojure--repl-type-lock)
+ (let ((inf-clojure--repl-type-lock t))
+ (cond
+ ((inf-clojure--lumo-p proc) 'lumo)
+ (t 'clojure)))))
(defun inf-clojure--set-repl-type (proc)
"Set the REPL type if has not already been set.
It requires a REPL PROC for inspecting the correct type."
(if (not inf-clojure-repl-type)
- (setq inf-clojure-repl-type (inf-clojure--detect-type proc))
+ (setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc))
inf-clojure-repl-type))
(defun inf-clojure--send-string (proc string)
- [nongnu] elpa/inf-clojure bcd806a 251/313: Unify references to the term REPL, (continued)
- [nongnu] elpa/inf-clojure bcd806a 251/313: Unify references to the term REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a7f07a0 245/313: Set artificial to true on comint-send-input, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e291da3 274/313: Update README.md, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 787400f 264/313: [Fix #178] Ensure there is a directory for comint (thanks mcphailm), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6cb8e43 277/313: Update the CI images, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 477fd7c 272/313: Tweak some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a98a260 281/313: [#152] Add a changelog entry, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f4a279e 286/313: [Fix #177] Don't run the tests on Emacs 25, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b4193fc 289/313: Reindent tests, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f24722c 294/313: Extract useful functions, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e1a93c7 121/313: Add lock around REPL type detection,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 5ef6bdf 123/313: Revert "Remove unwanted ansi chars from the REPL output", ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7441d3b 120/313: Fix REPL type detection, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2669544 129/313: [Fix #63] Avoid spurious output by using buffer redirection, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0fbcfcb 140/313: Improve the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure db7bfaf 155/313: Fix the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 42f860f 169/313: Add Multiple Process Support section to README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3a93815 170/313: [Fix #105] Add planck-specific function for show-arglist (#106), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 204e5b7 114/313: Do some cleanup in preparation for a major release, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d81e266 116/313: [Fix #48] Stop prompting for the symbol at point by default (#51), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 431c068 127/313: Fix three "variable is void" bugs, ELPA Syncer, 2021/08/11