bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14719: 24.3; Crashing when setting frames to random colors


From: Alan Third
Subject: bug#14719: 24.3; Crashing when setting frames to random colors
Date: Mon, 25 Sep 2017 14:22:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (darwin)

Steve Wainstead <address@hidden> writes:

> I have a Lisp function that is run every time I do M-x compile:
>
> ;; choose random colors every time we compile, just for fun
> (defun sw-make-random-hex-color-string ()
>   "Return a string in the form of #FFFFFF. Choose the number for
>    #xffffff randomly using Emacs Lisp's builtin function (random)."
>   ;; seed our random number generator: current datetime plus Emacs's
>   ;; process ID
>   (random t)
>   (format "#%06x" (random #xffffff))
>   )
>
> (defun sw-randomize-frame-colors ()
>   "Change foreground and background colors of the current frame to
> random colors."
>   (interactive)
>   (let 
>       (
>        (fg-color (sw-make-random-hex-color-string)) 
>        (bg-color (sw-make-random-hex-color-string))
>        (color-distance #x3fffff)
>        )
>     (set-foreground-color fg-color)
>     (set-background-color bg-color)
>     )
>   )
>
> I *think* sometimes the color values come out the same and it causes
> Emacs to crash. I'm not sure because it's almost instantaneous when I
> run compile.

Hi, sorry it's taken so long for someone to come back to you.

I can't reproduce this crash, are you still experiencing it?
-- 
Alan Third





reply via email to

[Prev in Thread] Current Thread [Next in Thread]