[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure dda0a43 125/313: Fix newline append on eval fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure dda0a43 125/313: Fix newline append on eval functions |
Date: |
Wed, 11 Aug 2021 10:00:00 -0400 (EDT) |
branch: elpa/inf-clojure
commit dda0a431b4f6ab3d13728418abd825e9d94a7faa
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Fix newline append on eval functions
A fix was necessary for a regression caused by the fact that now
`inf-clojure--send-string` adds a newline at the end of the string it
sends to the process.
---
inf-clojure.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index 52b54bc..de75c1c 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -216,13 +216,16 @@ It requires a REPL PROC for inspecting the correct type."
(defun inf-clojure--send-string (proc string)
"A custom `comint-input-sender` / `comint-send-string`.
-Perform the required side effects on every send for PROC and
+It performs the required side effects on every send for PROC and
STRING (for example set the buffer local REPL type). It should
-be used instead of `comint-send-string`."
+always be preferred over `comint-send-string`. It delegates to
+`comint-simple-send` so it always appends a newline at the end of
+the string for evaluation. Refer to `comint-simple-send` for
+customizations. "
(inf-clojure--set-repl-type proc)
(comint-simple-send proc string))
-(defcustom inf-clojure-load-form "(clojure.core/load-file \"%s\")\n"
+(defcustom inf-clojure-load-form "(clojure.core/load-file \"%s\")"
"Format-string for building a Clojure expression to load a file.
This format string should use `%s' to substitute a file name and
should result in a Clojure form that will be sent to the inferior
@@ -458,17 +461,16 @@ of `inf-clojure-*-cmd'). Runs the hooks from
"Send the current region to the inferior Clojure process.
Prefix argument AND-GO means switch to the Clojure buffer afterwards."
(interactive "r\nP")
- ;; replace multiple newlines at the end of the region by a single one
- ;; or add one if there was no newline
+ ;; drops newlines at the end of the region
(let ((str (replace-regexp-in-string
- "[\n]*\\'" "\n"
+ "[\n]+\\'" ""
(buffer-substring-no-properties start end))))
(inf-clojure--send-string (inf-clojure-proc) str))
- (if and-go (inf-clojure-switch-to-repl t)))
+ (when and-go (inf-clojure-switch-to-repl t)))
(defun inf-clojure-eval-string (code)
"Send the string CODE to the inferior Clojure process to be executed."
- (inf-clojure--send-string (inf-clojure-proc) (concat code "\n")))
+ (inf-clojure--send-string (inf-clojure-proc) code))
(defun inf-clojure-eval-defun (&optional and-go)
"Send the current defun to the inferior Clojure process.
- [nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-prompt-on-set-ns` (#46), (continued)
- [nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-prompt-on-set-ns` (#46), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6e55048 099/313: [Fix #42] Add a defcustom controlling the window in which the REPL buffer is displayed, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 872c143 101/313: Handle properly ANSI color escape sequences in the REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2e1dd6c 108/313: Update the "Usage" section of the README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 916ec97 106/313: Infer the customization group from defcustom names, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a36d2a0 111/313: Remove unwanted ansi chars from the REPL output, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3929054 113/313: Modify CHANGELOG and README for REPL types, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d265232 115/313: Fix a problem with pcase on inf-clojure-repl-type, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ac74e20 117/313: Kill inf-clojure-var-at-point, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure cfad839 122/313: Officially support lumo -d (dumb terminal) only, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure dda0a43 125/313: Fix newline append on eval functions,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 896edd1 131/313: Handle inf-clojure-arglists corner cases, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ebd1494 135/313: Support lumo's apropos, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2341aa2 136/313: Support lumo's source, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1014e24 141/313: Extend the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 4a87862 161/313: Calculate response boundaries explicitly, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 15963ca 162/313: Trim the string before checking nil, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure aaaeef6 167/313: Set string safety for all the form defcustoms, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 864356a 172/313: [Fix #75] Remove compilation warnings (#109), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 5d76920 176/313: Introduce inf-clojure-project-type defcustom, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f4478ad 183/313: Fix and reword docstring, ELPA Syncer, 2021/08/11