From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexis Newsgroups: gmane.emacs.help Subject: Re: way to discriminate between Emacs.app or terminal launch of Emacs in init.el Date: Wed, 19 Aug 2015 21:42:39 +1000 Message-ID: <87si7fld1s.fsf@gmail.com> References: <17805043-1393-49a5-ad64-2010da9b1473@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1439984587 12643 80.91.229.3 (19 Aug 2015 11:43:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Aug 2015 11:43:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 19 13:43:07 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZS1lo-0008MZ-A6 for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Aug 2015 13:43:04 +0200 Original-Received: from localhost ([::1]:33334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS1ln-0005Cf-KR for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Aug 2015 07:43:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS1lb-0005CV-3E for help-gnu-emacs@gnu.org; Wed, 19 Aug 2015 07:42:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZS1lV-0000N3-RC for help-gnu-emacs@gnu.org; Wed, 19 Aug 2015 07:42:50 -0400 Original-Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:34477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS1lV-0000MG-Kb for help-gnu-emacs@gnu.org; Wed, 19 Aug 2015 07:42:45 -0400 Original-Received: by pdbfa8 with SMTP id fa8so822771pdb.1 for ; Wed, 19 Aug 2015 04:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:to:subject:in-reply-to:date:message-id:mime-version :content-type; bh=VDk5OiBwIm/ThHyESezhytkOr21Uo1zXfP7NLmDt13k=; b=ukLkU9ZEcT1BoOFV8CalhteMuHrreTPIPmNvFY6yuShC/PehtkhnLLyUbNYm/LtlM+ DId7UGUC8xS+3sSskZVhOfBim4w9ORXoHi6t6k/RkLOTD/8sa/t2wWlX5atz9xlwt09J Rpq8bjEY+FYBXPapSxJHnjlDc2+KkN7AG87/jfuTgPl6Xuw5ssEZymXG7LPa1p8DEts1 agbIox4JQKsocqPB7r6AKaaGx95BHc8BjowZQ1OIjKD3obA6SiaZsvJH2T1ny6g7TMHB AF4kVWNyQpJxx+hENjr2VxlZp/LFFaVkfUYNDaIdG0j3cdaq0PvY4CgVPIiIPqTR1kkZ aEfA== X-Received: by 10.70.51.65 with SMTP id i1mr24034331pdo.90.1439984564565; Wed, 19 Aug 2015 04:42:44 -0700 (PDT) Original-Received: from localhost (CPE-58-161-15-29.cqqy2.win.bigpond.net.au. [58.161.15.29]) by smtp.gmail.com with ESMTPSA id cr4sm629902pac.10.2015.08.19.04.42.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 04:42:43 -0700 (PDT) In-reply-to: <17805043-1393-49a5-ad64-2010da9b1473@googlegroups.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106708 Archived-At: christopherpenrose@gmail.com writes: > I would like to have a logic switch in init.el that either > detects that I am launching via Terminal in OS X or launching > via Emacs.app on OS X. Is there a way to do this? i'm on Debian Linux, but i use `framep` to detect whether i'm starting `emacsclient` from X or from the console: (framep OBJECT) Return non-nil if OBJECT is a frame. Value is: t for a termcap frame (a character-only terminal), 'x' for an Emacs frame that is really an X window, 'w32' for an Emacs frame that is a window on MS-Windows display, 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, 'pc' for a direct-write MS-DOS frame. Alexis.