From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: (window-system) returns nil on after-make-frame-functions when creating an X frame Date: Mon, 9 Mar 2009 10:36:47 -0700 (PDT) Message-ID: <200903091736.n29Halor018951@rodan.ics.uci.edu> References: <20090309170208.GA6650@reforged> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236620238 26042 80.91.229.12 (9 Mar 2009 17:37:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Mar 2009 17:37:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Mike Mattie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 09 18:38:35 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from terminus-est.gnu.org ([66.92.78.210] helo=lists.gnu.org) by lo.gmane.org with esmtp (Exim 4.50) id 1LgjQs-000848-2d for ged-emacs-devel@m.gmane.org; Mon, 09 Mar 2009 18:38:30 +0100 Original-Received: from localhost ([127.0.0.1]:55791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgjPW-00022d-3T for ged-emacs-devel@m.gmane.org; Mon, 09 Mar 2009 13:37:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgjPP-0001xx-Ll for emacs-devel@gnu.org; Mon, 09 Mar 2009 13:36:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgjPL-0001o3-HQ for emacs-devel@gnu.org; Mon, 09 Mar 2009 13:36:59 -0400 Original-Received: from [199.232.76.173] (port=59677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgjPL-0001nk-D3 for emacs-devel@gnu.org; Mon, 09 Mar 2009 13:36:55 -0400 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:42137) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LgjPL-00011t-2t for emacs-devel@gnu.org; Mon, 09 Mar 2009 13:36:55 -0400 Original-Received: from rodan.ics.uci.edu (rodan.ics.uci.edu [128.195.6.9]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n29Hal9v020056; Mon, 9 Mar 2009 10:36:47 -0700 (PDT) Original-Received: (from dann@localhost) by rodan.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n29Halor018951; Mon, 9 Mar 2009 10:36:47 -0700 (PDT) In-Reply-To: <20090309170208.GA6650@reforged> (Mike Mattie's message of "Mon, 9 Mar 2009 10:02:12 -0700") Original-Lines: 23 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n29Hal9v020056 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@rodan.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:109523 Archived-At: Mike Mattie writes: > Hi, > > The behavior of (window-system) as it stands has a corner-case that > does not make sense. > > I run a function on after-make-frame-functions that loads my GUI configuration > (previously discussed). > > To make sure it runs only when a X frame is created, vs. a TTY I would check > that it is an X frame. > > To do this I called (window-system) which normally returns "x". It is not > the best idea, but intuitively after the X frame is created it would sensibly > return "x". > > Currently it returns nil. When (window-system) is evaluated in the scratch > buffer sometime after the frame is made, well after after-make-frame-functions > it does indeed return "x". How are you calling (window-system) ? You should be calling it from within a `with-selected-frame'