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: Po Lu
Subject: Re: Use of `window-system' as a predicate is deprecated. Why?
Date: Sat, 09 Jul 2022 20:36:36 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> Hello, Emacs.
>
> The doc string for window-system and its Elisp manual entry say that the
> function should not be used.  The manual entry says:
>
>    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.

Can't you simply test whether or not `term->focus_frame_hook' is 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.
>
> Surely I should not have to go such ridiculous lengths as calling a lisp
> function which has nothing to do with what I need, and then interpreting
> its result.
>
> So, how should I find out whether terminal->focus_frame_hook is valid or
> not, if I'm not allowed to use Fwindow_system?

OTOH, I agree with you completely here.


reply via email to

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