From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: how to use graphic-display-p and window-system Date: Fri, 17 Apr 2009 21:15:19 +0300 Message-ID: <83d4bbjgeg.fsf@gnu.org> References: <834owro4ha.fsf@gnu.org> <001a01c9bf83$38bd2270$0200a8c0@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1239992980 10404 80.91.229.12 (17 Apr 2009 18:29:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Apr 2009 18:29:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 17 20:30:59 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Luspl-0004e6-0q for ged-emacs-devel@m.gmane.org; Fri, 17 Apr 2009 20:30:45 +0200 Original-Received: from localhost ([127.0.0.1]:56726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LusoL-0006C6-33 for ged-emacs-devel@m.gmane.org; Fri, 17 Apr 2009 14:29:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lusc0-0000qj-Ro for emacs-devel@gnu.org; Fri, 17 Apr 2009 14:16:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lusbz-0000py-JE for emacs-devel@gnu.org; Fri, 17 Apr 2009 14:16:28 -0400 Original-Received: from [199.232.76.173] (port=52113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lusbz-0000pn-Bd for emacs-devel@gnu.org; Fri, 17 Apr 2009 14:16:27 -0400 Original-Received: from mtaout7.012.net.il ([84.95.2.19]:21429) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lusby-0006CZ-UJ for emacs-devel@gnu.org; Fri, 17 Apr 2009 14:16:27 -0400 Original-Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KI900M00BU5TX00@i-mtaout7.012.net.il> for emacs-devel@gnu.org; Fri, 17 Apr 2009 21:15:18 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.126.183.184]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KI90056CC1H1C90@i-mtaout7.012.net.il>; Fri, 17 Apr 2009 21:15:18 +0300 (IDT) In-reply-to: <001a01c9bf83$38bd2270$0200a8c0@us.oracle.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110328 Archived-At: > From: "Drew Adams" > Date: Fri, 17 Apr 2009 10:37:45 -0700 > > > You mean, on graphic displays. Please use `display-graphic-p' > > rather than assuming that if `window-system' is non-nil, the > > display is necessarily a graphic one. At least one Emacs > > configuration violates this assumption. > > I'm not familiar with `display-graphic-p'. I've been using `window-system' to > distinguish Emacs running in a console/terminal from Emacs running with a window > mgr. Well, I learn something new now and then. Sounds like today's your turn ;-) > In particular, I want to check whether Emacs supports keys such as S-TAB. That's totally unrelated to window-system or the display being graphic. For example, on MS-Windows, S-TAB is supported even under "-nw", where window-system and display-graphic-p are both nil. > [Excuse me if console/terminal is not the right terminology, but I'm talking > about Emacs with no fancy keys such as S-TAB and less graphic support (colors, > fonts etc.) versus Emacs with no such limitations.] Colors nowadays are also orthogonal to window-system and display-graphic-p: for example, there's the 256-color xterm, where the number of colors is indistinguishable from a GUI display, but window-system is nil and so is what display-graphic-p returns. > `display-graphic-p' has apparently been with us since Emacs 22, but there is no > mention of it in the Elisp manual, even in Emacs 23. ??? Are you looking at a stale ELisp manual, perhaps? I typed "i display-graphic-p RET" and landed in a node named "Display Feature Testing" that documents this predicate. This documentation exists since the day the predicate itself was added to Emacs (which, btw, was during Emacs 21 development, not since Emacs 22). > Could someone please summarize the differences between the two, and when to use > one or the other? The only situation I know of where use of window-system is justified is when you want to distinguish between the different kinds of window systems, like between X and MS-Windows. In all other cases, you are well advised to use the APIs documented in the above-mentioned node of the ELisp manual. As for testing whether ``fancy'' keys are supported, I don't know how to do that in Emacs. Maybe someone else can suggest a way. But window-system is certainly not the way of doing that in a portable manner.