emacs-devel
[Top][All Lists]
Advanced

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

Re: Use of `window-system' as a predicate is deprecated. Why?


From: Alan Mackenzie
Subject: Re: Use of `window-system' as a predicate is deprecated. Why?
Date: Sat, 9 Jul 2022 13:27:43 +0000

Hello, Eli.

On Sat, Jul 09, 2022 at 15:40:42 +0300, Eli Zaretskii wrote:
> > Date: Sat, 9 Jul 2022 12:22:41 +0000
> > From: Alan Mackenzie <acm@muc.de>

> >    Do _not_ use `window-system' and `initial-window-system' as predicates
> >    or boolean flag variables, if you want to write code that works
> >    differently on text terminals and graphic displays.  That is because
> >    `window-system' is not a good indicator of Emacs capabilities on a
> >    given display type.  Instead, use `display-graphic-p' or any of the
> >    other `display-*-p' predicates described in Display Feature Testing.

> > ..  I am amending minibuf.c and wish to know only whether the current
> > terminal->focus_frame_hook is validly set.

> > The manual entry seems to be to be unnecessarily patronising.  It
> > insinuates that the only possible "capabilities" a user could be
> > interested in are graphic capabilities.

> The ELisp reference manual is written for Lisp programmers, not for
> people who work on the C sources.

:-)

> To check whether terminal->focus_frame_hook is set, test it for being
> non-NULL.

I think I did at one time, and it was set to x_focus_frame, even though I
was on a linux tty.  But maybe I'm mistaken.  Anyway, that doesn't really
matter, because ....

> More generally, if you want to know whether a frame is on a
> window-system, use the FRAME_WINDOW_P macro.

This indeed works well, on a linux tty, and in X Windows, both with and
without -nw.  Thanks!

Just as a matter of interest, I think we're nearly there with bug #56305
"29.0.50; 'yes-or-no-p' deselects minibuffer frame".  There are just one
or two things to clear up with Martin.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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