all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: Use of `window-system' as a predicate is deprecated.  Why?
Date: Sat, 09 Jul 2022 15:40:42 +0300	[thread overview]
Message-ID: <831quu31dh.fsf@gnu.org> (raw)
In-Reply-To: <YslzEVp5NjdYdOEn@ACM> (message from Alan Mackenzie on Sat, 9 Jul 2022 12:22:41 +0000)

> 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.



  parent reply	other threads:[~2022-07-09 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 12:22 Use of `window-system' as a predicate is deprecated. Why? Alan Mackenzie
2022-07-09 12:36 ` Po Lu
2022-07-09 12:37   ` Po Lu
2022-07-09 12:40 ` Eli Zaretskii [this message]
2022-07-09 13:27   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831quu31dh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.