1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-23 10:34:07 +00:00

Fix some no-X build warnings

* lisp/cus-edit.el (fringe-bitmap-p): Autoload.

* lisp/image.el (clear-image-cache): Declare.

* lisp/mouse.el (dnd-begin-file-dram): Autoload.

* lisp/thumbs.el (image-supported-file-p): Declare (bug#57342).

* lisp/mail/rmailmm.el (rmail-mime-set-bulk-data):
* lisp/emacs-lisp/icons.el (icons--create): Avoid warnings on no-X
builds.
This commit is contained in:
Lars Ingebrigtsen 2022-08-22 19:22:27 +02:00
parent a0fa6bd547
commit 06d7161476
7 changed files with 17 additions and 4 deletions

View File

@ -4291,6 +4291,9 @@ restoring it to the state of a face that has never been customized."
(defvar widget-fringe-bitmap-prompt-value-history nil
"History of input to `widget-fringe-bitmap-prompt-value'.")
;; In no-X builds, fringe.el isn't preloaded.
(autoload 'fringe-bitmap-p "fringe")
(define-widget 'fringe-bitmap 'symbol
"A Lisp fringe bitmap name."
:format "%v"

View File

@ -189,8 +189,10 @@ present if the icon is represented by an image."
(cl-defmethod icons--create ((_type (eql 'image)) icon keywords)
(let ((file (if (file-name-absolute-p icon)
icon
(image-search-load-path icon))))
(and (fboundp 'image-search-load-path)
(image-search-load-path icon)))))
(and (display-images-p)
(fboundp 'image-supported-file-p)
(image-supported-file-p file)
(propertize
" " 'display

View File

@ -32,6 +32,8 @@
:group 'multimedia)
(declare-function image-flush "image.c" (spec &optional frame))
(declare-function clear-image-cache "image.c"
(&optional filter animation-cache))
(defconst image-type-header-regexps
`(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)

View File

@ -796,8 +796,9 @@ directly."
((string-match "text/" content-type)
(setq type 'text))
((string-match "image/\\(.*\\)" content-type)
(setq type (image-supported-file-p
(concat "." (match-string 1 content-type))))
(setq type (and (fboundp 'image-supported-file-p)
(image-supported-file-p
(concat "." (match-string 1 content-type)))))
(when (and type
rmail-mime-show-images
(not (eq rmail-mime-show-images 'button))

View File

@ -869,6 +869,9 @@ must be one of the symbols `header', `mode', or `vertical'."
map)
t (lambda () (setq track-mouse old-track-mouse)))))))
;; In no-X builds, dnd.el isn't preloaded.
(autoload 'dnd-begin-file-drag "dnd")
(defun mouse-drag-mode-line (start-event)
"Change the height of a window by dragging on its mode line.
START-EVENT is the starting mouse event of the drag action.

View File

@ -621,7 +621,8 @@ manner suitable for prepending to a user-specified script."
"Find any overlays for IMG-FILE in the current Org buffer, and refresh them."
(dolist (img-overlay org-inline-image-overlays)
(when (string= img-file (plist-get (cdr (overlay-get img-overlay 'display)) :file))
(when (file-exists-p img-file)
(when (and (file-exists-p img-file)
(fboundp 'image-flush))
(image-flush (overlay-get img-overlay 'display))))))
;;-----------------------------------------------------------------------------

View File

@ -294,6 +294,7 @@ smaller according to whether INCREMENT is 1 or -1."
tn))
(declare-function image-size "image.c" (spec &optional pixels frame))
(declare-function image-supported-file-p "image" (file))
(defun thumbs-file-size (img)
(let ((i (image-size