unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 'Eli Zaretskii' <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: how to use graphic-display-p and window-system
Date: Fri, 17 Apr 2009 19:54:08 -0400	[thread overview]
Message-ID: <jwvy6tyluf0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <000001c9bf99$47732600$0200a8c0@us.oracle.com> (Drew Adams's message of "Fri, 17 Apr 2009 13:15:36 -0700")

>> 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.
> So what is it related to then?

Nothing.  Using C-x @ [Ssachm], you can create pretty much any
combination of key and modifiers in any frame.

So your notion of "fancy keys" is not a hard-and-fast one: it can only
be a heuristic.  If window-system is one of w32, x, ns then you can
probably assume that most key combos are easily feasible (tho it
actually still depends on the keyboard in use, etc...), if it's nil (but
running under w32), then those combos are probably still possible.
Under DOS, window-system is not nil, but I don't know how ckey combos
can be entered.  Under xterm, window-system is nil, and many/most key
combos can also be used nowadays (and you can configure xterm&emacs for
most/all of the missing ones).

The general solution is to not try to answer the question: instead, make
sure you provide a "guaranteed" binding (i.e. a binding that only uses
keys that are known to work pretty much everywhere), and once that's
done you may also provide another binding using a less standard key.

> 1. General colors vs no colors or limited set of colors (e.g. 256).

`display-color-cells'.

> 2. General keys vs no modifiers for keys such as TAB, insert, and
>    prior.  This means also distinguishing between, say, C-l and C-S-l.

Fundamentally impossible.

> On a related note, in Emacs releases prior to those that have
> `display-mouse-p', `display-graphic-p', etc. what are the proper tests
> to use for such things?

There aren't any.

> Is `window-system' as good as it gets for Emacs 20/21?

Pretty much, yes.

> There might of course be some out-of-date uses of `window-system' in
> the Emacs 23 source code.

Yes, there are many.


        Stefan




  reply	other threads:[~2009-04-17 23:54 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
2009-04-17 20:15       ` Drew Adams
2009-04-17 23:54         ` Stefan Monnier [this message]
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=jwvy6tyluf0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --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).