🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #778

epoch code

#778
From: Jeff Putnam
Date: Fri, 21 May 1993 14:45
77 lines
3502 bytes

The following code is an attempt to have epoch setup screens for me
more or less automagically.  For the most part it works, but I
have a couple questions.  

1)  When I dont set background color in my defaults setup and it only
uses the background color from this code, and when using the automatic
comment-highlight-in-another-color, the comments come out in that other
color over a white background which overwrites the default yellowish
background I select here.  Why?

2) The minibuffer and first window created dont seem to check the
*create-screen-alist-hook*.  How can I get around this?

3) I've tried a couple things to eliminate the title on the minibuffer
(including in the wm and in epoch), how does one do this?


-- code follows --

(defvar *desired-window-spacing* 100)

(defvar *jefu-normal-background* "LemonChiffon")
(defvar *jefu-normal-foreground* "black")

(defvar *jefu-minibuffer-background* "firebrick4")
(defvar *jefu-normal-foreground* "white")

(defun do-jefu-window-alist-thing (y)
  (if (equal (assoc 'title y) "Minibuffer")
      (cons (cons 'foreground *jefu-minibuffer-foreground*)
	    (cons (cons 'background *jefu-minibuffer-background*)
		  (cons (cons '(geometry . "100x1+300-0") y))))
    (cons (cons 'foreground *jefu-normal-foreground*)
	  (cons (cons 'background *jefu-normal-background*)
		(cons (cons 'geometry (format "80x60+%d+0" (locate-screen-x))) y)))))

(push 'do-jefu-window-alist-thing *create-screen-alist-hook*)

(defun locate-screen-x ()
    (let ((screen-xs  (mapcar 'get-screen-x (screen-list))))
         (if (null screen-xs)
	     nil 
  	     (if (= (length screen-xs) 1)
		 (+ (car screen-xs) *desired-window-spacing*)
	         (find-spot screen-xs)))))

(defun get-screen-x (x) (car (screen-information x)))

(defun find-spot (x-list)
    (let ((max-x (car (epoch::plane-size))))
         (setq x-list (sort x-list '<))
	 (if (< (car (last x-list)) (- max-x *desired-window-spacing*))
	     (+ (car (last x-list)) *desired-window-spacing*)
	     (if (> (car x-list) *desired-window-spacing*)
		 (- (car x-list) *desired-window-spacing*)
	         (let ((gap (find-largest-gap 
			     (cons 0 (append x-list (list max)))
			     *desired-window-spacing*)))
		   (/ (+ (car gap) (cdr gap)) 2))))))

(defun find-largest-gap (l)
   (find-largest-gap-1 l (cons (car l) (cadr l)) (- (cadr l) (car l))))

(defun find-largest-gap-1 (l largest-gap-so-far its-size)
   (if (< (length l) 2)
       largest-gap-so-far
       (let ((s (- (cadr l) (car l))))
	    (if (> s its-size)
		(find-largest-gap-1 (cdr l) (cons (car l) (cadr l)) s)
	        (find-largest-gap-1 (cdr l) largest-gap-so-far its-size)))))
-- 
jefu <=> Jeff Putnam - New Mexico Tech <=> jefu@nmt.edu 
"Daffodils go Ping! and Oink! // They Really are alarming 
I'm scared of big geraniums // And I'm sure that Lilac's harming"
(Dr. Bertram X. Fegg)
Technical Details
Message-ID: <1993May21.144543.25831@nmt.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!gatech!swrinde!sdd.hp.com!nigel.msen.com!caen!saimiri.primate.wisc.edu!mimbres.cs.unm.edu!nmt.edu!jefu

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,fcc37286f17ccf95,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1993-05-21 10:48:05 PST
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!gatech!swrinde!sdd.hp.com!nigel.msen.com!caen!saimiri.primate.wisc.edu!mimbres.cs.unm.edu!nmt.edu!jefu
From: jefu@nmt.edu (Jeff Putnam)
Subject: epoch code
Message-ID: <1993May21.144543.25831@nmt.edu>
Organization: The Museum of Differential Geometry
Date: Fri, 21 May 1993 14:45:43 GMT
Lines: 77