* semi-def.el (mime-should-use-popup-menu): New function.
authoryoichi <yoichi>
Sat, 8 Feb 2003 08:05:56 +0000 (08:05 +0000)
committeryoichi <yoichi>
Sat, 8 Feb 2003 08:05:56 +0000 (08:05 +0000)
(mime-select-menu-alist): Renamed from select-menu-alist, change
its behavior according to mime-should-use-popup-menu.
* mime-play.el (mime-play-entity): Change accordingly.

ChangeLog
mime-play.el
semi-def.el

index d0f20c0..f07e31a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2003-02-08  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
+       * semi-def.el (mime-should-use-popup-menu): New function.
+       (mime-select-menu-alist): Renamed from select-menu-alist, change
+       its behavior according to mime-should-use-popup-menu.
+       * mime-play.el (mime-play-entity): Change accordingly.
+
+2003-02-08  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
+
        * mime-view.el (mime-save-situation-examples): Bind print-length
        and print-level.
 
index 300640d..43221e6 100644 (file)
@@ -96,7 +96,7 @@ specified, play as it.  Default MODE is \"play\"."
     (setq mime-acting-situation-example-list (cdr ret)
          ret (car ret))
     (cond ((cdr ret)
-          (setq ret (select-menu-alist
+          (setq ret (mime-select-menu-alist
                      "Methods"
                      (mapcar (function
                               (lambda (situation)
index fa5bf15..e969c1a 100644 (file)
 ;;; @ menu
 ;;;
 
-(if window-system
-    (if (featurep 'xemacs)
-       (defun select-menu-alist (title menu-alist)
-         (let (ret)
-           (popup-menu
-            (list* title
-                   "---"
-                   (mapcar (function
-                            (lambda (cell)
-                              (vector (car cell)
-                                      `(progn
-                                         (setq ret ',(cdr cell))
-                                         (throw 'exit nil)
-                                         )
-                                      t)
-                              ))
-                           menu-alist)
-                   ))
-           (recursive-edit)
-           ret))
-      (defun select-menu-alist (title menu-alist)
-       (x-popup-menu
-        (list '(1 1) (selected-window))
-        (list title (cons title menu-alist))
-        ))
-      )
-  (defun select-menu-alist (title menu-alist)
-    (cdr
-     (assoc (completing-read (concat title " : ") menu-alist)
-           menu-alist)
-     ))
-  )
-
+(static-cond ((featurep 'xemacs)
+             (defun mime-should-use-popup-menu ()
+               (and window-system
+                    (mouse-event-p last-command-event)))
+             (defun mime-select-menu-alist (title menu-alist)
+               (if (mime-should-use-popup-menu)
+                   (let (ret)
+                     (popup-menu
+                      (list* title
+                             "---"
+                             (mapcar (function
+                                      (lambda (cell)
+                                        (vector (car cell)
+                                                `(progn
+                                                   (setq ret ',(cdr cell))
+                                                   (throw 'exit nil))
+                                                t)))
+                                     menu-alist)))
+                     (recursive-edit)
+                     ret)
+                 (cdr
+                  (assoc (completing-read (concat title " : ") menu-alist)
+                         menu-alist)))))
+            (t
+             (defun mime-should-use-popup-menu ()
+               (and window-system
+                    (memq (event-basic-type last-command-event)
+                          '(mouse-1 mouse-2 mouse-3))))
+             (defun mime-select-menu-alist (title menu-alist)
+               (if (mime-should-use-popup-menu)
+                   (x-popup-menu
+                    (list '(1 1) (selected-window))
+                    (list title (cons title menu-alist)))
+                 (cdr
+                  (assoc (completing-read (concat title " : ") menu-alist)
+                         menu-alist))))))
 
 ;;; @ Other Utility
 ;;;