emacs-diffs
[Top][All Lists]
Advanced

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

master db492b1e41 1/5: Remove some XEmacs compat code from eudc-bob.el


From: Stefan Kangas
Subject: master db492b1e41 1/5: Remove some XEmacs compat code from eudc-bob.el
Date: Fri, 13 May 2022 17:18:49 -0400 (EDT)

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

    Remove some XEmacs compat code from eudc-bob.el
    
    * lisp/net/eudc-bob.el (eudc-bob-can-display-inline-images): Make
    into obsolete alias for display-graphic-p.  Update all callers.
    (eudc-bob-display-jpeg): Remove XEmacs compat code.
---
 lisp/net/eudc-bob.el | 30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el
index f543678fa2..68a0ccb3a1 100644
--- a/lisp/net/eudc-bob.el
+++ b/lisp/net/eudc-bob.el
@@ -86,7 +86,7 @@
   `("EUDC Image Menu"
     ["---" nil nil]
     ["Toggle inline display" eudc-bob-toggle-inline-display
-     (eudc-bob-can-display-inline-images)]
+     (display-graphic-p)]
     ,@(cdr (cdr eudc-bob-generic-menu))))
 
 (defvar eudc-bob-sound-menu
@@ -109,14 +109,6 @@
       (setq overlays (cdr overlays)))
     value))
 
-(defun eudc-bob-can-display-inline-images ()
-  "Return non-nil if we can display images inline."
-  (if (fboundp 'console-type)
-      (and (memq (console-type) '(x mswindows))
-          (fboundp 'make-glyph))
-    (and (fboundp 'display-graphic-p)
-        (display-graphic-p))))
-
 (defun eudc-bob-make-button (label keymap &optional menu plist)
   "Create a button with LABEL.
 Attach KEYMAP, MENU and properties from PLIST to a new overlay covering
@@ -142,19 +134,7 @@ LABEL."
   "Display the JPEG DATA at point.
 If INLINE is non-nil, try to inline the image otherwise simply
 display a button."
-  (cond ((fboundp 'make-glyph)
-        (let ((glyph (if (eudc-bob-can-display-inline-images)
-                         (make-glyph (list (vector 'jpeg :data data)
-                                           [string :data "[JPEG Picture]"])))))
-          (eudc-bob-make-button "[JPEG Picture]"
-                                eudc-bob-image-keymap
-                                eudc-bob-image-menu
-                                (list 'glyph glyph
-                                      'end-glyph (if inline glyph)
-                                      'duplicable t
-                                      'invisible inline
-                                       'object-data data))))
-       ((fboundp 'create-image)
+  (cond ((fboundp 'create-image)
         (let* ((image (create-image data nil t))
                (props (list 'object-data data 'eudc-image image)))
           (when (and inline (image-type-available-p 'jpeg))
@@ -167,7 +147,7 @@ display a button."
 (defun eudc-bob-toggle-inline-display ()
   "Toggle inline display of an image."
   (interactive)
-  (when (eudc-bob-can-display-inline-images)
+  (when (display-graphic-p)
     (let* ((overlays (append (overlays-at (1- (point)))
                             (overlays-at (point))))
           image)
@@ -287,11 +267,13 @@ display a button."
 ;;;###autoload
 (defun eudc-display-jpeg-inline (data)
   "Display the JPEG DATA inline at point if possible."
-  (eudc-bob-display-jpeg data (eudc-bob-can-display-inline-images)))
+  (eudc-bob-display-jpeg data (display-graphic-p)))
 
 ;;;###autoload
 (defun eudc-display-jpeg-as-button (data)
   "Display a button for the JPEG DATA."
   (eudc-bob-display-jpeg data nil))
 
+(define-obsolete-function-alias 'eudc-bob-can-display-inline-images 
#'display-graphic-p "29.1")
+
 ;;; eudc-bob.el ends here



reply via email to

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