{"thread":{"id":"7416","subject":"[PATCH 2/2] git-blame.el: pick a set of random colors when blaming","startedAt":"2007-03-26T21:01:54Z","lastAt":"2007-03-29T09:59:26Z","messageCount":12,"participants":["Xavier Maillard","David Kågedal"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"38073","messageId":"200703262101.l2QL1sGL012549@localhost.localdomain","threadId":"7416","inReplyTo":null,"subject":"[PATCH 2/2] git-blame.el: pick a set of random colors when blaming","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-26T21:01:54Z","receivedAt":"2007-03-26T21:01:54Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"\nI thought it would be cooler to have different set of colors each time\nI blame.\n\n* Prevent (future possible) namespace clash by renaming `color-scale'\ninto `git-blame-color-scale'. Definition has been changed to be more\nin the \"lisp\" way (thanks for help goes to #emacs). Also added a small\ndescription of what it does.\n\n* Added docstrings at some point and instructed defvar when a variable\nwas candidate to customisation by users.\n\n* Added fix to silent byte-compilers (git-blame-file,\ngit-blame-current)\n\n* Do not require 'cl at startup.\n\n* Added more informations on compatibility\n\nSigned-off-by: Xavier Maillard <zedek@gnu.org>\n---\n contrib/emacs/git-blame.el |   71 +++++++++++++++++++++++++++----------------\n 1 files changed, 44 insertions(+), 27 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex bd87a86..6d0c1b0 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -8,8 +8,8 @@\n ;; License:    GPL\n ;; Keywords:   git, version control, release management\n ;;\n-;; Compatibility: Emacs21\n-\n+;; Compatibility: Emacs21, Emacs22 and EmacsCVS\n+;;                Git 1.5 and up\n \n ;; This file is *NOT* part of GNU Emacs.\n ;; This file is distributed under the same terms as GNU Emacs.\n@@ -61,8 +61,9 @@\n \n ;;; Compatibility:\n ;;\n-;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n-;; changing this:\n+;; It requires GNU Emacs 21 or later and Git 1.5.0 and up\n+;; \n+;; If you'are using Emacs 20, try changing this:\n ;;\n ;;            (overlay-put ovl 'face (list :background\n ;;                                         (cdr (assq 'color (cddddr info)))))\n@@ -77,30 +78,43 @@\n ;;\n ;;; Code:\n \n-(require 'cl)\t\t\t      ; to use `push', `pop'\n-\n-(defun color-scale (l)\n-  (let* ((colors ())\n-         r g b)\n-    (setq r l)\n-    (while r\n-      (setq g l)\n-      (while g\n-        (setq b l)\n-        (while b\n-          (push (concat \"#\" (car r) (car g) (car b)) colors)\n-          (pop b))\n-        (pop g))\n-      (pop r))\n-    colors))\n+(eval-when-compile (require 'cl))\t\t\t      ; to use `push', `pop'\n+\n+\n+(defun git-blame-color-scale (&rest elements)\n+  \"Given a list, returns a list of triples formed with each\n+elements of the list.\n+\n+a b => bbb bba bab baa abb aba aaa aab\"\n+  (let (result)\n+    (dolist (a elements)\n+      (dolist (b elements)\n+        (dolist (c elements)\n+          (setq result (cons (format \"#%s%s%s\" a b c) result)))))\n+    result))\n+\n+;; (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\") =>\n+;; (\"#3c3c3c\" \"#3c3c14\" \"#3c3c34\" \"#3c3c2c\" \"#3c3c1c\" \"#3c3c24\"\n+;; \"#3c3c04\" \"#3c3c0c\" \"#3c143c\" \"#3c1414\" \"#3c1434\" \"#3c142c\" ...)\n \n (defvar git-blame-dark-colors\n-  (color-scale '(\"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")))\n+  (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")\n+  \"*List of colors (format #RGB) to use in a dark environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-dark-colors).\")\n \n (defvar git-blame-light-colors\n-  (color-scale '(\"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")))\n+  (git-blame-color-scale \"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")\n+  \"*List of colors (format #RGB) to use in a light environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-light-colors).\")\n \n-(defvar git-blame-ancient-color \"dark green\")\n+(defvar git-blame-colors '()\n+  \"Colors used by git-blame. The list is built once when activating git-blame\n+minor mode.\")\n+  \n+(defvar git-blame-ancient-color \"dark green\"\n+  \"*Color to be used for ancient commit.\")\n \n (defvar git-blame-autoupdate t\n   \"*Automatically update the blame display while editing\")\n@@ -125,6 +139,10 @@\n   \"A queue of update requests\")\n (make-variable-buffer-local 'git-blame-update-queue)\n \n+;; FIXME: docstrings\n+(defvar git-blame-file nil)\n+(defvar git-blame-current nil)\n+\n (defvar git-blame-mode nil)\n (make-variable-buffer-local 'git-blame-mode)\n \n@@ -177,7 +195,7 @@ See also function `git-blame-mode'.\"\n   \"Recalculate all blame information in the current buffer\"\n   (interactive)\n   (unless git-blame-mode\n-    (error \"git-blame is not active\"))\n+    (error \"Git-blame is not active\"))\n   \n   (git-blame-cleanup)\n   (git-blame-run))\n@@ -302,9 +320,8 @@ See also function `git-blame-mode'.\"\n           (inhibit-point-motion-hooks t)\n           (inhibit-modification-hooks t))\n       (when (not info)\n-        (let ((color (pop git-blame-colors)))\n-          (unless color\n-            (setq color git-blame-ancient-color))\n+        (let ((color (or (elt git-blame-colors (random (length git-blame-colors)))\n+\t\t\t git-blame-ancient-color)))\n           (setq info (list hash src-line res-line num-lines\n                            (git-describe-commit hash)\n                            (cons 'color color))))\n-- \n1.5.0.5\n"},{"id":"38120","messageId":"87bqifrs7r.fsf@morpheus.local","threadId":"7416","inReplyTo":"200703262101.l2QL1sGL012549@localhost.localdomain","subject":"Re: [PATCH 2/2] git-blame.el: pick a set of random colors when blaming","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-03-27T08:44:24Z","receivedAt":"2007-03-27T08:44:24Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> I thought it would be cooler to have different set of colors each time\n> I blame.\n\nBut the code for it looks weird:\n\n> @@ -302,9 +320,8 @@ See also function `git-blame-mode'.\"\n>            (inhibit-point-motion-hooks t)\n>            (inhibit-modification-hooks t))\n>        (when (not info)\n> -        (let ((color (pop git-blame-colors)))\n> -          (unless color\n> -            (setq color git-blame-ancient-color))\n> +        (let ((color (or (elt git-blame-colors (random (length git-blame-colors)))\n> +\t\t\t git-blame-ancient-color)))\n>            (setq info (list hash src-line res-line num-lines\n>                             (git-describe-commit hash)\n>                             (cons 'color color))))\n\nInstead of using the colors one at a time, you randomly select one of\nthem. This means that you might select the same color twice or more,\nand even twice in a row.  And you will never run out of colors, so\ngit-blame-ancient-color will never be used.\n\nThis change should probably not go in, but your patch has other stuff\nthat's good.\n\n> * Prevent (future possible) namespace clash by renaming `color-scale'\n> into `git-blame-color-scale'. Definition has been changed to be more\n> in the \"lisp\" way (thanks for help goes to #emacs). Also added a small\n> description of what it does.\n\nOk, but the heavier cl dependency is noted below.\n\n> * Added docstrings at some point and instructed defvar when a variable\n> was candidate to customisation by users.\n\nGood.\n\n> * Added fix to silent byte-compilers (git-blame-file,\n> git-blame-current)\n\nGood.\n\n> * Do not require 'cl at startup.\n\nYou removed the pop calls, but added a couple of dolist calls.  So you\nstill need to require cl.\n\n> * Added more informations on compatibility\n\nGood.\n\n> Signed-off-by: Xavier Maillard <zedek@gnu.org>\n> ---\n>  contrib/emacs/git-blame.el |   71 +++++++++++++++++++++++++++----------------\n>  1 files changed, 44 insertions(+), 27 deletions(-)\n>\n> diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\n> index bd87a86..6d0c1b0 100644\n> --- a/contrib/emacs/git-blame.el\n> +++ b/contrib/emacs/git-blame.el\n> @@ -8,8 +8,8 @@\n>  ;; License:    GPL\n>  ;; Keywords:   git, version control, release management\n>  ;;\n> -;; Compatibility: Emacs21\n> -\n> +;; Compatibility: Emacs21, Emacs22 and EmacsCVS\n> +;;                Git 1.5 and up\n>  \n>  ;; This file is *NOT* part of GNU Emacs.\n>  ;; This file is distributed under the same terms as GNU Emacs.\n> @@ -61,8 +61,9 @@\n>  \n>  ;;; Compatibility:\n>  ;;\n> -;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n> -;; changing this:\n> +;; It requires GNU Emacs 21 or later and Git 1.5.0 and up\n> +;; \n> +;; If you'are using Emacs 20, try changing this:\n>  ;;\n>  ;;            (overlay-put ovl 'face (list :background\n>  ;;                                         (cdr (assq 'color (cddddr info)))))\n> @@ -77,30 +78,43 @@\n>  ;;\n>  ;;; Code:\n>  \n> -(require 'cl)\t\t\t      ; to use `push', `pop'\n> -\n> -(defun color-scale (l)\n> -  (let* ((colors ())\n> -         r g b)\n> -    (setq r l)\n> -    (while r\n> -      (setq g l)\n> -      (while g\n> -        (setq b l)\n> -        (while b\n> -          (push (concat \"#\" (car r) (car g) (car b)) colors)\n> -          (pop b))\n> -        (pop g))\n> -      (pop r))\n> -    colors))\n> +(eval-when-compile (require 'cl))\t\t\t      ; to use `push', `pop'\n> +\n> +\n> +(defun git-blame-color-scale (&rest elements)\n> +  \"Given a list, returns a list of triples formed with each\n> +elements of the list.\n> +\n> +a b => bbb bba bab baa abb aba aaa aab\"\n> +  (let (result)\n> +    (dolist (a elements)\n> +      (dolist (b elements)\n> +        (dolist (c elements)\n> +          (setq result (cons (format \"#%s%s%s\" a b c) result)))))\n> +    result))\n> +\n> +;; (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\") =>\n> +;; (\"#3c3c3c\" \"#3c3c14\" \"#3c3c34\" \"#3c3c2c\" \"#3c3c1c\" \"#3c3c24\"\n> +;; \"#3c3c04\" \"#3c3c0c\" \"#3c143c\" \"#3c1414\" \"#3c1434\" \"#3c142c\" ...)\n>  \n>  (defvar git-blame-dark-colors\n> -  (color-scale '(\"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")))\n> +  (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")\n> +  \"*List of colors (format #RGB) to use in a dark environment.\n> +\n> +To check out the list, evaluate (list-colors-display git-blame-dark-colors).\")\n>  \n>  (defvar git-blame-light-colors\n> -  (color-scale '(\"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")))\n> +  (git-blame-color-scale \"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")\n> +  \"*List of colors (format #RGB) to use in a light environment.\n> +\n> +To check out the list, evaluate (list-colors-display git-blame-light-colors).\")\n>  \n> -(defvar git-blame-ancient-color \"dark green\")\n> +(defvar git-blame-colors '()\n> +  \"Colors used by git-blame. The list is built once when activating git-blame\n> +minor mode.\")\n> +  \n> +(defvar git-blame-ancient-color \"dark green\"\n> +  \"*Color to be used for ancient commit.\")\n>  \n>  (defvar git-blame-autoupdate t\n>    \"*Automatically update the blame display while editing\")\n> @@ -125,6 +139,10 @@\n>    \"A queue of update requests\")\n>  (make-variable-buffer-local 'git-blame-update-queue)\n>  \n> +;; FIXME: docstrings\n> +(defvar git-blame-file nil)\n> +(defvar git-blame-current nil)\n> +\n>  (defvar git-blame-mode nil)\n>  (make-variable-buffer-local 'git-blame-mode)\n>  \n> @@ -177,7 +195,7 @@ See also function `git-blame-mode'.\"\n>    \"Recalculate all blame information in the current buffer\"\n>    (interactive)\n>    (unless git-blame-mode\n> -    (error \"git-blame is not active\"))\n> +    (error \"Git-blame is not active\"))\n>    \n>    (git-blame-cleanup)\n>    (git-blame-run))\n\n-- \nDavid Kågedal\n"},{"id":"38159","messageId":"200703271531.l2RFVwOM008315@localhost.localdomain","threadId":"7416","inReplyTo":"87bqifrs7r.fsf@morpheus.local","subject":"Re: [PATCH 2/2] git-blame.el: pick a set of random colors when blaming","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-27T15:31:58Z","receivedAt":"2007-03-27T15:31:58Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"Hi,\n\n   > I thought it would be cooler to have different set of colors each time\n   > I blame.\n\n   But the code for it looks weird:\n\nWhy ? It looks good to me except the \"small\" quircks :)\n\n   > @@ -302,9 +320,8 @@ See also function `git-blame-mode'.\"\n   >            (inhibit-point-motion-hooks t)\n   >            (inhibit-modification-hooks t))\n   >        (when (not info)\n   > -        (let ((color (pop git-blame-colors)))\n   > -          (unless color\n   > -            (setq color git-blame-ancient-color))\n   > +        (let ((color (or (elt git-blame-colors (random (length git-blame-colors)))\n   > +\t\t\t git-blame-ancient-color)))\n   >            (setq info (list hash src-line res-line num-lines\n   >                             (git-describe-commit hash)\n   >                             (cons 'color color))))\n\n   Instead of using the colors one at a time, you randomly select one of\n   them. This means that you might select the same color twice or more,\n   and even twice in a row.  And you will never run out of colors, so\n   git-blame-ancient-color will never be used.\n\nI partly agree with you.\n\nRandom is not enough and we need to delete the color we just\nset. This is what I am currently doing in the next patch. There\nis still an interrogation: what is the problem if we never fail\nand thus, never use git-blame-ancient-color ?\n\n   > * Prevent (future possible) namespace clash by renaming `color-scale'\n   > into `git-blame-color-scale'. Definition has been changed to be more\n   > in the \"lisp\" way (thanks for help goes to #emacs). Also added a small\n   > description of what it does.\n\n   Ok, but the heavier cl dependency is noted below.\n\nI kept cl but I surrounded it into an eval-when-compile form as\nrequested by elisp standards.\n\n   > * Do not require 'cl at startup.\n\n   You removed the pop calls, but added a couple of dolist calls.  So you\n   still need to require cl.\n\nYep. See below.\n\nThank you for your review !\n\nXavier\n"},{"id":"38195","messageId":"200703272151.l2RLpqD7012317@localhost.localdomain","threadId":"7416","inReplyTo":"87bqifrs7r.fsf@morpheus.local","subject":"[PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-27T21:51:52Z","receivedAt":"2007-03-27T21:51:52Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"\nI thought it would be cool to have different set of colors for each\ngit-blame-mode. Function `git-blame-new-commit' does this for us\npicking when possible, a random colors based on the set we build on\nstartup. When it fails, `git-blame-ancient-color' will be used. We\nalso take care not to use the same color more than once (thank you\nDavid Kågedal).\n\n* Prevent (future possible) namespace clash by renaming `color-scale'\ninto `git-blame-color-scale'. Definition has been changed to be more\nin the \"lisp\" way (thanks for help to #emacs). Also added a small\ndescription of what it does.\n\n* Added docstrings at some point and instructed defvar when a variable\nwas candidate to customisation by users.\n\n* Added missing defvar to silent byte-compilers (git-blame-file,\ngit-blame-current)\n\n* Do not require 'cl at startup\n\n* Added more informations on compatibility\n\nSigned-off-by: Xavier Maillard <zedek@gnu.org>\n---\n contrib/emacs/git-blame.el |   82 ++++++++++++++++++++++++++++----------------\n 1 files changed, 52 insertions(+), 30 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex bd87a86..4703442 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -8,8 +8,8 @@\n ;; License:    GPL\n ;; Keywords:   git, version control, release management\n ;;\n-;; Compatibility: Emacs21\n-\n+;; Compatibility: Emacs21, Emacs22 and EmacsCVS\n+;;                Git 1.5 and up\n \n ;; This file is *NOT* part of GNU Emacs.\n ;; This file is distributed under the same terms as GNU Emacs.\n@@ -61,8 +61,9 @@\n \n ;;; Compatibility:\n ;;\n-;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n-;; changing this:\n+;; It requires GNU Emacs 21 or later and Git 1.5.0 and up\n+;; \n+;; If you'are using Emacs 20, try changing this:\n ;;\n ;;            (overlay-put ovl 'face (list :background\n ;;                                         (cdr (assq 'color (cddddr info)))))\n@@ -77,30 +78,43 @@\n ;;\n ;;; Code:\n \n-(require 'cl)\t\t\t      ; to use `push', `pop'\n-\n-(defun color-scale (l)\n-  (let* ((colors ())\n-         r g b)\n-    (setq r l)\n-    (while r\n-      (setq g l)\n-      (while g\n-        (setq b l)\n-        (while b\n-          (push (concat \"#\" (car r) (car g) (car b)) colors)\n-          (pop b))\n-        (pop g))\n-      (pop r))\n-    colors))\n+(eval-when-compile (require 'cl))\t\t\t      ; to use `push', `pop'\n+\n+\n+(defun git-blame-color-scale (&rest elements)\n+  \"Given a list, returns a list of triples formed with each\n+elements of the list.\n+\n+a b => bbb bba bab baa abb aba aaa aab\"\n+  (let (result)\n+    (dolist (a elements)\n+      (dolist (b elements)\n+        (dolist (c elements)\n+          (setq result (cons (format \"#%s%s%s\" a b c) result)))))\n+    result))\n+\n+;; (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\") =>\n+;; (\"#3c3c3c\" \"#3c3c14\" \"#3c3c34\" \"#3c3c2c\" \"#3c3c1c\" \"#3c3c24\"\n+;; \"#3c3c04\" \"#3c3c0c\" \"#3c143c\" \"#3c1414\" \"#3c1434\" \"#3c142c\" ...)\n \n (defvar git-blame-dark-colors\n-  (color-scale '(\"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")))\n+  (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")\n+  \"*List of colors (format #RGB) to use in a dark environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-dark-colors).\")\n \n (defvar git-blame-light-colors\n-  (color-scale '(\"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")))\n+  (git-blame-color-scale \"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")\n+  \"*List of colors (format #RGB) to use in a light environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-light-colors).\")\n \n-(defvar git-blame-ancient-color \"dark green\")\n+(defvar git-blame-colors '()\n+  \"Colors used by git-blame. The list is built once when activating git-blame\n+minor mode.\")\n+  \n+(defvar git-blame-ancient-color \"dark green\"\n+  \"*Color to be used for ancient commit.\")\n \n (defvar git-blame-autoupdate t\n   \"*Automatically update the blame display while editing\")\n@@ -125,6 +139,10 @@\n   \"A queue of update requests\")\n (make-variable-buffer-local 'git-blame-update-queue)\n \n+;; FIXME: docstrings\n+(defvar git-blame-file nil)\n+(defvar git-blame-current nil)\n+\n (defvar git-blame-mode nil)\n (make-variable-buffer-local 'git-blame-mode)\n \n@@ -177,7 +195,7 @@ See also function `git-blame-mode'.\"\n   \"Recalculate all blame information in the current buffer\"\n   (interactive)\n   (unless git-blame-mode\n-    (error \"git-blame is not active\"))\n+    (error \"Git-blame is not active\"))\n   \n   (git-blame-cleanup)\n   (git-blame-run))\n@@ -294,18 +312,22 @@ See also function `git-blame-mode'.\"\n         (t\n          nil)))\n \n-\n (defun git-blame-new-commit (hash src-line res-line num-lines)\n   (save-excursion\n     (set-buffer git-blame-file)\n     (let ((info (gethash hash git-blame-cache))\n           (inhibit-point-motion-hooks t)\n-          (inhibit-modification-hooks t))\n+          (inhibit-modification-hooks t)\n+\t  (colors git-blame-colors))\n       (when (not info)\n-        (let ((color (pop git-blame-colors)))\n-          (unless color\n-            (setq color git-blame-ancient-color))\n-          (setq info (list hash src-line res-line num-lines\n+\t;; Assign a random color to each new commit info\n+\t;; Take care not to select the same color multiple times\n+\t(let* ((idx (random (length colors)))\n+\t       (color (or (elt colors idx)\n+\t\t\t  git-blame-ancient-color)))\n+\t  (and (assoc color colors)\n+\t       (setq colors (delete idx colors)))\n+\t  (setq info (list hash src-line res-line num-lines\n                            (git-describe-commit hash)\n                            (cons 'color color))))\n         (puthash hash info git-blame-cache))\n-- \n1.5.0.5\n"},{"id":"38239","messageId":"878xdh4usb.fsf@morpheus.local","threadId":"7416","inReplyTo":"200703271531.l2RFVwOM008315@localhost.localdomain","subject":"Re: [PATCH 2/2] git-blame.el: pick a set of random colors when blaming","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-03-28T08:49:40Z","receivedAt":"2007-03-28T08:49:40Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> Hi,\n>\n>    > I thought it would be cooler to have different set of colors each time\n>    > I blame.\n>\n>    But the code for it looks weird:\n>\n> Why ? It looks good to me except the \"small\" quircks :)\n\nI meant that it's doing strange things, like\n (or always-true-expression git-blame-ancient-color)\n\n> I kept cl but I surrounded it into an eval-when-compile form as\n> requested by elisp standards.\n\nYou are probably right.\n\n-- \nDavid Kågedal\n"},{"id":"38243","messageId":"874po54tle.fsf@morpheus.local","threadId":"7416","inReplyTo":"200703272151.l2RLpqD7012317@localhost.localdomain","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-03-28T09:15:25Z","receivedAt":"2007-03-28T09:15:25Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> @@ -294,18 +312,22 @@ See also function `git-blame-mode'.\"\n>          (t\n>           nil)))\n>  \n> -\n>  (defun git-blame-new-commit (hash src-line res-line num-lines)\n>    (save-excursion\n>      (set-buffer git-blame-file)\n>      (let ((info (gethash hash git-blame-cache))\n>            (inhibit-point-motion-hooks t)\n> -          (inhibit-modification-hooks t))\n> +          (inhibit-modification-hooks t)\n> +\t  (colors git-blame-colors))\n>        (when (not info)\n> -        (let ((color (pop git-blame-colors)))\n> -          (unless color\n> -            (setq color git-blame-ancient-color))\n> -          (setq info (list hash src-line res-line num-lines\n> +\t;; Assign a random color to each new commit info\n> +\t;; Take care not to select the same color multiple times\n> +\t(let* ((idx (random (length colors)))\n> +\t       (color (or (elt colors idx)\n> +\t\t\t  git-blame-ancient-color)))\n> +\t  (and (assoc color colors)\n> +\t       (setq colors (delete idx colors)))\n> +\t  (setq info (list hash src-line res-line num-lines\n>                             (git-describe-commit hash)\n>                             (cons 'color color))))\n>          (puthash hash info git-blame-cache))\n\nI have a few questions here.  Why do you make a local reference\n(color) to git-blame-colors, but you are still destructively updating\nthe list (using delete), possibly making git-blame-colors point to a\npartial ruin of the original list?  My original version may look\nsimilar, but pop is only destructive on the variable it is popping\nfrom.  Any other references to the original list will be intact.\n\nRemember that git-blame-colors is a buffer-local variable, but if it\npoints to a global list, any destructive changes will mess up the\nglobal list.\n\nThen it's this part\n\n> +\t(let* ((idx (random (length colors)))\n> +\t       (color (or (elt colors idx)\n> +\t\t\t  git-blame-ancient-color)))\n\nIf you have already consumed all colors, (length colors) will be zero\nand random will return an arbitrary integer. And then you will do (elt\n'() -47100) and check if that was nil.  It should work, but only by\nluck.\n\nI'd prefer something like this:\n\n    (let ((color (if colors\n                   (elt colors (random (length colors)))\n                  git-blame-ancient-color)))\n\nThen you have to remove it, and your (assoc color colors) looks\n\"weird\", since assoc compares the car of each list element in colors,\nbut colors doesn't contain any pairs, so I don't really see how it\nwould ever return something.\n\nYou could break this out to a function:\n\n(defmacro random-pop (l)\n  \"Remove a random element from l and update l\"\n  ;; only works on lists with unique elements\n  `(let ((e (elt ,l (random (length ,l)))))\n     (setq ,l (remove e ,l))\n     e))\n\nand use it like this:\n\n    (let ((color (if colors\n                   (random-pop colors)\n                  git-blame-ancient-color)))\n\n-- \nDavid Kågedal\n"},{"id":"38247","messageId":"200703281029.l2SATGlZ004563@localhost.localdomain","threadId":"7416","inReplyTo":"874po54tle.fsf@morpheus.local","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-28T10:29:16Z","receivedAt":"2007-03-28T10:29:16Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"Hi David,\n\n   I have a few questions here.  Why do you make a local reference\n   (color) to git-blame-colors, but you are still destructively updating\n   the list (using delete), possibly making git-blame-colors point to a\n   partial ruin of the original list?  My original version may look\n   similar, but pop is only destructive on the variable it is popping\n   from.  Any other references to the original list will be intact.\n\n   Remember that git-blame-colors is a buffer-local variable, but if it\n   points to a global list, any destructive changes will mess up the\n   global list.\n\nYou are damned right ! I did not check this before.\n\n   I'd prefer something like this:\n\n       (let ((color (if colors\n\t\t      (elt colors (random (length colors)))\n\t\t     git-blame-ancient-color)))\n\nI agree too.\n\nI hope the next patch will be the last for this \"feature\" :)\nThank you very much for all your comments.\n\nXavier\n"},{"id":"38248","messageId":"200703281031.l2SAVhj7004802@localhost.localdomain","threadId":"7416","inReplyTo":"874po54tle.fsf@morpheus.local","subject":"[PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-28T10:31:43Z","receivedAt":"2007-03-28T10:31:43Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"\nI thought it would be cool to have different set of colors for each\ngit-blame-mode. Function `git-blame-new-commit' does this for us\npicking when possible, a random colors based on the set we build on\nstartup. When it fails, `git-blame-ancient-color' will be used. We\nalso take care not to use the same color more than once (thank you\nDavid Kågedal).\n\n* Prevent (future possible) namespace clash by renaming `color-scale'\ninto `git-blame-color-scale'. Definition has been changed to be more\nin the \"lisp\" way (thanks for help to #emacs). Also added a small\ndescription of what it does.\n\n* Added docstrings at some point and instructed defvar when a variable\nwas candidate to customisation by users.\n\n* Added missing defvar to silent byte-compilers (git-blame-file,\ngit-blame-current)\n\n* Do not require 'cl at startup\n\n* Added more informations on compatibility\n\nSigned-off-by: Xavier Maillard <zedek@gnu.org>\n---\n contrib/emacs/git-blame.el |   88 +++++++++++++++++++++++++++++---------------\n 1 files changed, 58 insertions(+), 30 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex bd87a86..aa176fd 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -8,8 +8,8 @@\n ;; License:    GPL\n ;; Keywords:   git, version control, release management\n ;;\n-;; Compatibility: Emacs21\n-\n+;; Compatibility: Emacs21, Emacs22 and EmacsCVS\n+;;                Git 1.5 and up\n \n ;; This file is *NOT* part of GNU Emacs.\n ;; This file is distributed under the same terms as GNU Emacs.\n@@ -61,8 +61,9 @@\n \n ;;; Compatibility:\n ;;\n-;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n-;; changing this:\n+;; It requires GNU Emacs 21 or later and Git 1.5.0 and up\n+;; \n+;; If you'are using Emacs 20, try changing this:\n ;;\n ;;            (overlay-put ovl 'face (list :background\n ;;                                         (cdr (assq 'color (cddddr info)))))\n@@ -77,30 +78,51 @@\n ;;\n ;;; Code:\n \n-(require 'cl)\t\t\t      ; to use `push', `pop'\n-\n-(defun color-scale (l)\n-  (let* ((colors ())\n-         r g b)\n-    (setq r l)\n-    (while r\n-      (setq g l)\n-      (while g\n-        (setq b l)\n-        (while b\n-          (push (concat \"#\" (car r) (car g) (car b)) colors)\n-          (pop b))\n-        (pop g))\n-      (pop r))\n-    colors))\n+(eval-when-compile (require 'cl))\t\t\t      ; to use `push', `pop'\n+\n+\n+(defun git-blame-color-scale (&rest elements)\n+  \"Given a list, returns a list of triples formed with each\n+elements of the list.\n+\n+a b => bbb bba bab baa abb aba aaa aab\"\n+  (let (result)\n+    (dolist (a elements)\n+      (dolist (b elements)\n+        (dolist (c elements)\n+          (setq result (cons (format \"#%s%s%s\" a b c) result)))))\n+    result))\n+\n+;; (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\") =>\n+;; (\"#3c3c3c\" \"#3c3c14\" \"#3c3c34\" \"#3c3c2c\" \"#3c3c1c\" \"#3c3c24\"\n+;; \"#3c3c04\" \"#3c3c0c\" \"#3c143c\" \"#3c1414\" \"#3c1434\" \"#3c142c\" ...)\n+\n+(defmacro git-blame-random-pop (l)\n+  \"Select a random element from L and returns it. Also remove\n+selected element from l.\"\n+  ;; only works on lists with unique elements\n+  `(let ((e (elt ,l (random (length ,l)))))\n+     (setq ,l (remove e ,l))\n+     e))\n \n (defvar git-blame-dark-colors\n-  (color-scale '(\"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")))\n+  (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")\n+  \"*List of colors (format #RGB) to use in a dark environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-dark-colors).\")\n \n (defvar git-blame-light-colors\n-  (color-scale '(\"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")))\n+  (git-blame-color-scale \"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")\n+  \"*List of colors (format #RGB) to use in a light environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-light-colors).\")\n \n-(defvar git-blame-ancient-color \"dark green\")\n+(defvar git-blame-colors '()\n+  \"Colors used by git-blame. The list is built once when activating git-blame\n+minor mode.\")\n+  \n+(defvar git-blame-ancient-color \"dark green\"\n+  \"*Color to be used for ancient commit.\")\n \n (defvar git-blame-autoupdate t\n   \"*Automatically update the blame display while editing\")\n@@ -125,6 +147,10 @@\n   \"A queue of update requests\")\n (make-variable-buffer-local 'git-blame-update-queue)\n \n+;; FIXME: docstrings\n+(defvar git-blame-file nil)\n+(defvar git-blame-current nil)\n+\n (defvar git-blame-mode nil)\n (make-variable-buffer-local 'git-blame-mode)\n \n@@ -177,7 +203,7 @@ See also function `git-blame-mode'.\"\n   \"Recalculate all blame information in the current buffer\"\n   (interactive)\n   (unless git-blame-mode\n-    (error \"git-blame is not active\"))\n+    (error \"Git-blame is not active\"))\n   \n   (git-blame-cleanup)\n   (git-blame-run))\n@@ -294,18 +320,20 @@ See also function `git-blame-mode'.\"\n         (t\n          nil)))\n \n-\n (defun git-blame-new-commit (hash src-line res-line num-lines)\n   (save-excursion\n     (set-buffer git-blame-file)\n     (let ((info (gethash hash git-blame-cache))\n           (inhibit-point-motion-hooks t)\n-          (inhibit-modification-hooks t))\n+          (inhibit-modification-hooks t)\n+\t  (colors git-blame-colors))\n       (when (not info)\n-        (let ((color (pop git-blame-colors)))\n-          (unless color\n-            (setq color git-blame-ancient-color))\n-          (setq info (list hash src-line res-line num-lines\n+\t;; Assign a random color to each new commit info\n+\t;; Take care not to select the same color multiple times\n+\t(let ((color (if colors\n+\t\t\t (git-blame-random-pop colors)\n+\t\t       git-blame-ancient-color)))\n+\t  (setq info (list hash src-line res-line num-lines\n                            (git-describe-commit hash)\n                            (cons 'color color))))\n         (puthash hash info git-blame-cache))\n-- \n1.5.0.5\n"},{"id":"38249","messageId":"871wj94lua.fsf@morpheus.local","threadId":"7416","inReplyTo":"200703281031.l2SAVhj7004802@localhost.localdomain","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-03-28T12:02:53Z","receivedAt":"2007-03-28T12:02:53Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> I thought it would be cool to have different set of colors for each\n> git-blame-mode. Function `git-blame-new-commit' does this for us\n> picking when possible, a random colors based on the set we build on\n> startup. When it fails, `git-blame-ancient-color' will be used. We\n> also take care not to use the same color more than once (thank you\n> David Kågedal).\n\nCloser, but still no cigar :-)\n\n>  (defun git-blame-new-commit (hash src-line res-line num-lines)\n>    (save-excursion\n>      (set-buffer git-blame-file)\n>      (let ((info (gethash hash git-blame-cache))\n>            (inhibit-point-motion-hooks t)\n> -          (inhibit-modification-hooks t))\n> +          (inhibit-modification-hooks t)\n> +\t  (colors git-blame-colors))\n>        (when (not info)\n> -        (let ((color (pop git-blame-colors)))\n> -          (unless color\n> -            (setq color git-blame-ancient-color))\n> -          (setq info (list hash src-line res-line num-lines\n> +\t;; Assign a random color to each new commit info\n> +\t;; Take care not to select the same color multiple times\n> +\t(let ((color (if colors\n> +\t\t\t (git-blame-random-pop colors)\n> +\t\t       git-blame-ancient-color)))\n> +\t  (setq info (list hash src-line res-line num-lines\n>                             (git-describe-commit hash)\n>                             (cons 'color color))))\n>          (puthash hash info git-blame-cache))\n\nYou are still making a copy of the list head pointer (colors ->\ngit-blame-colors), and then you do (git-blame-random-pop colors).\nThis will not update git-blame-colors if the first element was popped,\nwhich means that you will keep reusing that color.  Since you really\ndo want to always update the buffer-local git-blame-colors, I don't\nsee why you bind a local variable and work with that instead.\n\nAnd the last diff line is whitespace-only.  You replaced eight spaces\nwith a TAB.\n\n-- \nDavid Kågedal\n"},{"id":"38258","messageId":"200703281644.l2SGiYeB008256@localhost.localdomain","threadId":"7416","inReplyTo":"871wj94lua.fsf@morpheus.local","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-28T16:44:34Z","receivedAt":"2007-03-28T16:44:34Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"\nI thought it would be cool to have different set of colors for each\ngit-blame-mode. Function `git-blame-new-commit' does this for us\npicking when possible, a random colors based on the set we build on\nstartup. When it fails, `git-blame-ancient-color' will be used. We\nalso take care not to use the same color more than once (thank you\nDavid Kågedal, really).\n\n* Prevent (future possible) namespace clash by renaming `color-scale'\ninto `git-blame-color-scale'. Definition has been changed to be more\nin the \"lisp\" way (thanks for help to #emacs). Also added a small\ndescription of what it does.\n\n* Added docstrings at some point and instructed defvar when a variable\nwas candidate to customisation by users.\n\n* Added missing defvar to silent byte-compilers (git-blame-file,\ngit-blame-current)\n\n* Do not require 'cl at startup\n\n* Added more informations on compatibility\n\nSigned-off-by: Xavier Maillard <zedek@gnu.org>\n---\n\n   Closer, but still no cigar :-)\n\nCan I have my cigar now ? :) I am really feeling stupid when\nthinkg at this issue, really. I just understood what you meant\nafter a really long time. Credits for this patch could probably\nbe shared with you :) Once again, thank you.\n\n contrib/emacs/git-blame.el |   83 +++++++++++++++++++++++++++++---------------\n 1 files changed, 55 insertions(+), 28 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex bd87a86..3c5efd8 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -8,8 +8,8 @@\n ;; License:    GPL\n ;; Keywords:   git, version control, release management\n ;;\n-;; Compatibility: Emacs21\n-\n+;; Compatibility: Emacs21, Emacs22 and EmacsCVS\n+;;                Git 1.5 and up\n \n ;; This file is *NOT* part of GNU Emacs.\n ;; This file is distributed under the same terms as GNU Emacs.\n@@ -61,8 +61,9 @@\n \n ;;; Compatibility:\n ;;\n-;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n-;; changing this:\n+;; It requires GNU Emacs 21 or later and Git 1.5.0 and up\n+;; \n+;; If you'are using Emacs 20, try changing this:\n ;;\n ;;            (overlay-put ovl 'face (list :background\n ;;                                         (cdr (assq 'color (cddddr info)))))\n@@ -77,30 +78,51 @@\n ;;\n ;;; Code:\n \n-(require 'cl)\t\t\t      ; to use `push', `pop'\n-\n-(defun color-scale (l)\n-  (let* ((colors ())\n-         r g b)\n-    (setq r l)\n-    (while r\n-      (setq g l)\n-      (while g\n-        (setq b l)\n-        (while b\n-          (push (concat \"#\" (car r) (car g) (car b)) colors)\n-          (pop b))\n-        (pop g))\n-      (pop r))\n-    colors))\n+(eval-when-compile (require 'cl))\t\t\t      ; to use `push', `pop'\n+\n+\n+(defun git-blame-color-scale (&rest elements)\n+  \"Given a list, returns a list of triples formed with each\n+elements of the list.\n+\n+a b => bbb bba bab baa abb aba aaa aab\"\n+  (let (result)\n+    (dolist (a elements)\n+      (dolist (b elements)\n+        (dolist (c elements)\n+          (setq result (cons (format \"#%s%s%s\" a b c) result)))))\n+    result))\n+\n+;; (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\") =>\n+;; (\"#3c3c3c\" \"#3c3c14\" \"#3c3c34\" \"#3c3c2c\" \"#3c3c1c\" \"#3c3c24\"\n+;; \"#3c3c04\" \"#3c3c0c\" \"#3c143c\" \"#3c1414\" \"#3c1434\" \"#3c142c\" ...)\n+\n+(defmacro git-blame-random-pop (l)\n+  \"Select a random element from L and returns it. Also remove\n+selected element from l.\"\n+  ;; only works on lists with unique elements\n+  `(let ((e (elt ,l (random (length ,l)))))\n+     (setq ,l (remove e ,l))\n+     e))\n \n (defvar git-blame-dark-colors\n-  (color-scale '(\"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")))\n+  (git-blame-color-scale \"0c\" \"04\" \"24\" \"1c\" \"2c\" \"34\" \"14\" \"3c\")\n+  \"*List of colors (format #RGB) to use in a dark environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-dark-colors).\")\n \n (defvar git-blame-light-colors\n-  (color-scale '(\"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")))\n+  (git-blame-color-scale \"c4\" \"d4\" \"cc\" \"dc\" \"f4\" \"e4\" \"fc\" \"ec\")\n+  \"*List of colors (format #RGB) to use in a light environment.\n+\n+To check out the list, evaluate (list-colors-display git-blame-light-colors).\")\n \n-(defvar git-blame-ancient-color \"dark green\")\n+(defvar git-blame-colors '()\n+  \"Colors used by git-blame. The list is built once when activating git-blame\n+minor mode.\")\n+  \n+(defvar git-blame-ancient-color \"dark green\"\n+  \"*Color to be used for ancient commit.\")\n \n (defvar git-blame-autoupdate t\n   \"*Automatically update the blame display while editing\")\n@@ -125,6 +147,10 @@\n   \"A queue of update requests\")\n (make-variable-buffer-local 'git-blame-update-queue)\n \n+;; FIXME: docstrings\n+(defvar git-blame-file nil)\n+(defvar git-blame-current nil)\n+\n (defvar git-blame-mode nil)\n (make-variable-buffer-local 'git-blame-mode)\n \n@@ -177,7 +203,7 @@ See also function `git-blame-mode'.\"\n   \"Recalculate all blame information in the current buffer\"\n   (interactive)\n   (unless git-blame-mode\n-    (error \"git-blame is not active\"))\n+    (error \"Git-blame is not active\"))\n   \n   (git-blame-cleanup)\n   (git-blame-run))\n@@ -294,7 +320,6 @@ See also function `git-blame-mode'.\"\n         (t\n          nil)))\n \n-\n (defun git-blame-new-commit (hash src-line res-line num-lines)\n   (save-excursion\n     (set-buffer git-blame-file)\n@@ -302,9 +327,11 @@ See also function `git-blame-mode'.\"\n           (inhibit-point-motion-hooks t)\n           (inhibit-modification-hooks t))\n       (when (not info)\n-        (let ((color (pop git-blame-colors)))\n-          (unless color\n-            (setq color git-blame-ancient-color))\n+\t;; Assign a random color to each new commit info\n+\t;; Take care not to select the same color multiple times\n+\t(let ((color (if git-blame-colors\n+\t\t\t (git-blame-random-pop git-blame-colors)\n+\t\t       git-blame-ancient-color)))\n           (setq info (list hash src-line res-line num-lines\n                            (git-describe-commit hash)\n                            (cons 'color color))))\n-- \n1.5.0.5\n"},{"id":"38301","messageId":"87r6r8764r.fsf@morpheus.local","threadId":"7416","inReplyTo":"200703281644.l2SGiYeB008256@localhost.localdomain","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-03-29T09:26:12Z","receivedAt":"2007-03-29T09:26:12Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> I thought it would be cool to have different set of colors for each\n> git-blame-mode. Function `git-blame-new-commit' does this for us\n> picking when possible, a random colors based on the set we build on\n> startup. When it fails, `git-blame-ancient-color' will be used. We\n> also take care not to use the same color more than once (thank you\n> David Kågedal, really).\n\nExcellent.  This version looks good.\n\n-- \nDavid Kågedal\n"},{"id":"38306","messageId":"200703290959.l2T9xQr2020320@localhost.localdomain","threadId":"7416","inReplyTo":"87r6r8764r.fsf@morpheus.local","subject":"Re: [PATCH] git-blame.el: pick a set of random colors for each git-blame turn","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-03-29T09:59:26Z","receivedAt":"2007-03-29T09:59:26Z","isPatch":true,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"\n   > I thought it would be cool to have different set of colors for each\n   > git-blame-mode. Function `git-blame-new-commit' does this for us\n   > picking when possible, a random colors based on the set we build on\n   > startup. When it fails, `git-blame-ancient-color' will be used. We\n   > also take care not to use the same color more than once (thank you\n   > David Kågedal, really).\n\n   Excellent.  This version looks good.\n\nPhew ! :) Thank you for your help and support.\n\nXavier\n"}]}