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.
;;; @ 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
;;;