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

Matthias Koeppe mkoeppe at common-lisp.net
Sat Aug 27 16:37:36 UTC 2005


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

Modified Files:
	slime.el 
Log Message:
(slime-presentation-menu): When an object is no longer
recorded, remove text properties from the presentation.

Date: Sat Aug 27 18:37:35 2005
Author: mkoeppe

Index: slime/slime.el
diff -u slime/slime.el:1.528 slime/slime.el:1.529
--- slime/slime.el:1.528	Tue Aug 23 08:39:30 2005
+++ slime/slime.el	Sat Aug 27 18:37:35 2005
@@ -3004,28 +3004,32 @@
   (let* ((point (if (featurep 'xemacs) (event-point event) (posn-point (event-end event))))
          (window (if (featurep 'xemacs) (event-window event) (caadr event))))
     (with-current-buffer (window-buffer window)
-      (multiple-value-bind (presentation)
+      (multiple-value-bind (presentation from to whole-p)
           (slime-presentation-around-point point)
         (unless presentation
           (error "No presentation at event position"))
         (let* ((what (slime-presentation-id presentation))
                (choices (slime-eval `(swank::menu-choices-for-presentation-id ',what)))
                (count 0))
-          (when choices
-            (if (symbolp choices)
-                (x-popup-menu event `("Object no longer recorded" ("sorry" . ,(if (featurep 'xemacs) nil '(nil)))))
-                (let ((choice 
-                       (x-popup-menu event 
-                                     `(,(if (featurep 'xemacs) " " "")
-                                       ("" ,@(mapcar 
-                                              (lambda(choice) 
-                                                (cons choice (intern choice))) ; use symbol as value to appease xemacs
-                                              choices))))))
-                  (when choice
-                    (let ((nchoice (1+ (position (symbol-name choice) choices :test 'equal))))
-                      (eval (slime-eval 
-                             `(swank::execute-menu-choice-for-presentation-id
-                               ',what ,nchoice ,(nth (1- nchoice) choices))))))))))))))
+          (etypecase choices
+            (null)
+            (symbol                     ; not-present
+             (slime-remove-presentation-properties from to presentation)
+             (sit-for 0)                ; allow redisplay
+             (x-popup-menu event `("Object no longer recorded" ("sorry" . ,(if (featurep 'xemacs) nil '(nil))))))
+            (list
+             (let ((choice 
+                    (x-popup-menu event 
+                                  `(,(if (featurep 'xemacs) " " "")
+                                    ("" ,@(mapcar 
+                                           (lambda(choice) 
+                                             (cons choice (intern choice))) ; use symbol as value to appease xemacs
+                                           choices))))))
+               (when choice
+                 (let ((nchoice (1+ (position (symbol-name choice) choices :test 'equal))))
+                   (eval (slime-eval 
+                          `(swank::execute-menu-choice-for-presentation-id
+                            ',what ,nchoice ,(nth (1- nchoice) choices))))))))))))))
 
 
 (defun slime-repl-insert-prompt (result &optional time)




More information about the slime-cvs mailing list