These came to light in the contexts of bug#29713 and bug#47234.
* lisp/emulation/edt-mapper.el (edt-xserver):
* lisp/emulation/edt.el (edt-xserver):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/nnimap.el (nnimap-map-port):
* lisp/term/w32-win.el:
* lisp/image.el (image--get-imagemagick-and-warn):
* lisp/frame.el (frame-notice-user-settings): Declare functions that
are known to be present at runtime in GUI builds.
(make-frame-on-display): Signal more informative error when called
interactively in a non-GUI build (bug#29713).
* lisp/international/mule-diag.el (describe-font):
* lisp/org/org-macs.el (org--string-from-props): Pacify warnings
about unknown functions in non-GUI bilds.
* lisp/mh-e/mh-mime.el (mh-small-image-p): Avoid eliminating fboundp
check in non-GUI builds, to pacify unused lexical variable warning.
* lisp/net/newst-plainview.el (newsticker--plainview-tool-bar-map):
* lisp/net/newst-treeview.el (newsticker-treeview-tool-bar-map):
Declare tool-bar-map as a special variable in non-GUI builds.
(define-obsolete-variable-alias 'edt-window-system 'window-system "27.1")
(defconst edt-xserver (when (eq window-system 'x)
+ (declare-function x-server-vendor "xfns.c"
+ (&optional terminal))
;; The Cygwin window manager has a `/' in its
;; name, which breaks the generated file name of
;; the custom key map file. Replace `/' with a
;;; o edt-emulation-on o edt-load-keys
;;;
(defconst edt-xserver (when (eq window-system 'x)
+ (declare-function x-server-vendor "xfns.c"
+ (&optional terminal))
;; The Cygwin window manager has a `/' in its
;; name, which breaks the generated file name of
;; the custom key map file. Replace `/' with a
;; by the lines added in x-create-frame for the tab-bar and
;; switch `tab-bar-mode' off.
(when (display-graphic-p)
+ (declare-function tab-bar-height "xdisp.c" (&optional frame pixelwise))
(let* ((init-lines
(assq 'tab-bar-lines initial-frame-alist))
(other-lines
(defun make-frame-on-display (display &optional parameters)
"Make a frame on display DISPLAY.
The optional argument PARAMETERS specifies additional frame parameters."
- (interactive (list (completing-read
- (format "Make frame on display: ")
- (x-display-list))))
+ (interactive (if (fboundp 'x-display-list)
+ (list (completing-read
+ (format "Make frame on display: ")
+ (x-display-list)))
+ (user-error "This Emacs build does not support X displays")))
(make-frame (cons (cons 'display display) parameters)))
(defun make-frame-on-current-monitor (&optional parameters)
"Rescale IMAGE to SIZE if possible.
SIZE is in format (WIDTH . HEIGHT). Return a new image.
Sizes are in pixels."
- (if (not (display-graphic-p))
- image
+ (when (display-images-p)
+ (declare-function image-size "image.c" (spec &optional pixels frame))
(let ((new-width (car size))
(new-height (cdr size)))
(when (> (cdr (image-size image t)) new-height)
:max-height new-height)))
(when (> (car (image-size image t)) new-width)
(setq image (create-image (plist-get (cdr image) :data) nil t
- :max-width new-width)))
- image)))
+ :max-width new-width)))))
+ image)
(defun gnus-recursive-directory-files (dir)
"Return all regular files below DIR.
;; This is only needed for Windows XP or earlier
(defun nnimap-map-port (port)
+ (declare-function x-server-version "xfns.c" (&optional terminal))
(if (and (eq system-type 'windows-nt)
(<= (car (x-server-version)) 5)
(equal port "imaps"))
image))
(defun image--get-imagemagick-and-warn (&optional position)
+ (declare-function image-transforms-p "image.c" (&optional frame))
(unless (or (fboundp 'imagemagick-types) (image-transforms-p))
(error "Cannot rescale images on this terminal"))
(let ((image (image--get-image position)))
(list (completing-read
"Font name (default current choice for ASCII chars): "
(and window-system
+ ;; Implied by `window-system'.
+ (fboundp 'x-list-fonts)
(fboundp 'fontset-list)
;; The final element in `fontset-list' is a default
;; (generic) one, so don't include that.
(funcall media-test handle) ; Since mm-inline-large-images is T,
; this only tells us if the image is
; something that emacs can display
- (let* ((image (mm-get-image handle)))
+ (let ((image (mm-get-image handle)))
(or (mh-do-in-xemacs
(and (mh-funcall-if-exists glyphp image)
(< (glyph-width image)
(or mh-max-inline-image-height
(window-pixel-height)))))
(mh-do-in-gnu-emacs
- (let ((size (mh-funcall-if-exists image-size image)))
+ (let ((size (and (fboundp 'image-size) (image-size image))))
(and size
(< (cdr size) (or mh-max-inline-image-height
(1- (window-height))))
(defvar newsticker--plainview-tool-bar-map
(when (boundp 'tool-bar-map)
+ (defvar tool-bar-map)
(let ((tool-bar-map (make-sparse-keymap)))
(tool-bar-add-item "newsticker/prev-feed"
'newsticker-previous-feed
;; ======================================================================
(defvar newsticker-treeview-tool-bar-map
(when (boundp 'tool-bar-map)
+ (defvar tool-bar-map)
(let ((tool-bar-map (make-sparse-keymap)))
(tool-bar-add-item "newsticker/prev-feed"
'newsticker-treeview-prev-feed
(let ((width (plist-get props :width)))
(and (wholenump width) width)))
(`(image . ,_)
- (ceiling (car (image-size spec))))
+ (and (fboundp 'image-size)
+ (ceiling (car (image-size spec)))))
((pred stringp)
;; Displayed string could contain invisible parts,
;; but no nested display.
This alist is used by w32font.c when it looks for fonts that can display
characters from scripts for which no USBs are defined.")
+(declare-function x-list-fonts "xfaces.c"
+ (pattern &optional face frame maximum width))
+
(defun w32-find-non-USB-fonts (&optional frame size)
"Compute the value of `w32-non-USB-fonts' for specified SIZE and FRAME.
FRAME defaults to the selected frame.