all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to load code conditional on uid
Date: Fri, 11 Nov 2011 16:46:37 -0600	[thread overview]
Message-ID: <87y5vmuvjm.fsf@newsguy.com> (raw)
In-Reply-To: 25A96022A47D447E98E0AECF431157CE@us.oracle.com

"Drew Adams" <drew.adams@oracle.com> 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.




  reply	other threads:[~2011-11-11 22:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 13:33 how to load code conditional on uid Harry Putnam
2011-11-11 14:44 ` Drew Adams
2011-11-11 15:26   ` Harry Putnam
2011-11-11 15:45     ` Drew Adams
2011-11-11 22:46       ` Harry Putnam [this message]
2011-11-12 11:19       ` Harry Putnam
2011-11-12 14:36         ` Drew Adams
2011-11-13 23:14           ` Harry Putnam
     [not found] <mailman.258.1321018489.798.help-gnu-emacs@gnu.org>
2011-11-12  2:40 ` Jason Rumney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5vmuvjm.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.