From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: TheFlyingDutchman Newsgroups: gmane.emacs.help Subject: Re: System operating detection Date: Wed, 11 Aug 2010 04:13:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: <82f3212a-bf71-425d-8e5b-c43a56d97d86@l32g2000prn.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291864952 28009 80.91.229.12 (9 Dec 2010 03:22:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 03:22:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 04:22:28 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQX5P-0006K0-Nr for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:22:27 +0100 Original-Received: from localhost ([127.0.0.1]:37980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQX5P-0007ve-3A for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:22:27 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!l32g2000prn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 76.201.171.123 Original-X-Trace: posting.google.com 1281525237 8924 127.0.0.1 (11 Aug 2010 11:13:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 11 Aug 2010 11:13:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l32g2000prn.googlegroups.com; posting-host=76.201.171.123; posting-account=9bWHAAoAAAAxSFC_2O_ssTETNW9NhMbW User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; AskTbBT5/5.8.0.12304),gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:180570 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76537 Archived-At: On Aug 11, 2:06=A0am, Andrea Crotti wrote: > Is there a way to make this ugly thing: > > --8<---------------cut here---------------start------------->8--- > =A0 (defconst sysop > =A0 =A0 (cond > =A0 =A0 =A0((string-match "linux" system-configuration) "linux") > =A0 =A0 =A0((string-match "apple" system-configuration) "mac") > =A0 =A0 =A0((string-match "win" system-configuration) "win") I am using Windows 7 Home Premium and (from Help->About Emacs) "GNU Emacs 23.2.1 (i386-mingw-nt6.1.7600) of 2010-05-08 on G41R2F1", and the value for system-configuration is "i386-mingw-nt6.1.7600". I guess they have changed the format of system-configuration for Windows?? For system-type I have "windows-nt". Maybe sytem-type is a better variable to check?? > =A0 =A0 =A0(t "other"))) > > =A0 (defconst linux (string=3D "linux" sysop)) > =A0 (defconst mac (string=3D "mac" sysop)) > =A0 (defconst win (string=3D "win" sysop)) > =A0 (defconst other (string=3D "other" sysop)) > --8<---------------cut here---------------end--------------->8--- > > looking better? > I would like to have all the constants defined (to nil or t) but > avoiding this ugly repetition. > One (small) problem is that without the "cond" also "darwin" matches > "win", so I get a wrong constant...