unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@glug.org>
Subject: Re: setting email and name for Changelogs in vc mode
Date: Sun, 26 Feb 2006 01:10:31 +0100	[thread overview]
Message-ID: <7eek1rugi0.fsf@ada2.unipv.it> (raw)
In-Reply-To: mailman.0.1140907218.18076.help-gnu-emacs@gnu.org

Angelina Carlton <brat@magma.ca> writes:

> I can't find this in my customize menu's, does someone know
> the correct way?

here is a fragment from the bindings block of a `let' form in
the function `vc-default-update-changelog' (which eventually
is called when you do `C-x v a'):

    (login-name (or user-login-name
                    (format "uid%d" (number-to-string (user-uid)))))

    (full-name (or add-log-full-name
                   (user-full-name)
                   (user-login-name)
                   (format "uid%d"
                           (number-to-string (user-uid)))))

    (mailing-address (or add-log-mailing-address
                         user-mail-address))

for leggibility, i have added a blank line between each of the
three forms.  the car of each form is the name of a temporary
variable that is used elsewhere in the function.  we cannot
set those values directly, only indirectly by munging the
values of variables referenced in the `(or ...)' part of each
binding.

the value of `(or A B C)' depends on which of A, B or C (in
that order) first evaluates to a non-nil value.  evaluation is
done arg by arg; it is a search.

all this means is that we can influence the temporary
variables in several ways in the `(or ...)' form, depending on
where in the search we want the answer to be found.  in a
nutshell: a "naked" symbol is a variable reference -- you can
setq that variable directly.  a symbol surrounded by parens is
evaluated by calling a function by that name w/ no args.

w/ these two guidelines, we can, for example, influence the
`full-name' temporary variable by any of:

  (setq add-log-full-name "J.R.Hacker")
  (defun user-full-name () "J.R.Hacker")
  (defun user-login-name () "J.R.Hacker")
  (defun user-id () 42) ;; assuming J.R.Hacker has uid 42

likewise w/ the other temporary variables.  the thing to
remember is that `or' stops when it finds a form that
evaluates to non-nil.  so if you defun both `user-full-name'
and `user-login-name', the former takes precedence.  (so what
happens if `user-full-name' returns nil? <-- bonus question)

anyway, these are my thoughts browsing the source.

thi

       reply	other threads:[~2006-02-26  0:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.0.1140907218.18076.help-gnu-emacs@gnu.org>
2006-02-26  0:10 ` Thien-Thi Nguyen [this message]
2006-03-01  9:51   ` setting email and name for Changelogs in vc mode Angelina Carlton
2006-03-02 21:59     ` Peter Dyballa
2006-03-03  5:41     ` Ian Zimmerman
2006-03-06  1:54       ` Angelina Carlton
2006-02-25 22:39 Angelina Carlton
2006-02-26 10:17 ` Reiner Steib
2006-03-01  9:09   ` Angelina Carlton
2006-02-27 15:39 ` David Hansen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=7eek1rugi0.fsf@ada2.unipv.it \
    --to=ttn@glug.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).