From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: how to load code conditional on uid Date: Sat, 12 Nov 2011 05:19:52 -0600 Organization: Still searching... Message-ID: <87sjltpoyv.fsf@newsguy.com> References: <87obwiwzp5.fsf@newsguy.com> <4C03066C51894FF99AF38EF210C163C4@us.oracle.com> <87fwhuwuid.fsf@newsguy.com> <25A96022A47D447E98E0AECF431157CE@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321096852 25975 80.91.229.12 (12 Nov 2011 11:20:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2011 11:20:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 12 12:20:47 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RPBde-0003JG-PI for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Nov 2011 12:20:46 +0100 Original-Received: from localhost ([::1]:55552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPBdd-00080w-U6 for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Nov 2011 06:20:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPBda-00080q-63 for help-gnu-emacs@gnu.org; Sat, 12 Nov 2011 06:20:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPBdY-0005R1-My for help-gnu-emacs@gnu.org; Sat, 12 Nov 2011 06:20:42 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:60121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPBdY-0005Qx-D5 for help-gnu-emacs@gnu.org; Sat, 12 Nov 2011 06:20:40 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RPBdU-0003El-3m for help-gnu-emacs@gnu.org; Sat, 12 Nov 2011 12:20:36 +0100 Original-Received: from c-98-215-179-64.hsd1.in.comcast.net ([98.215.179.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Nov 2011 12:20:36 +0100 Original-Received: from reader by c-98-215-179-64.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Nov 2011 12:20:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-98-215-179-64.hsd1.in.comcast.net User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:dZNhz7fGKJehigU8VnxR+GaLfEY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:82874 Archived-At: "Drew Adams" writes: > What do you want to test? Whether the current `user-uid' is a > member of that list? If so, use function `member' - do not use > function `=' which tests whether two numbers are equal. C-h f member shows something that for a lightweight like me is your basic greek. ,---- | member is a built-in function in `C source code'. | | (member ELT LIST) | | Return non-nil if ELT is an element of LIST. Comparison done with `equal'. | The value is actually the tail of LIST whose car is ELT. `---- Doing an index search in `emacs-lisp-intro' on `member' shows no hits so apparently it is not used or explained in that document. Not sure how I would find out what ELT means. A quick index search in Elisp manaual on ELT shows: ,---- | -- Function: elt sequence index | This function returns the element of SEQUENCE indexed by INDEX. | Legitimate values of INDEX are integers ranging from 0 up to one | less than the length of SEQUENCE. If SEQUENCE is a list, | out-of-range values behave as for `nth'. *Note Definition of | nth::. Otherwise, out-of-range values trigger an | `args-out-of-range' error. | [...] `---- Well, that didn't help (me) much. Other than to indicate ELT is short for element. But at a glance it sounds as if it could be a uid like 1000 or maybe (user-uid). So a couple of clumsy experiments show I've got it all wrong. (when (member 1000 (1000 1001 1002)) (add-to-list 'load-path ...) (add-to-list 'load-path ...)) or maybe (when (member (user-uid) (1000 1001 1002)) (add-to-list 'load-path ...) (add-to-list 'load-path ...))