[slime-cvs] CVS update: slime/slime.el
Matthias Koeppe
mkoeppe at common-lisp.net
Sat Sep 10 18:27:46 UTC 2005
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv23789
Modified Files:
slime.el
Log Message:
(slime-enable-evaluate-in-emacs): Resurrected.
(slime-dispatch-event): Respect slime-enable-evaluate-in-emacs for
messages :eval-no-wait and :eval.
Date: Sat Sep 10 20:27:42 2005
Author: mkoeppe
Index: slime/slime.el
diff -u slime/slime.el:1.539 slime/slime.el:1.540
--- slime/slime.el:1.539 Fri Sep 9 19:10:18 2005
+++ slime/slime.el Sat Sep 10 20:27:42 2005
@@ -2280,6 +2280,12 @@
This variable is rebound by the :RETURN event handler and used by
slime-repl-insert-prompt.")
+(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 slime-dispatch-event (event &optional process)
(let ((slime-dispatching-connection (or process (slime-connection))))
(destructure-case event
@@ -2341,9 +2347,13 @@
((:open-dedicated-output-stream port)
(slime-open-stream-to-lisp port))
((:eval-no-wait fun args)
- (apply (intern fun) args))
+ (if slime-enable-evaluate-in-emacs
+ (apply (intern fun) args)
+ (error "Cannot evaluate in Emacs because slime-enable-evaluate-in-emacs is nil")))
((:eval thread tag fun args)
- (slime-eval-for-lisp thread tag (intern fun) args))
+ (if slime-enable-evaluate-in-emacs
+ (slime-eval-for-lisp thread tag (intern fun) args)
+ (slime-eval-async `(cl:error "Cannot evaluate in Emacs because slime-enable-evaluate-in-emacs is nil"))))
((:emacs-return thread tag value)
(slime-send `(:emacs-return ,thread ,tag ,value)))
((:ed what)
More information about the slime-cvs
mailing list