[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly 6d6e8fb 5/7: Fix #370: Survive propertized string
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/sly 6d6e8fb 5/7: Fix #370: Survive propertized strings read from minibuffer |
Date: |
Sat, 21 Nov 2020 01:34:52 -0500 (EST) |
branch: externals/sly
commit 6d6e8fb174fd612772056fee6e970b0acc8c9bb9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix #370: Survive propertized strings read from minibuffer
Extensions like 'ws-butler' will sometimes produce these.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.
* sly.el (sly--sanitize-or-lose): New helper.
(sly-net-send): Use it.
---
sly.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sly.el b/sly.el
index f6be037..ebe8cc1 100644
--- a/sly.el
+++ b/sly.el
@@ -1585,12 +1585,24 @@ first line of the file."
(defvar sly-net-send-translator nil
"If non-nil, function to translate outgoing sexps for the wire.")
+(defun sly--sanitize-or-lose (form)
+ "Sanitize FORM for Slynk or error."
+ (cl-typecase form
+ (number)
+ (symbol 'fonix)
+ (string (set-text-properties 0 (length form) nil form))
+ (cons (sly--sanitize-or-lose (car form))
+ (sly--sanitize-or-lose (cdr form)))
+ (t (sly-error "Can't serialize %s for Slynk." form)))
+ form)
+
(defun sly-net-send (sexp proc)
"Send a SEXP to Lisp over the socket PROC.
This is the lowest level of communication. The sexp will be READ and
EVAL'd by Lisp."
(let* ((print-circle nil)
(print-quoted nil)
+ (sexp (sly--sanitize-or-lose sexp))
(sexp (if (and sly-net-send-translator
(fboundp sly-net-send-translator))
(funcall sly-net-send-translator sexp)
- [nongnu] externals/sly updated (d12c4cd -> 3f72671), Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 5114fc2 1/7: Fix #346: Fix error when complex comint-preoutput-filter-functions, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 773595a 3/7: Play nice with latest version of fido-mode, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 070b1db 2/7: Close #303: Protect sly-eval against callers that set inhibit-quit to t, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly deafdc6 4/7: Close #273: Discuss completion UIs and mention Helm-SLY in README, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 4ced33c 6/7: Close #264: Mention some more additional contribs in README.md, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 3f72671 7/7: Close #378: new sly-connection-poll-interval user option, Stefan Monnier, 2020/11/21
- [nongnu] externals/sly 6d6e8fb 5/7: Fix #370: Survive propertized strings read from minibuffer,
Stefan Monnier <=