Fix display-mouse-p and display-popup-menus-p for TTYs; menus in Custom work.

This commit is contained in:
Eli Zaretskii 2013-10-02 21:44:40 +03:00
parent d797af5518
commit ffe759ebe3
2 changed files with 9 additions and 5 deletions

View file

@ -661,6 +661,10 @@ for something (not just adding elements to it), it ought not to affect you.
This includes `x-popup-menu', `x-popup-dialog', `message-box',
`yes-or-no-p', etc.
The function `display-popup-menus-p' will now return non-nil for a
display or frame whenever a mouse is supported on that display or
frame.
** New bool-vector set operation functions:
*** `bool-vector-exclusive-or'
*** `bool-vector-union'

View file

@ -1304,17 +1304,17 @@ frame's display)."
xterm-mouse-mode)
;; t-mouse is distributed with the GPM package. It doesn't have
;; a toggle.
(featurep 't-mouse))))))
(featurep 't-mouse)
;; No way to check whether a w32 console has a mouse, assume
;; it always does.
(boundp 'w32-use-full-screen-buffer))))))
(defun display-popup-menus-p (&optional display)
"Return non-nil if popup menus are supported on DISPLAY.
DISPLAY can be a display name, a frame, or nil (meaning the selected
frame's display).
Support for popup menus requires that the mouse be available."
(and
(let ((frame-type (framep-on-display display)))
(memq frame-type '(x w32 pc ns)))
(display-mouse-p display)))
(display-mouse-p display))
(defun display-graphic-p (&optional display)
"Return non-nil if DISPLAY is a graphic display.