]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some uses of 'use-dialog-box'
authorEli Zaretskii <eliz@gnu.org>
Sat, 18 Feb 2023 08:58:00 +0000 (10:58 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 18 Feb 2023 08:58:00 +0000 (10:58 +0200)
* lisp/frame.el (display-mouse-p): Fix return value on MS-Windows
in batch invocations.
* lisp/hi-lock.el (hi-lock-unface-buffer): Don't consider
'last-nonmenu-event' being nil as a mouse event, for the purpose
of using dialog boxes.

lisp/frame.el
lisp/hi-lock.el

index af95a047c381bf5d5568fc47aac4a3c9b6c190f0..8138334935451fbd18623b158a5bbdcf3d7aaf2c 100644 (file)
@@ -2120,8 +2120,9 @@ frame's display)."
          ;; a toggle.
          (featurep 't-mouse)
          ;; No way to check whether a w32 console has a mouse, assume
-         ;; it always does.
-         (boundp 'w32-use-full-screen-buffer))))))
+         ;; it always does, except in batch invocations.
+          (and (not noninteractive)
+              (boundp 'w32-use-full-screen-buffer)))))))
 
 (defun display-popup-menus-p (&optional display)
   "Return non-nil if popup menus are supported on DISPLAY.
index 78fc5e6f716fe233bd74275731551ed6eb7746b6..5c536b190fba4f61d5cbe5169a683799380abb5c 100644 (file)
@@ -611,6 +611,7 @@ then remove all hi-lock highlighting."
    (cond
     (current-prefix-arg (list t))
     ((and (display-popup-menus-p)
+          last-nonmenu-event
           (listp last-nonmenu-event)
           use-dialog-box)
      (catch 'snafu