From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Use of `window-system' as a predicate is deprecated. Why? Date: Sat, 09 Jul 2022 15:40:42 +0300 Message-ID: <831quu31dh.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4600"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 09 14:44:25 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oA9ov-00012w-54 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Jul 2022 14:44:25 +0200 Original-Received: from localhost ([::1]:33984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA9ot-0003xt-LZ for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Jul 2022 08:44:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA9lT-0000y9-8S for emacs-devel@gnu.org; Sat, 09 Jul 2022 08:40:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA9lT-00023R-00; Sat, 09 Jul 2022 08:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ixzPQytgrj5h7RPSqGqMittRasxtCIaU4BNPjYy4jaw=; b=EoiLK1bkwGck LVn50Hle6Mf+JNBf4CpOItIREoJtqbsOJORP0hfiGvBhIB9c9l20ZX7d2LiEiK0GlAOvAg+V4Zh6X b6T9KtP/X/vAnPcQpwVAbflZVJYgODynjU4FSx8tQMMJnWPiFBHwEZkutkYQ7DDxImhz18AAOYkTV +etii9eozw8f68qJri7fTclfn0mk26uWx0JnKkMbrsCyMZvpEH4NYLvt/TRTx1fd4BOMH1vt4SzRl ZgcTDplTpTqMntxYb3T64YWr0yw3UOjSGC7YEEiutuEtxFdq2cjqaPbVtprK6rVrnGpUu1IjjpNZ5 i3sazt4oxOuMcSYeb0IePg==; Original-Received: from [87.69.77.57] (port=2796 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA9lS-0004hJ-Fi; Sat, 09 Jul 2022 08:40:50 -0400 In-Reply-To: (message from Alan Mackenzie on Sat, 9 Jul 2022 12:22:41 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291987 Archived-At: > Date: Sat, 9 Jul 2022 12:22:41 +0000 > From: Alan Mackenzie > > 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.