bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#29713: 26.0; Provide completion for `make-frame-on-display'


From: Basil L. Contovounesios
Subject: bug#29713: 26.0; Provide completion for `make-frame-on-display'
Date: Thu, 18 Mar 2021 14:02:00 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

>>> Subject line says it all.  Gather the displays using, say,
>>> `x-display-list' and use them as completion candidates.
>>> (I don't use X Window, so I won't have more to say about this.)
> Maybe it could use `x-display-list'.  But I don't know how portable it is.
> Is `x-display-list' available on OSX and Windows?

It's not available on --without-x builds:

0. ./src/emacs -Q
1. M-x toggle-debug-on-error RET
2. M-x make-frame-on-display RET
   Debugger entered--Lisp error: (void-function x-display-list)

What's TRT here?

  (interactive (list (completing-read
                      (format "Make frame on display: ")
                      (if (fboundp 'x-display-list)
                          (x-display-list)
                        (user-error "No connected displays found")))))

This will barf before make-frame is called, and pacifies the
byte-compiler warning about x-display-list not being known.

  (interactive (list (completing-read
                      (format "Make frame on display: ")
                      (and (fboundp 'x-display-list)
                           (x-display-list)))))

This will barf when make-frame is called, with e.g.:

  make-frame: Don’t know how to interpret display ""
  make-frame: Don’t know how to interpret display ":0"

And also pacifies the warning.

Any preferences or alternative suggestions?

Thanks,

-- 
Basil





reply via email to

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