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

useful new zmacs function (humor)



Do you spend too much time using your lispm writing proposals, progress reports,
and other mundane text, only to be read by the technically illiterate. Attached below
is a useful zmacs function to speed the writing of these types of materials. 
(Just a hi-tech version of an old gag).

;;; -*- Mode: LISP; Syntax: Zetalisp; Package: ZWEI; Base: 10 -*-

(defvar *buzzwords* (scl:make-array '(3 10) :initial-contents
     '(("integrated" "total" "systematized" "parallel" "functional"
	"responsive" "optional" "synchronized" "compatible" "balanced")
       ("management" "organizational" "monitored" "reciprocal"
	"digital" "logistical" "transitional" "incremental"
	"third-generation" "policy")
       ("options" "flexibility" "capability" "mobility" "programming"
	"concept" "time-phase" "projection" "hardware" "contingency"))))

(defun make-buzz-phrase (stream)(format stream "~A ~A ~A" (aref *buzzwords* 0 (random 10))
					(aref *buzzwords* 1 (random 10))
					(aref *buzzwords* 2 (random 10))))

(defcom com-insert-buzzphrase "Add some stupid buzzword phrase into the current buffer" ()
  (WITH-NODE-WRITE-LOCKED ((BP-NODE-TO-LOCK (POINT)))
    (LET ((STREAM (OPEN-INTERVAL-STREAM (POINT)))
	  (OLD-POINT (COPY-BP (POINT) :NORMAL)))
      (WITH-CUSTOM-UNDO-SAVE (OLD-POINT OLD-POINT
			     (MAKE-INSERT-RECORD OLD-POINT (COPY-BP OLD-POINT ':MOVES)))
	(SCL:WITH-CHARACTER-STYLE ((SI:INDEX-CHARACTER-STYLE *STYLE*) STREAM)
	  (make-buzz-phrase stream)
	  (MOVE-MARK (POINT))
	  (MOVE-POINT (SEND STREAM ':READ-BP))))
      (CLOSE STREAM)))
  DIS-TEXT)

;;bind this to some appropriately stupid key

(command-store 'com-insert-buzzphrase #\h-s-m-c-square *standard-comtab*)