unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: how to use graphic-display-p and window-system
Date: Fri, 17 Apr 2009 21:15:19 +0300	[thread overview]
Message-ID: <83d4bbjgeg.fsf@gnu.org> (raw)
In-Reply-To: <001a01c9bf83$38bd2270$0200a8c0@us.oracle.com>

> From: "Drew Adams" <drew.adams@oracle.com>
> 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.




  reply	other threads:[~2009-04-17 18:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m28wm31ock.fsf@nschum.de>
     [not found] ` <834owro4ha.fsf@gnu.org>
2009-04-17 17:37   ` how to use graphic-display-p and window-system Drew Adams
2009-04-17 18:15     ` Eli Zaretskii [this message]
2009-04-17 20:15       ` Drew Adams
2009-04-17 23:54         ` Stefan Monnier
2009-04-18  0:19           ` Drew Adams
2009-04-18  3:41             ` Stefan Monnier
2009-04-18  4:25               ` Drew Adams
2009-04-18  0:21           ` Miles Bader
2009-04-18  3:43             ` Stefan Monnier
2009-04-18  4:24               ` Drew Adams
2009-04-18  5:11               ` Miles Bader
2009-04-18  6:34           ` Eli Zaretskii
2009-04-18  7:01         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83d4bbjgeg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drew.adams@oracle.com \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).