all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Steve Wainstead <swain@socialserve.com>
To: 14719@debbugs.gnu.org
Subject: bug#14719: Full lisp used that causes the crash
Date: Wed, 3 Jul 2013 10:54:06 -0700	[thread overview]
Message-ID: <C4857787-CF1E-4A01-AE5C-9419DDA4C5A5@socialserve.com> (raw)
In-Reply-To: <B8CC1741-A421-4854-95C8-D51214311E70@socialserve.com>

Reading more of the Lisp code I use when compiling I thought posting all of it might be more helpful. All of this and more is in a GitHub repository: 

https://github.com/wainstead/swainlisp

;; save *compilation* buffer to file
;; git commit it right after

(defun sw-write-compilation-buffer()
  "Hook function to write the *compilation* buffer for each compile."
  (and (get-buffer "*compilation*") (sw-save-buffer-invisibly (get-buffer "*compilation*")))
  (shell-command "cd ~swain/.emacs.shellbuffers; git commit -m \"saving last compilation\" ?compilation?")
)

;; every time the "compile" or "recompile" functions are run, write
;; out the *compilation* buffer's contents and commit it.
(defadvice compile (before sw-save-last-compilation activate compile)
  "Every time we compile, save the previous compilation to the
   ~/.emacs.shellbuffers directory and git commit it."
  ;; if we are in the frame holding the compilation buffer, don't switch frames.
  (and (not(string= (buffer-name) "*compilation*")) (switch-to-buffer-other-frame "*compilation*"))
  (sw-write-compilation-buffer)
  (sw-randomize-frame-colors)
)


(defadvice recompile (before sw-save-last-compilation activate compile)
  "Every time we compile, save the previous compilation to the
   ~/.emacs.shellbuffers directory and git commit it."
  (and (not(string= (buffer-name) "*compilation*")) (switch-to-buffer-other-frame "*compilation*"))
  (sw-write-compilation-buffer)
  (sw-randomize-frame-colors)
)

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









  reply	other threads:[~2013-07-03 17:54 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 ` Steve Wainstead [this message]
2013-07-03 19:21 ` bug#14719: Crash log Steve Wainstead
2017-09-25 13:22 ` bug#14719: 24.3; Crashing when setting frames to random colors Alan Third
2017-09-25 13:30   ` 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

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

  git send-email \
    --in-reply-to=C4857787-CF1E-4A01-AE5C-9419DDA4C5A5@socialserve.com \
    --to=swain@socialserve.com \
    --cc=14719@debbugs.gnu.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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.