[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29713: 26.0; Provide completion for `make-frame-on-display'
From: |
Eli Zaretskii |
Subject: |
bug#29713: 26.0; Provide completion for `make-frame-on-display' |
Date: |
Thu, 18 Mar 2021 16:36:24 +0200 |
> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Date: Thu, 18 Mar 2021 14:02:00 +0000
> Cc: 29713@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
>
> 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?
For which use case?
In a build --without-x asking about available displays makes no sense,
because such a build cannot possibly access any displays. Right?
In a GUI session, the function is always available, although the list
it returns might disappoint w32 users...
> (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?
make-frame-on-display should signal an error in non-GUI builds.
bug#29713: 26.0; Provide completion for `make-frame-on-display', Basil L. Contovounesios, 2021/03/24