Re: Howto edit stk files?

From: Erwin Burgstaller <ber_at_knapp.co.at>
Date: Tue, 8 Nov 1994 16:55:24 +0100

I'm working with emacs. I merged the tcl-mode.el and lisp.el file from
the emacs distribution. One can mail me, so I would mail back a
zipped uuencoded version (10kb) or do the following:


  1) Take tcl-mode.el (If it isn't there, you have an older version
     of emacs. It's there at least from 19.25 on and will not work with
     versions older than 19.22) from emacs distribution,
     copied it to /usr/local/lib/emacs/site-lisp as stk-mode.el.

  2) replace all strings "tcl" with: "stk"
        
  3) change

        defvar stk-default-application "wish"

     to
        defvar stk-default-application "stk"


  4) Search for all occurances of code like that (concat)

         (concat stk-default-eval
           " {\n"(buffer-substring start end) "\n}"))

     and change it to

         (concat "(" stk-default-eval
                    (buffer-substring start end) ")\n"))
         
  5) Change

                        (concat "source "
                                (buffer-file-name)
                                "\n")))
     to
    
                        (concat "load "
                                (buffer-file-name)
                                "\n")))

  6) Remove function definitions

        (defun stk-indent-line

     and
        
        (defun stk-calculate-indentation


  7) Take the file lisp-mode.el from emacs distribution


  8) Copy all function definition containing indent in their name to
     stk-mode.el, right to the place where stk-indent-line has been.
     (Maybe you would not need all of them).

  9) replace-string stk-indent-line to lisp-indent-line


 10) remove function definitions

          (stk-beginning-of-proc
          (stk-end-of-proc

     and all references to them (keymap and menu).


 11) change all occourcances of ?} to ?) (electric-brace)


 12) M-x byte-compile-file will make you an .elc file the message:

          ** reference to free variable last-sexp

     seems to be normal as it occurs even when compiling lisp-mode.el


 13) Add the lines

    (autoload 'stk-mode "stk-mode"
        "Mode for editing and testing stk files" t)
        
    (setq auto-mode-alist
    (append '(("\\.stk$" . stk-mode)
              ("\\.stklos$" . stk-mode)) auto-mode-alist))


    to your .emacs file




The tcl-mode.el has the advantage, that you can send files, buffers, regions
and lines to a stk interpreter, which will be started automatically, if not
yet done. With some additional macros one could build a single step debugger.



Erwin

-- 
=============================================================================
  Erwin Burgstaller		     |-|	KNAPP Logistics Automation
  .				     |-|	Guenther Knapp Strasse 5-7
  Internet: ber_at_knapp.co.at  	     |-|	A-8075 Hart bei Graz
  Voice:    +43 316/495-618	     |-|	Austria
\___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/ \___/
-----------------------------------------------------------------------------
Received on Tue Nov 08 1994 - 17:06:45 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST