[slime-cvs] CVS update: slime/slime.el
Matthias Koeppe
mkoeppe at common-lisp.net
Sun Aug 28 12:23:36 UTC 2005
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv3138
Modified Files:
slime.el
Log Message:
(slime-enable-evaluate-in-emacs): New variable.
(evaluate-in-emacs): Security improvement: If
slime-enable-evaluate-in-emacs is nil (the default), don't
evaluate forms sent by the Lisp.
Date: Sun Aug 28 14:23:35 2005
Author: mkoeppe
Index: slime/slime.el
diff -u slime/slime.el:1.529 slime/slime.el:1.530
--- slime/slime.el:1.529 Sat Aug 27 18:37:35 2005
+++ slime/slime.el Sun Aug 28 14:23:35 2005
@@ -3618,10 +3618,21 @@
(slime-mark-input-start)
(slime-repl-read-mode 1))
+(defcustom slime-enable-evaluate-in-emacs nil
+ "If non-nil, the inferior Lisp can evaluate arbitrary forms in Emacs.
+The default is nil, as this feature can be a security risk."
+ :type '(boolean)
+ :group 'slime-lisp)
+
(defun evaluate-in-emacs (expr thread tag)
- (push thread slime-read-string-threads)
- (push tag slime-read-string-tags)
- (slime-repl-return-string (eval expr)))
+ (cond
+ (slime-enable-evaluate-in-emacs
+ (push thread slime-read-string-threads)
+ (push tag slime-read-string-tags)
+ (slime-repl-return-string (eval expr)))
+ (t
+ (slime-eval-async `(cl:error "Cannot evaluate in Emacs because slime-enable-evaluate-in-emacs is nil"))
+ nil)))
(defun slime-repl-return-string (string)
(slime-dispatch-event `(:emacs-return-string
More information about the slime-cvs
mailing list