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: Fri, 11 Nov 2011 16:46:37 -0600 Organization: Still searching... Message-ID: <87y5vmuvjm.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 1321051653 20613 80.91.229.12 (11 Nov 2011 22:47:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Nov 2011 22:47:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 11 23:47:29 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 1ROzsf-0005Gs-3a for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 23:47:29 +0100 Original-Received: from localhost ([::1]:58639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROzse-0006xC-Cf for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 17:47:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROzsZ-0006wv-NY for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 17:47:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROzsY-0000ut-KR for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 17:47:23 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:49698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROzsY-0000sk-A0 for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 17:47:22 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1ROzsV-0005D4-7m for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 23:47:19 +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 ; Fri, 11 Nov 2011 23:47:19 +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 ; Fri, 11 Nov 2011 23:47:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 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:O+mdkzd2T9GoMff8TZhoDInd0y0= 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:82863 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. First, its a single user machine but I invent users from time to time to test various things. Over the years, being a single user all along... I've developed the bad habit of misusing site-start.el and putting quite a lot of stuff in there that really should be in users' ~/.emacs or the like. So to do some testing, kind of suddenly, rather than go thru and really clean up site-start.el from top to bottom, which would take me a while I thought I might just put conditionals where I didn't want a newly invented user to evaluate stuff and thereby still be able to test whatever right now. (Putting off the inevitable clean up of site-start.el till later) The general aim was to have a conditional ahead of some elisp code so that only 1 user's (me) emacs instance would evaluate it. And in fact that is about all I really needed to do, so, I started out just wanting to test for a number like your first example does. After posting about that and seeing your nifty answer, it occurred to me that there may be occasion where I'd want several, but not all, newly invented users to be allowed to eval stuff. My programming background is so thin that I did not recognize what should have been obvious (given the equals (=) sign) and got the foolish notion I might be able to pass several uid to that same kind of conditional. I'm very delighted with your detailed explanations, you've made a number of things clear[er] and provided a nice jumpstart for my weak adventures with elisp. Consequently, I've already learned how to allow one user to eval something, and now how to allow a list of users to do the same thing. Clearly I have a lot to catch up on and will have to take a lot more baby steps with close attention to the lisp-intro as I go. Thanks again for your patient hand holding.