[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure e10ac48 132/313: Improve string sanitation and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure e10ac48 132/313: Improve string sanitation and arglists response parsing |
Date: |
Wed, 11 Aug 2021 10:00:01 -0400 (EDT) |
branch: elpa/inf-clojure
commit e10ac489e015515aaa7f49d397c08a26063cf777
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Improve string sanitation and arglists response parsing
The function `inf-clojure--sanitize-command` now also makes sure that
form sent to the process is not multiline. Weird stuff happens instead.
---
inf-clojure.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index f16a92f..b5b6623 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -215,11 +215,16 @@ It requires a REPL PROC for inspecting the correct type."
(setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc))
inf-clojure-repl-type))
+(defun inf-clojure--single-linify (string)
+ "Convert a multi-line STRING in a single-line STRING."
+ (replace-regexp-in-string "[[:space:]\\|\n]+" " " string))
+
(defun inf-clojure--sanitize-command (command)
"Sanitize COMMAND for sending it to a process.
An example of things that this function does is to add a final
newline at the end of the form."
- (concat (string-trim-right command) "\n"))
+ (concat (string-trim-right (inf-clojure--single-linify command))
+ "\n"))
(defun inf-clojure--send-string (proc string)
"A custom `comint-input-sender` / `comint-send-string`.
- [nongnu] elpa/inf-clojure ee4369d 089/313: Fix typo in README, (continued)
- [nongnu] elpa/inf-clojure ee4369d 089/313: Fix typo in README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 421b265 095/313: Add a command to display the inf-clojure version, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 166b077 098/313: Remove some obsolete code, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6a4329b 100/313: Font-lock code in the REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d0f0ee8 103/313: Add a missing require, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1d6260a 104/313: [Fix #29] Add a command to restart a REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a3306c9 137/313: Further fix arglists in lumo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 59cd1f3 094/313: Add a changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2e20754 109/313: Support REPL types and Lumo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3041031 110/313: Fix typo in inf-clojure-*-cmd defcustoms, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e10ac48 132/313: Improve string sanitation and arglists response parsing,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 4e80276 126/313: [Fix #56] Add special handling for Planck REPLS (#66), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 582601e 134/313: Fix missing inf-clojure-set-ns-form-lumo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6bd986d 146/313: Fix typo in docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 339093c 056/313: Replace multiple newlines by single one or add one, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 78d2ab2 034/313: Add a command for clearing the REPL buffer, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure c9f2f63 036/313: Fix eval defun keybinding, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 75f6fab 039/313: Update copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 8594a58 042/313: Add new-line mark after inf-clojure-arglist-command, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d2bedf9 048/313: Fix the installation instructions in the Elisp snippet, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7aa0299 062/313: Refactoring, ELPA Syncer, 2021/08/11