[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of `window-system' as a predicate is deprecated. Why?
From: |
Eli Zaretskii |
Subject: |
Re: Use of `window-system' as a predicate is deprecated. Why? |
Date: |
Sat, 09 Jul 2022 15:40:42 +0300 |
> 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. More generally, if you want to know whether a frame is on a
window-system, use the FRAME_WINDOW_P macro.