From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Renato Newsgroups: gmane.emacs.help Subject: Re: code listp to determine wich os I'm running on Date: Wed, 29 Jan 2014 23:12:58 +0100 Message-ID: <52E97CEA.4060901@gmail.com> References: <87mwiettum.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1391033594 7749 80.91.229.3 (29 Jan 2014 22:13:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jan 2014 22:13:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 29 23:13:21 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 1W8dNn-0007ip-4L for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 23:13:19 +0100 Original-Received: from localhost ([::1]:45449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8dNm-00060s-N7 for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 17:13:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8dNU-00060G-Hr for help-gnu-emacs@gnu.org; Wed, 29 Jan 2014 17:13:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8dNL-0007YO-Tr for help-gnu-emacs@gnu.org; Wed, 29 Jan 2014 17:13:00 -0500 Original-Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:57336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8dNL-0007YH-Le for help-gnu-emacs@gnu.org; Wed, 29 Jan 2014 17:12:51 -0500 Original-Received: by mail-ee0-f54.google.com with SMTP id e53so1216187eek.13 for ; Wed, 29 Jan 2014 14:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=XwFrfAadxwTFf95ZbT0DyoMvhDiZb21Y6uN4WrLYlsE=; b=AXpnbPparftmzO/x4euqevCaHYYh4IZPuCzdVxB/V+aBkHMuEZcN3JrJfd0UlyAwf1 F7YgQXBAEmSbOWynGVWwWKarJaTFSwlEmxHQGfrXZW7SbLKVTlHgeuBwPpJvL7ESlKl0 E8uVB4tgGVQpTWW2Q6CQ8j6IwDlDXqXJq3FowO3U2XJv+LG8gKQHxUgS6LXUQaOocBLZ emz/syeiV/bYjoiU/nWwXmQOvfgO2Lsg2eMKI8ZuWCDZ6E3X6dvb2VuWZZwM51V7Y810 LTPeif6L7q9BIKgcOt+TMFo8VN1VStaWp1CDLlISPnnOHQEBMo/bYwtnGv3Qc9+Pzmko rdEA== X-Received: by 10.14.198.132 with SMTP id v4mr6861081een.43.1391033570904; Wed, 29 Jan 2014 14:12:50 -0800 (PST) Original-Received: from [192.168.1.6] ([93.69.40.104]) by mx.google.com with ESMTPSA id w4sm14324355eef.20.2014.01.29.14.12.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 14:12:49 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 In-Reply-To: <87mwiettum.fsf@nl106-137-194.student.uu.se> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::236 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:95767 Archived-At: Sorry Emanuel... what's wrong? (if (string= system-type "gnu/linux") (setq percorso-variable "\home\renato\Dropbox\emacs_prof\") (message "fatto")) (if (string= system-type "windows-nt") (setq percorso "c:/doc/Dropbox") )) It does,t works... :-( Renato On 29/01/2014 21:28, Emanuel Berg wrote: > Renato writes: > >> Hi, I'm looking for some code to insert in my .emacs >> to determine wich s.o I'm running. ... > Instead of `string-equal', there is string= which is an > alias for `string-equal'. Might be faster to type and > takes less place. > > You don't need to use progn for a single form. Use > progn when you want to execute a bunch of forms, and > then have the *last* form's value to be the evaluation > of the whole progn form. This is what the "n" is - > execute n programs, and return the value of the last > (the "nth"). Compare: prog1 > > (progn 1 2 3) ; 3 > (prog1 1 2 3) ; 1 > > The if in Lisp looks like this: > > (if condition then else) > > E.g., (if (> x y) x y) => x, if x is bigger than y, > else y. (You may omit the "else" part if it is `nil', > since then the whole if form will evaluate to nil > anyway, if not the condition is true.) > > But you already used `cond'. `cond' and if are the > same: cond is nested ifs, if you like. To you, as a > programmer, it doesn't matter if cond is syntactic > sugar for `if', or if it is the other way around. This > only matters to the guy not programming Lisp programs, > but the Lisp system itself. > > (if (string= system-type "gnu/linux") > (setq some-variable "...") > (if (string= system-type "...") > (setq some-variable "...") )) > > Or with `cond': > > (setq some-variable > (cond ((string= system-type "gnu/linux") 'value-1) > ((string= system-type "...") 'value-2) )) > > And so on. (You can do this in any way you like.) > > You don't need to do the F1 maneuver to check > results. Just place point (the cursor) to the right of > the right-most paren, then hit `C-x C-e' (for > `eval-last-sexp'). This also works for symbols > (variables). > > With the load-path though - do you really need to set > it? >