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

Submission for slug-info



Path: potomac!daemon
From: daemon@potomac
Newsgroups: slug-info
Subject: Submission for slug-info
Message-ID: <163@potomac.dc.ads.com>
Date: 21 Jan 87 06:37:02 GMT
Sender: daemon@potomac.dc.ads.com
Lines: 112

Path: potomac!daemon
From: daemon@potomac
Newsgroups: slug-info
Subject: Submission for slug-info
Message-ID: <152@potomac.dc.ads.com>
Date: 21 Jan 87 03:25:09 GMT
Sender: daemon@potomac.dc.ads.com
Lines: 98

Path: potomac!daemon
From: TAYLOR%PLU@ames-io.ARPA
Newsgroups: slug-info
Subject: Dynamic Prolog Listener Window
Message-ID: <143@potomac.dc.ads.com>
Date: 20 Jan 87 21:09:06 GMT
Sender: daemon@potomac.dc.ads.com
Lines: 84

For those of you using Prolog under Genera 7.0 & Prolog 17.0, and who have not 
yet set up a dynamic Prolog Listener window, here is the code I wrote to set
one up on SELECT key <symbol><shift>D and provide a predicate "clear."
to clear the accumulated history.

FILE : DYNAMIC-WINDOW.LISP

;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: Prolog-Compiler; Lowercase: T -*-
;;;
;;;  Make a Dynamic Prolog Listener
;;;  will taylor 16 jan 87 - Genera 7.0 - Prolog 17.0

;;; Modified from >rel-7>prolog>command-loop.lisp

(defflavor PROLOG-DYNAMIC-LISTENER () (tv:process-mixin dw:dynamic-window)
  (:default-init-plist :save-bits t
		       :end-of-page-mode :scroll
		       :scroll-factor nil
		       :margin-components
		       '((dw:margin-borders :thickness 2)
			 (dw:margin-white-borders :thickness 2)
			 (dw:margin-label :margin :bottom :string "Prolog Dynamic Listener"
					  :style (:dutch :italic :normal))
			 (dw:margin-scroll-bar)
			 (dw:margin-white-borders :thickness 8))
		       ))

(defmethod (:INIT PROLOG-DYNAMIC-LISTENER :BEFORE) (ignore)
  (unless tv:process
    (setq tv:process '(prolog-toplevel-loop))))

(COMPILE-FLAVOR-METHODS prolog-dynamic-listener)

(unless (assoc "Prolog-Dynamic" tv:default-window-types-item-list)
  (push '("Prolog-Dynamic"
	  :value prolog-dynamic-listener
	  :documentation "Prolog dynamic listener")
	tv:default-window-types-item-list))

(TV:ADD-SELECT-KEY #\<symbol><shift>D      ; Symbolics key strokes
 'prolog-dynamic-listener "Prolog Dynamic Listener")	;Symbol Shift D


FILE : CLEAR-PREDICATE.PROLOG

%%%  -*- Mode: Prolog; Package: PROLOG-USER -*-


%%%   Prolog predicate to clear history in Prolog Dynamic Listener
%%%   will taylor 16 jan 87 - Genera 7.0 - Prolog 17.0

clear :- Z is clear(1).


FILE : CLEAR-FUNCTION.LISP

;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: Prolog-User; Lowercase: T -*-
;;;
;;;  Clear Dynamic Prolog Listener

;;;  will taylor 16 jan 87 - Genera 7.0 - Prolog 17.0

(defun CLEAR (dum)
  "Clear dynamic Prolog listener"
  dum
  (prog ()
	(send *terminal-io* :clear-history)
	1))

c-x c-f each of these files into a Zmacs buffer and do m-x Reparse Attribute
List and m-x Compile Buffer in order to add them to the Lisp/Prolog world.

Contact me if you have any questions/problems - Will

--------------------------------------------------------------------------
   Will Taylor - Sterling Software, MS 244-7,
		 NASA-Ames Research Center, Moffett Field, CA 94035
   arpanet: taylor%plu@ames-io.ARPA 
   usenet: ..!ames!plu.decnet!taylor
   phone  : (415)694-6525