unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Steve Wainstead <swain@socialserve.com>
Cc: 14719@debbugs.gnu.org
Subject: bug#14719: 24.3; Crashing when setting frames to random colors
Date: Mon, 25 Sep 2017 14:22:45 +0100	[thread overview]
Message-ID: <m2d16enc9m.fsf@breton.holly.idiocy.org> (raw)
In-Reply-To: <B8CC1741-A421-4854-95C8-D51214311E70@socialserve.com> (Steve Wainstead's message of "Tue, 25 Jun 2013 15:00:09 -0700")

Steve Wainstead <swain@socialserve.com> 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





  parent reply	other threads:[~2017-09-25 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 22:00 bug#14719: 24.3; Crashing when setting frames to random colors Steve Wainstead
2013-07-03 17:54 ` bug#14719: Full lisp used that causes the crash Steve Wainstead
2013-07-03 19:21 ` bug#14719: Crash log Steve Wainstead
2017-09-25 13:22 ` Alan Third [this message]
2017-09-25 13:30   ` bug#14719: 24.3; Crashing when setting frames to random colors Steve Wainstead
2017-09-25 16:52     ` Alan Third

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=m2d16enc9m.fsf@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=14719@debbugs.gnu.org \
    --cc=swain@socialserve.com \
    /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 public inbox

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

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).