From: Lars Ingebrigtsen Date: Mon, 22 Aug 2022 17:22:27 +0000 (+0200) Subject: Fix some no-X build warnings X-Git-Tag: emacs-29.0.90~1893^2~92 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06d7161476255c77defa119fffa842b7abaa0dcb;p=emacs.git 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. --- diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index d5bae8f66f8..d3768766be0 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -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" diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el index 277b285c2ef..93749a3451e 100644 --- a/lisp/emacs-lisp/icons.el +++ b/lisp/emacs-lisp/icons.el @@ -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 diff --git a/lisp/image.el b/lisp/image.el index de2afdc2c7b..9311125450a 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 79f421bdcd6..416f7d1ea89 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -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)) diff --git a/lisp/mouse.el b/lisp/mouse.el index bee664dc568..e38a4f8a71a 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -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. diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 831c84befcb..1912f6762ae 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el @@ -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)))))) ;;----------------------------------------------------------------------------- diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3b31f1d8090..0b3d36d6e31 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -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