git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xavier Maillard <zedek@gnu.org>
To: "David Kågedal" <davidk@lysator.liu.se>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn
Date: Wed, 28 Mar 2007 12:29:16 +0200	[thread overview]
Message-ID: <200703281029.l2SATGlZ004563@localhost.localdomain> (raw)
In-Reply-To: <874po54tle.fsf@morpheus.local> (davidk@lysator.liu.se)

Hi David,

   I have a few questions here.  Why do you make a local reference
   (color) to git-blame-colors, but you are still destructively updating
   the list (using delete), possibly making git-blame-colors point to a
   partial ruin of the original list?  My original version may look
   similar, but pop is only destructive on the variable it is popping
   from.  Any other references to the original list will be intact.

   Remember that git-blame-colors is a buffer-local variable, but if it
   points to a global list, any destructive changes will mess up the
   global list.

You are damned right ! I did not check this before.

   I'd prefer something like this:

       (let ((color (if colors
		      (elt colors (random (length colors)))
		     git-blame-ancient-color)))

I agree too.

I hope the next patch will be the last for this "feature" :)
Thank you very much for all your comments.

Xavier

  reply	other threads:[~2007-03-28 11:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 21:01 [PATCH 2/2] git-blame.el: pick a set of random colors when blaming Xavier Maillard
2007-03-27  8:44 ` David Kågedal
2007-03-27 15:31   ` Xavier Maillard
2007-03-28  8:49     ` David Kågedal
2007-03-27 21:51   ` [PATCH] git-blame.el: pick a set of random colors for each git-blame turn Xavier Maillard
2007-03-28  9:15     ` David Kågedal
2007-03-28 10:29       ` Xavier Maillard [this message]
2007-03-28 10:31       ` Xavier Maillard
2007-03-28 12:02         ` David Kågedal
2007-03-28 16:44           ` Xavier Maillard
2007-03-29  9:26             ` David Kågedal
2007-03-29  9:59               ` Xavier Maillard
  -- strict thread matches above, loose matches on Subject: below --
2007-03-27 20:09 Xavier Maillard

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=200703281029.l2SATGlZ004563@localhost.localdomain \
    --to=zedek@gnu.org \
    --cc=davidk@lysator.liu.se \
    --cc=git@vger.kernel.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 NNTP newsgroup(s).