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

zmacs mode, incremental compilation

    Date: Wed, 22 Jun 88 09:58:02 EDT
    From: schabes@linc.cis.upenn.edu (Yves Schabes)

    Hello everybody,

     I am trying to define a zmacs mode in which I would like to
    use a special purpose incremental compilation.

    I would appreciate any help on:
     - the definition of a zmacs mode
have you looked in sys:zwei;modes for examples?
     - the use of bp in zmacs
     - how to grab a region from zmacs
Look at the definition of the kill-region command in Zmacs. It is in sys:zwei;coma
     - how to find the current definition in zmacs
Lots of examples of this in commands like mark-definition in sys:zwei;come

    Does anyone have a simple example that I can look at?

This shows how to grab a region.  If the user marked a region it uses
that one.  I the user did not mark a region then it takes the region
defined as a definition in the editing mode the user is in. BTW: This
code is from my Electric Lisp mode which I brough to the last SLUG
meeting in Philadelphia.

;;; 3Purpose: 2Applies Electric LISP formatting to everything in region.
;;; 3Returned Value(s): 2Nothing useful.
;;; 3Side Effects: 2Changes the state of the Zwei buffer.
;;; 3Argument List: 1None
;;; 3Remarks: 2None
0	"Apply Electric LISP formatting to everything in region." ()
  (if (window-region-p *window*)
      (region (bp1 bp2 :empty-ok nil)		;4If a region marked then use it.
0	(adjust-lisp-code-character-style-in-interval bp1 bp2 t t))
      (multiple-value-bind (interval name error-p)	;4Otherwise make a region from the definition the point is in.
0	  (send *major-mode* :definition-interval (point))
	(ignore name)				;4Tis better for human readers (and compiler does it right too.)
0	(if error-p (barf error-p))		;4Standard ZWEI way of doing things.
0	(adjust-lisp-code-character-style-in-interval (interval-first-bp interval)
						      (interval-last-bp interval) t t)))

    Thanks in advance. Yves.

  -- David D. Loeffler