[climacs-cvs] CVS climacs

thenriksen thenriksen at common-lisp.net
Wed May 31 14:47:29 UTC 2006


Update of /project/climacs/cvsroot/climacs
In directory clnet:/tmp/cvs-serv24920

Modified Files:
	lisp-syntax.lisp 
Log Message:
Added `symbol-at-mark' function.


--- /project/climacs/cvsroot/climacs/lisp-syntax.lisp	2006/05/31 13:55:15	1.78
+++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp	2006/05/31 14:47:28	1.79
@@ -1362,6 +1362,17 @@
 returned."
   (form-toplevel (expression-at-mark mark syntax) syntax))
 
+(defun symbol-at-mark (mark syntax)
+  "Return a symbol token at mark. This function will \"unwrap\"
+  quote-forms in order to return the symbol token. If no symbol
+  token can be found, NIL will be returned."
+  (labels ((unwrap-form (form)
+             (cond ((typep form 'quote-form)
+                    (unwrap-form (first-form (children form))))
+                   ((typep form 'complete-token-lexeme)
+                    form))))
+    (unwrap-form (expression-at-mark mark syntax))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; display




More information about the Climacs-cvs mailing list