[slime-cvs] CVS update: slime/ChangeLog slime/slime.el slime/swank.lisp

Alan Ruttenberg aruttenberg at common-lisp.net
Thu Sep 15 03:37:15 UTC 2005


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

Modified Files:
	ChangeLog slime.el swank.lisp 
Log Message:

* slime.el (slime-menu-choices-for-presentation), (slime-presentation-menu)
Fix loss after refactoring. xemacs can't handle lambda forms in
the menu spec given to x-popup-menu, only symbols, so save the
actions in a hash table keyed by a gensym, give x-popup-menu the
gensym and then call the gensym. Haven't checked that it actually
works in xemacs because my xemacs is hosed in os x Tiger. Could
someone let me know...

* swank.lisp (inspect-factor-more-action)
rename (inspect-show-more-action) Prompt before reading how many
more. Would be nicer to prompt in the minibuffer...
Date: Thu Sep 15 05:37:14 2005
Author: aruttenberg

Index: slime/ChangeLog
diff -u slime/ChangeLog:1.778 slime/ChangeLog:1.779
--- slime/ChangeLog:1.778	Wed Sep 14 22:18:39 2005
+++ slime/ChangeLog	Thu Sep 15 05:37:13 2005
@@ -1,3 +1,17 @@
+2005-09-14  Alan Ruttenberg <alanr-l at mumble.net>
+
+	* slime.el (slime-menu-choices-for-presentation), (slime-presentation-menu)
+	Fix loss after refactoring. xemacs can't handle lambda forms in
+	the menu spec given to x-popup-menu, only symbols, so save the
+	actions in a hash table keyed by a gensym, give x-popup-menu the
+	gensym and then call the gensym. Haven't checked that it actually
+	works in xemacs because my xemacs is hosed in os x Tiger. Could
+	someone let me know...
+	
+	* swank.lisp (inspect-factor-more-action)
+	rename (inspect-show-more-action) Prompt before reading how many
+	more. Would be nicer to prompt in the minibuffer...
+	
 2005-09-14  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>
 
 	* slime.el (slime-presentation-expression): Remove handling of


Index: slime/slime.el
diff -u slime/slime.el:1.545 slime/slime.el:1.546
--- slime/slime.el:1.545	Wed Sep 14 22:17:42 2005
+++ slime/slime.el	Thu Sep 15 05:37:13 2005
@@ -3024,57 +3024,63 @@
 ;; 2. Let used choose
 ;; 3. Call back to execute menu choice, passing nth and string of choice
 
-(defun slime-menu-choices-for-presentation (presentation from to)
+(defun slime-menu-choices-for-presentation (presentation from to choice-to-lambda)
   "Return a menu for `presentation' at `from'--`to' in the current
 buffer, suitable for `x-popup-menu'."
   (let* ((what (slime-presentation-id presentation))
          (choices (slime-eval 
                    `(swank::menu-choices-for-presentation-id ',what))))
+    (flet ((savel (f) ;; IMPORTANT - xemacs can't handle lambdas in x-popup-menu. So give them a name
+            (let ((sym (gensym)))
+              (setf (gethash sym choice-to-lambda) f)
+              sym)))
     (etypecase choices
       (list
        `(,(if (featurep 'xemacs) " " "")
          ("" 
-          ("Inspect" . (lambda ()
+          ("Inspect" . ,(savel `(lambda ()
                          (interactive)
-                         (slime-inspect-presented-object ',what)))
+                         (slime-inspect-presented-object ',what))))
           ("Describe" . 
-           (lambda ()
+           ,(savel `(lambda ()
              (interactive)
              ;; XXX remove call to describe.
              (slime-eval '(cl:describe 
-                           (swank::lookup-presented-object ',what)))))
-          ("Copy to input" . slime-copy-presentation-at-point)
+                           (swank::lookup-presented-object ',what))))))
+          ("Copy to input" . ,(savel 'slime-copy-presentation-at-point))
           ,@(let ((nchoice 0))
               (mapcar 
                (lambda (choice)
                  (incf nchoice)
                  (cons choice 
-                       `(lambda ()
+                       (savel `(lambda ()
                           (interactive)
                           (slime-eval 
                            '(swank::execute-menu-choice-for-presentation-id
-                             ',what ,nchoice ,(nth (1- nchoice) choices))))))
+                             ',what ,nchoice ,(nth (1- nchoice) choices)))))))
                choices)))))
       (symbol                           ; not-present
        (slime-remove-presentation-properties from to presentation)
        (sit-for 0)                      ; allow redisplay
        `("Object no longer recorded" 
-         ("sorry" . ,(if (featurep 'xemacs) nil '(nil))))))))
+         ("sorry" . ,(if (featurep 'xemacs) nil '(nil)))))))))
 
 (defun slime-presentation-menu (event)
   (interactive "e")
   (let* ((point (if (featurep 'xemacs) (event-point event) (posn-point (event-end event))))
-         (window (if (featurep 'xemacs) (event-window event) (caadr event))))
+         (window (if (featurep 'xemacs) (event-window event) (caadr event)))
+         (choice-to-lambda (make-hash-table)))
     (with-current-buffer (window-buffer window)
       (multiple-value-bind (presentation from to)
           (slime-presentation-around-point point)
         (unless presentation
           (error "No presentation at event position"))
         (let ((menu (slime-menu-choices-for-presentation 
-                     presentation from to)))
+                     presentation from to choice-to-lambda)))
+          (setq it choice-to-lambda)
           (let ((choice (x-popup-menu event menu)))
             (when choice
-              (call-interactively choice))))))))
+              (call-interactively (gethash choice choice-to-lambda)))))))))
 
 (defun slime-repl-insert-prompt (result &optional time)
   "Goto to point max, insert RESULT and the prompt.


Index: slime/swank.lisp
diff -u slime/swank.lisp:1.334 slime/swank.lisp:1.335
--- slime/swank.lisp:1.334	Tue Sep 13 07:37:16 2005
+++ slime/swank.lisp	Thu Sep 15 05:37:13 2005
@@ -3363,7 +3363,7 @@
 		     *slime-inspect-contents-limit* )
 	    ,(lambda() 
 	       (let ((*slime-inspect-contents-limit* 
-		      (read)))
+		      (progn (format t "How many elements should be shown? ") (read))))
 		 (values
 		  (swank::inspect-object thing)
 		  :replace)




More information about the slime-cvs mailing list