From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: how to use graphic-display-p and window-system Date: Fri, 17 Apr 2009 19:54:08 -0400 Message-ID: References: <834owro4ha.fsf@gnu.org> <001a01c9bf83$38bd2270$0200a8c0@us.oracle.com> <83d4bbjgeg.fsf@gnu.org> <000001c9bf99$47732600$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240012471 2937 80.91.229.12 (17 Apr 2009 23:54:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Apr 2009 23:54:31 +0000 (UTC) Cc: 'Eli Zaretskii' , emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 18 01:55:50 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 1LuxuO-0001Wn-Ea for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2009 01:55:48 +0200 Original-Received: from localhost ([127.0.0.1]:51922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Luxsz-0004g0-FM for ged-emacs-devel@m.gmane.org; Fri, 17 Apr 2009 19:54:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Luxsv-0004fv-LL for emacs-devel@gnu.org; Fri, 17 Apr 2009 19:54:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Luxsq-0004fi-LQ for emacs-devel@gnu.org; Fri, 17 Apr 2009 19:54:16 -0400 Original-Received: from [199.232.76.173] (port=34405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Luxsq-0004ff-Ip for emacs-devel@gnu.org; Fri, 17 Apr 2009 19:54:12 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:34671 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Luxso-0008WG-Lw; Fri, 17 Apr 2009 19:54:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsFAE6z6ElLd+7D/2dsb2JhbACBTs1Vg30GhSk X-IronPort-AV: E=Sophos;i="4.40,206,1238990400"; d="scan'208";a="37245700" Original-Received: from 75-119-238-195.dsl.teksavvy.com (HELO pastel.home) ([75.119.238.195]) by ironport2-out.teksavvy.com with ESMTP; 17 Apr 2009 19:54:09 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 000847EFC; Fri, 17 Apr 2009 19:54:08 -0400 (EDT) In-Reply-To: <000001c9bf99$47732600$0200a8c0@us.oracle.com> (Drew Adams's message of "Fri, 17 Apr 2009 13:15:36 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:110332 Archived-At: >> 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