emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6b4f6dfb4e: Make ediff-window-display-p obsolete


From: Stefan Kangas
Subject: master 6b4f6dfb4e: Make ediff-window-display-p obsolete
Date: Sun, 7 Aug 2022 11:50:42 -0400 (EDT)

branch: master
commit 6b4f6dfb4e195c572c6e8502a349afff5f7987b9
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Make ediff-window-display-p obsolete
    
    * lisp/vc/ediff-init.el (ediff-window-display-p): Redefine as
    obsolete function alias for 'display-graphic-p'.
---
 lisp/vc/ediff-init.el | 17 +++++++----------
 lisp/vc/ediff-mult.el |  8 ++++----
 lisp/vc/ediff-util.el | 18 +++++++++---------
 lisp/vc/ediff-wind.el | 12 ++++++------
 4 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 05a9901e1e..29f24436e1 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -48,13 +48,9 @@ that Ediff doesn't know about.")
   (declare (obsolete window-system "27.1"))
   window-system)
 
-(defun ediff-window-display-p ()
-  (and window-system
-       (not (memq window-system '(tty pc stream)))))
-
 ;; test if supports faces
 (defun ediff-has-face-support-p ()
-  (cond ((ediff-window-display-p))
+  (cond ((display-graphic-p))
        (ediff-force-faces)
        ((display-color-p))
        (t (memq window-system '(pc)))))
@@ -258,7 +254,7 @@ It needs to be killed when we quit the session.")
 
 
 (defsubst ediff-multiframe-setup-p ()
-  (and (ediff-window-display-p) ediff-multiframe))
+  (and (display-graphic-p) ediff-multiframe))
 
 (defmacro ediff-narrow-control-frame-p ()
   '(and (ediff-multiframe-setup-p)
@@ -788,7 +784,7 @@ Ediff needs to find fine differences."
 
 (defun ediff-set-face-pixmap (face pixmap)
   "Set stipple pixmap of FACE to PIXMAP on a monochrome display."
-  (if (and (ediff-window-display-p) (not (display-color-p)))
+  (if (and (display-graphic-p) (not (display-color-p)))
       (condition-case nil
          (set-face-background-pixmap face pixmap)
        (error
@@ -1382,14 +1378,14 @@ This default should work without changes."
 
 
 (defsubst ediff-frame-iconified-p (frame)
-  (and (ediff-window-display-p)
+  (and (display-graphic-p)
        (frame-live-p frame)
        (eq (frame-visible-p frame) 'icon)))
 
 (defsubst ediff-window-visible-p (wind)
   ;; under TTY, window-live-p also means window is visible
   (and (window-live-p wind)
-       (or (not (ediff-window-display-p))
+       (or (not (display-graphic-p))
           (frame-visible-p (window-frame wind)))))
 
 
@@ -1398,7 +1394,7 @@ This default should work without changes."
 
 (defun ediff-reset-mouse (&optional frame do-not-grab-mouse)
   (or frame (setq frame (selected-frame)))
-  (if (ediff-window-display-p)
+  (if (display-graphic-p)
       (let ((frame-or-wind frame))
        (or do-not-grab-mouse
            ;; don't set mouse if the user said to never do this
@@ -1562,6 +1558,7 @@ This default should work without changes."
 (define-obsolete-function-alias 'ediff-convert-standard-filename 
#'convert-standard-filename "28.1")
 (define-obsolete-function-alias 'ediff-hide-face #'ignore "28.1")
 (define-obsolete-function-alias 'ediff-file-remote-p #'file-remote-p "29.1")
+(define-obsolete-function-alias 'ediff-window-display-p #'display-graphic-p 
"29.1")
 
 (provide 'ediff-init)
 ;;; ediff-init.el ends here
diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el
index fc2d899c2e..7e15060f8c 100644
--- a/lisp/vc/ediff-mult.el
+++ b/lisp/vc/ediff-mult.el
@@ -2054,14 +2054,14 @@ all marked sessions must be active."
              ((and
                (setq wind
                      (ediff-get-visible-buffer-window ediff-registry-buffer))
-               (ediff-window-display-p))
+                (display-graphic-p))
               (select-window wind)
               (other-window 1)
               (set-window-buffer (selected-window) meta-buf))
              (t (ediff-skip-unsuitable-frames 'ok-unsplittable)
                 (set-window-buffer (selected-window) meta-buf)))
        ))
-    (if (and (ediff-window-display-p)
+    (if (and (display-graphic-p)
             (window-live-p
              (setq wind (ediff-get-visible-buffer-window meta-buf))))
        (progn
@@ -2115,14 +2115,14 @@ all marked sessions must be active."
                (select-window ediff-window-B))
               ((and (setq wind
                           (ediff-get-visible-buffer-window ediff-meta-buffer))
-                    (ediff-window-display-p))
+                     (display-graphic-p))
                (select-window wind)
                (other-window 1)
                (set-window-buffer (selected-window) ediff-registry-buffer))
               (t (ediff-skip-unsuitable-frames 'ok-unsplittable)
                  (set-window-buffer (selected-window) ediff-registry-buffer)))
        ))
-    (if (ediff-window-display-p)
+    (if (display-graphic-p)
        (progn
          (setq frame
                (window-frame
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index fd36840db2..e8510acfb1 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -735,7 +735,7 @@ buffers."
   ;; set visibility range appropriate to this invocation of Ediff.
   (ediff-visible-region)
   ;; raise
-  (if (and (ediff-window-display-p)
+  (if (and (display-graphic-p)
           (symbolp this-command)
           (symbolp last-command)
           ;; Either one of the display-changing commands
@@ -760,7 +760,7 @@ buffers."
            (raise-frame (window-frame ediff-window-B)))
        (if (window-live-p ediff-window-C)
            (raise-frame (window-frame ediff-window-C)))))
-  (if (and (ediff-window-display-p)
+  (if (and (display-graphic-p)
           (frame-live-p ediff-control-frame)
           (not ediff-use-long-help-message)
           (not (ediff-frame-iconified-p ediff-control-frame)))
@@ -1252,7 +1252,7 @@ of the current buffer."
 This is especially useful when comparing buffers side-by-side."
   (interactive)
   (ediff-barf-if-not-control-buffer)
-  (or (ediff-window-display-p)
+  (or (display-graphic-p)
       (user-error "Emacs is not running as a window application"))
   (ediff-recenter 'no-rehighlight) ; make sure buffs are displayed in windows
   (let ((ctl-buf ediff-control-buffer))
@@ -1279,7 +1279,7 @@ To change the default, set the variable 
`ediff-window-setup-function',
 which see."
   (interactive)
   (let (window-setup-func)
-    (or (ediff-window-display-p)
+    (or (display-graphic-p)
        (user-error "Emacs is not running as a window application"))
 
   (cond ((eq ediff-window-setup-function #'ediff-setup-windows-multiframe)
@@ -1323,7 +1323,7 @@ To change the default, set the variable 
`ediff-use-toolbar-p', which see."
   ;; FIXME: Make it work in Emacs!
   (if (featurep 'ediff-tbar)
       (progn
-       (or (ediff-window-display-p)
+        (or (display-graphic-p)
            (user-error "Emacs is not running as a window application"))
        ;; do this only after killing the toolbar
        (setq ediff-use-toolbar-p (not ediff-use-toolbar-p))
@@ -2438,7 +2438,7 @@ reverse the meaning of this variable."
         (after-quit-hook-internal (remq t ediff-after-quit-hook-internal))
        (session-number ediff-meta-session-number)
        ;; suitable working frame
-       (warp-frame (if (and (ediff-window-display-p) (eq ediff-grab-mouse t))
+        (warp-frame (if (and (display-graphic-p) (eq ediff-grab-mouse t))
                        (cond ((window-live-p ediff-window-A)
                               (window-frame ediff-window-A))
                              ((window-live-p ediff-window-B)
@@ -2512,7 +2512,7 @@ reverse the meaning of this variable."
   (setq warp-frame  ; if mouse is over a reasonable frame, use it
        (cond ((ediff-good-frame-under-mouse))
              (t warp-frame)))
-  (if (and (ediff-window-display-p) (frame-live-p warp-frame) ediff-grab-mouse)
+  (if (and (display-graphic-p) (frame-live-p warp-frame) ediff-grab-mouse)
       (set-mouse-position warp-frame 2 1))
 
   (mapc #'funcall after-quit-hook-internal)
@@ -2569,7 +2569,7 @@ reverse the meaning of this variable."
        (ediff-kill-buffer-carefully ediff-patch-diagnostics))
 
     ;; delete control frame or window
-    (cond ((and (ediff-window-display-p) (frame-live-p ctl-frame))
+    (cond ((and (display-graphic-p) (frame-live-p ctl-frame))
           (delete-frame ctl-frame))
          ((window-live-p ctl-wind)
           (delete-window ctl-wind)))
@@ -2744,7 +2744,7 @@ only if this merge job is part of a group, i.e., was 
invoked from within
         (buf-fine-diff ediff-fine-diff-buffer))
 
     ;; hide the control panel
-    (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
+    (if (and (display-graphic-p) (frame-live-p ediff-control-frame))
        (iconify-frame ediff-control-frame)
       (bury-buffer))
     (if buf-err (bury-buffer buf-err))
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index 0579cee6ec..bd3f6880da 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -52,7 +52,7 @@
 ;; Determine which window setup function to use based on current window system.
 (defun ediff-choose-window-setup-function-automatically ()
   (declare (obsolete ediff-setup-windows-default "24.3"))
-  (if (ediff-window-display-p)
+  (if (display-graphic-p)
       #'ediff-setup-windows-multiframe
     #'ediff-setup-windows-plain))
 
@@ -304,7 +304,7 @@ keyboard input to go into icons."
       (other-window 1))
 
   ;; in case user did a no-no on a tty
-  (or (ediff-window-display-p)
+  (or (display-graphic-p)
       (setq ediff-window-setup-function #'ediff-setup-windows-plain))
 
   (or (ediff-keep-window-config control-buffer)
@@ -844,7 +844,7 @@ keyboard input to go into icons."
 (defun ediff-skip-unsuitable-frames (&optional ok-unsplittable)
   "Skip unsplittable frames and frames that have dedicated windows.
 Create a new splittable frame if none is found."
-  (if (ediff-window-display-p)
+  (if (display-graphic-p)
       (let ((wind-frame (window-frame))
             seen-windows)
        (while (and (not (memq (selected-window) seen-windows))
@@ -993,7 +993,7 @@ Create a new splittable frame if none is found."
 
     ;; synchronize so the cursor will move to control frame
     ;; per RMS suggestion
-    (if (ediff-window-display-p)
+    (if (display-graphic-p)
        (let ((count 7))
          (sit-for .1)
          (while (and (not (frame-visible-p ctl-frame)) (> count 0))
@@ -1012,7 +1012,7 @@ Create a new splittable frame if none is found."
 
 (defun ediff-destroy-control-frame (ctl-buffer)
   (ediff-with-current-buffer ctl-buffer
-    (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
+    (if (and (display-graphic-p) (frame-live-p ediff-control-frame))
        (let ((ctl-frame ediff-control-frame))
          (setq ediff-control-frame nil)
          (delete-frame ctl-frame))))
@@ -1145,7 +1145,7 @@ It assumes that it is called from within the control 
buffer."
     ;; Force mode-line redisplay
     (force-mode-line-update)
 
-    (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
+    (if (and (display-graphic-p) (frame-live-p ediff-control-frame))
        (ediff-refresh-control-frame))
 
     (ediff-with-current-buffer ediff-buffer-A



reply via email to

[Prev in Thread] Current Thread [Next in Thread]