`("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
(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
"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))
(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)
;;;###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