[slime-cvs] CVS update: slime/slime.el

Luke Gorrie lgorrie at common-lisp.net
Wed Oct 15 14:59:26 UTC 2003


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv7734

Modified Files:
	slime.el 
Log Message:
(slime-point-moves-p): Macro for executing subforms and returning true
if they move the point.

Date: Wed Oct 15 10:59:26 2003
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.31 slime/slime.el:1.32
--- slime/slime.el:1.31	Wed Oct 15 10:43:56 2003
+++ slime/slime.el	Wed Oct 15 10:59:26 2003
@@ -1191,6 +1191,15 @@
 	(t
 	 (error "Unsupported location type %s" note))))
 
+(defmacro slime-point-moves-p (&rest body)
+  "Execute BODY and return true if the current buffer's point moved."
+  (let ((pointvar (gensym "point-")))
+    `(let ((,pointvar (point)))
+       (save-current-buffer , at body)
+       (/= ,pointvar (point)))))
+
+(put 'slime-point-moves-p 'lisp-indent-function 0)
+
 (defun slime-forward-sexp (&optional count)
   "Like `forward-sexp', but understands reader-conditionals (#- and #+)."
   (dotimes (i (or count 1))





More information about the slime-cvs mailing list