aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-05 14:52:45 +1100
committerLars Ingebrigtsen2016-02-05 14:52:45 +1100
commitebc6985b83ce2b1aefd761072d40ec3037bdd996 (patch)
tree4ef77bbda6e44612af968fa5b345a5b2f7b924b2
parentfa6912fc9e9013c6ec6915c6e11e43c3d4b3e6f7 (diff)
downloademacs-ebc6985b83ce2b1aefd761072d40ec3037bdd996.tar.gz
emacs-ebc6985b83ce2b1aefd761072d40ec3037bdd996.zip
Use an X popup in read-multiple-choice if running from a mouse command
* lisp/subr.el (read-multiple-choice): Use an X popup if called from a mouse action (bug#19368).
-rw-r--r--lisp/subr.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index e47570a5689..8e430bf98f5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2296,10 +2296,23 @@ Usage example:
2296 "Invalid choice. " 2296 "Invalid choice. "
2297 "") 2297 "")
2298 full-prompt) 2298 full-prompt)
2299 (setq tchar (condition-case nil 2299 (setq tchar
2300 (let ((cursor-in-echo-area t)) 2300 (if (and (display-popup-menus-p)
2301 (read-char)) 2301 last-input-event ; not during startup
2302 (error nil))) 2302 (listp last-nonmenu-event)
2303 use-dialog-box)
2304 (x-popup-dialog
2305 t
2306 (cons prompt
2307 (mapcar
2308 (lambda (elem)
2309 (cons (capitalize (cadr elem))
2310 (car elem)))
2311 choices)))
2312 (condition-case nil
2313 (let ((cursor-in-echo-area t))
2314 (read-char))
2315 (error nil))))
2303 ;; The user has entered an invalid choice, so display the 2316 ;; The user has entered an invalid choice, so display the
2304 ;; help messages. 2317 ;; help messages.
2305 (when (not (assq tchar choices)) 2318 (when (not (assq tchar choices))