From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: code listp to determine wich os I'm running on Date: Wed, 29 Jan 2014 18:43:35 -0800 (PST) Message-ID: <5787a521-407a-43ff-aaae-cf7b3caaa2a3@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1391049911 17875 80.91.229.3 (30 Jan 2014 02:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jan 2014 02:45:11 +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 Jan 30 03:45:19 2014 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 1W8hd0-0002dO-GQ for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 03:45:18 +0100 Original-Received: from localhost ([::1]:46158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8hd0-0004ro-5T for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 21:45:18 -0500 X-Received: by 10.182.216.200 with SMTP id os8mr4550723obc.0.1391049816027; Wed, 29 Jan 2014 18:43:36 -0800 (PST) X-Received: by 10.50.79.228 with SMTP id m4mr217576igx.9.1391049815862; Wed, 29 Jan 2014 18:43:35 -0800 (PST) Original-Path: usenet.stanford.edu!c10no5119343igq.0!news-out.google.com!vg8ni1igb.0!nntp.google.com!c10no5119341igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.95.11.38; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 59.95.11.38 User-Agent: G2/1.0 Injection-Date: Thu, 30 Jan 2014 02:43:35 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:203514 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:95783 Archived-At: On Thursday, January 30, 2014 12:11:00 AM UTC+5:30, Renato wrote: > Hi, > I'm looking for some code to insert in my .emacs to determine wich s.o > I'm running. > 've foud this code: > _______________________________________ > ;; check OS type (cond((string-equalsystem-type"windows-nt") ; Microsoft > Windows (progn(message"Microsoft Windows") ) ) > ((string-equalsystem-type"darwin") ; Mac OS X (progn(message"Mac OS X") > ) ) ((string-equalsystem-type"gnu/linux") ; linux (progn(message"Linux") > ) ) ) > ________________________ > but I do't know lisp (I will learn it, of course...but not now...) > I've understand that if I'm running Linux if I press F1-e, in the buffer > I can read "linux". > But What do I have to do to set a particular path (setq load-path... to > start from if I click > for my C-x f in emacs on linux or win? Heres your code written a little more legibly and which you are trying to write as using if (cond ((string= system-type "windows-nt") (message "Microsoft Windows")) ((string= system-type "darwin") (message "Darwin")) ((string= system-type "gnu/linux") (message "Gnu/Linux")) (t (message "Unknown system"))) [Ive only checked on linux] Now you can replace those (message "...") calls with what you like Mind you though setting load-path with a setq is a BAD idea usually better to make small additions like this (add-to-list 'load-path "~/.emacs.d/downloads") Replace the string with whatever you want to add to the load-path