Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MIT-scheme edwin customization?

207 views
Skip to first unread message

Yunho Jeon

unread,
Feb 8, 1997, 3:00:00 AM2/8/97
to

Hello,

I'm new to LISP/Scheme/edwin/emacs and it may be a trivial question, but
I couldn't find any info from documents... :(
How can I customize edwin? I tried to include commands in .edwin file
(or edwin.ini for Win32 version), but every edwin-specific commands failed
to execute. Only generic scheme commands are recognized.
Any help would be appreciated.

------------------------------------------------------------------------------
Yunho Jeon Tel: +82-2-880-6482~90 ext) 416
Intelligent Control Lab +82-2-875-9183
School of Electrical Engineering Fax: +82-2-888-4182
Seoul National University, Korea Email: yu...@csl.snu.ac.kr


Stephen Adams

unread,
Feb 11, 1997, 3:00:00 AM2/11/97
to

yu...@csl.snu.ac.kr (Yunho Jeon) writes:

> Hello,
>
> I'm new to LISP/Scheme/edwin/emacs and it may be a trivial question, but
> I couldn't find any info from documents... :(
> How can I customize edwin? I tried to include commands in .edwin file
> (or edwin.ini for Win32 version), but every edwin-specific commands failed
> to execute. Only generic scheme commands are recognized.
> Any help would be appreciated.

MIT Scheme looks for the .edwin or edwin.ini file in the directory
identified by your HOME environment variable. If you don't have HOME
set, MIT Scheme uses various operating system dependent heuristics to
try identify your home directory. Make sure that the HOME environment
variable is set.

If you make your .edwin (edwin.ini) file generate an error, e.g.

(error "Hello from .edwin")

then you will know for sure whether or not it is being loaded.

Chris Hanson

unread,
Feb 13, 1997, 3:00:00 AM2/13/97
to yu...@csl.snu.ac.kr

From: yu...@csl.snu.ac.kr (Yunho Jeon)
Date: 8 Feb 1997 05:28:45 GMT

I'm new to LISP/Scheme/edwin/emacs and it may be a trivial question, but
I couldn't find any info from documents... :(
How can I customize edwin? I tried to include commands in .edwin file
(or edwin.ini for Win32 version), but every edwin-specific commands failed
to execute. Only generic scheme commands are recognized.
Any help would be appreciated.

Edwin commands aren't procedures (unlike GNU Emacs). An Edwin command
is a special object with an unusual name. If you want to invoke a
command from a program you must use the REF-COMMAND macro. For
example, to start a shell buffer as if you had typed "M-x shell":

((ref-command shell) #t)

I've appended my Edwin init file to this message to give you an idea
about how stuff is done. Unfortunately there's no documentation on
customizing Edwin -- you'll have to figure it out by reading the
source code.

----------------------------------------------------------------------
;;; -*-Scheme-*-

;;;; Edwin init file for CPH

(declare (usual-integrations))

((ref-command load-file) "~/edwin/cphlib" #t)
((ref-command load-file) "~/edwin/filadapt" #t)

(set-variable! enable-recursive-minibuffers #t)
(set-variable! select-buffer-create #f)
(set-variable! version-control #t)
(set-variable! kept-old-versions 0)
(set-variable! kept-new-versions 20)
(set-variable! buffer-menu-kill-on-quit #t)
(set-variable! rmail-delete-after-output #t)
(set-variable! mail-header-function #f)
(set-variable! info-selection-key button1-down)
(set-variable! enable-emacs-key-names #f)

;;(set-variable! editor-default-mode (ref-mode-object scheme))
;;(set-variable! auto-save-default #f)
;;(set-variable! auto-save-interval 1000)
;;(set-variable! enable-transcript-buffer #t)
;;(set-variable! evaluate-in-inferior-repl #t)

(case microcode-id/operating-system
((UNIX)
(let ((hostname (os/hostname)))
(set-variable! vc-make-backup-files #t)
(set-variable! diff-switches '("-u"))
(set-variable! frame-name-format (string-append "Edwin @ " (os/hostname)))
(set! x-screen-ignore-focus-button? #t)))
((OS/2)
;;(set-variable! backup-by-copying #t)
(set-variable! info-directory "c:\\local\\info\\")
(set-variable! rmail-primary-pop-server "martigny.ai.mit.edu")
(set-variable! rmail-pop-accounts
'(("martigny.ai.mit.edu" "cph" (FILE ".pop-martigny"))))))

(add-library-load-hook! 'NEWS-READER
(lambda ()
(set-variable! news-server "news.mit.edu")
(set-variable! user-mail-address "c...@zurich.ai.mit.edu")
(set-variable! mail-full-name "Chris Hanson")))

(define-variable explicit-4os2-args
"Args passed to inferior shell by M-x shell, if the shell is 4OS2.
Value is a list of strings."
'("/k"))

(set-variable! file-type-to-major-mode
(cons* '("sc" . scheme)
'("sch" . scheme)
'("lisp" . scheme)
(ref-variable file-type-to-major-mode)))

(set-variable! completion-ignored-extensions
(append '(".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg" ".pgs"
".tp" ".tps" ".vr" ".vrs")
(ref-variable completion-ignored-extensions)))

(add-event-receiver! (ref-variable text-mode-hook) turn-on-auto-fill)
(add-event-receiver!
(ref-variable c-mode-hook)
(lambda (buffer)
(define-variable-local-value! buffer
(ref-variable-object comment-multi-line)
#t)))

(add-event-receiver! (ref-variable dired-mode-hook)
(lambda (buffer)
(define-variable-local-value! buffer
(ref-variable-object truncate-lines)
#t)))

(modify-syntax-entry! text-mode:syntax-table #\" "\"")

(set-variable!
rmail-ignored-headers
(reduce (lambda (x y) (string-append x "\\|" y))
""
(map (lambda (regexp)
(string-append "^" regexp ":"))
'(
"[a-z-]*message-id"
"[a-z-]*transaction-id"
"address"
"approved"
"article-i\\.d\\."
"comment"
"comments"
"content-.*"
"control"
"date-received"
"distribution"
"edsc-.*"
"errors-to"
"expires"
"followup-to"
"full-name"
"home"
"in-reply-to"
"included-msgs"
"included-references"
"line-fold"
"line-of-the-week"
"lines"
"mail-from"
"mime-.*"
"mmdf-warning"
"name"
"news-software"
"newsgroups"
"nf-from"
"nf-id"
"nntp-posting-host"
"old-return-path"
"office"
"organisation"
"organization"
"origin"
"originating-client"
"os"
"path"
"phone"
"posted"
"posted-date"
"posted-from"
"posting-version"
"precedence"
"priority"
"rcvd-date"
"received"
"received-date"
"redistributed-date"
"references"
"relay-version"
"repository"
"reply-to"
"resent-.*"
"return-path"
"sender"
"status"
"summary-line"
"supersedes"
"telephone"
"url"
"usmail"
"usnail"
"via"
"x-.*"
"x400-.*"
"xref"
))))

(define-key 'fundamental #\m-\# 'top-window)
(define-key 'fundamental #\m-\} 'align-next-page)
(define-key 'fundamental #\m-\{ 'align-previous-page)
(define-key 'fundamental #\m-* 'auto-fill-mode)
(define-key 'fundamental #\c-m-p 'backward-up-list)
(define-key 'fundamental #\c-m-n 'up-list)
(define-key 'fundamental #\c-v 'scroll-up-several-screens)
(define-key 'fundamental #\m-v 'scroll-down-several-screens)
(define-key 'fundamental #\c-m-v 'scroll-other-window-several-screens)
(define-key 'fundamental #\m-_ 'bury-buffer)
(define-key 'fundamental #\c-m-% 'query-replace-regexp)
(define-key 'fundamental '(#\c-c #\c-s) 'select-repl)
(define-key 'fundamental '(#\c-c #\l) 'goto-line)
(define-key 'fundamental '(#\c-c #\r) 'tail-revert)
(define-key 'fundamental '(#\c-c #\t) 'truncate-lines)
(define-key 'fundamental '(#\c-x #\c-b) 'buffer-menu)
(define-key 'fundamental '(#\c-x #\c-k) 'kill-selected-buffer)
(define-key 'fundamental '(#\c-x #\!) 'shell)
(define-key 'fundamental '(#\c-x #\|) 'toggle-screen-width)
(define-key 'fundamental '(#\c-x #\f) #f)
(define-key 'fundamental '(#\c-x #\r) 'rmail)
(define-key 'fundamental #\c-m-u 'upcase-previous-sexp)
(define-key 'fundamental (make-special-key 'F2 2) 'compare-windows)
(define-key 'fundamental #\c-. 'repeat-complex-command)
;;(define-key 'fundamental button1-down 'x-mouse-ignore)
;;(define-key 'fundamental button2-down 'x-mouse-set-point)
;;;This has undesirable performance problems
;;;(define-key 'scheme #\space 'comment-fill-space)
;;;(define-key 'midas #\space 'comment-fill-space)
(define-key 'scheme #\m-q 'comment-fill-paragraph)
(define-key 'scheme #\c-m-j 'indent-lisp-body)
(define-key 'c #\c-m-r 'delete-c-macro-continuations)
(define-key 'c #\c-m-y 'insert-c-macro-continuations)
(define-key 'comint #\C-a 'comint-bol)

(string-table-put! scheme-mode:indent-methods "define-variable-local-value!" 2)
(string-table-put! scheme-mode:indent-methods "make-syntactic-closure" 2)
(string-table-put! scheme-mode:indent-methods "make-syntactic-closure-list" 2)
(string-table-put! scheme-mode:indent-methods "signal-thread-event" 1)
(string-table-put! scheme-mode:indent-methods "intercept-^g-interrupts" 1)
(string-table-put! scheme-mode:indent-methods "define-class" 2)
(string-table-put! scheme-mode:indent-methods "define-generic" 2)
(string-table-put! scheme-mode:indent-methods "define-generic-procedure" 2)
(string-table-put! scheme-mode:indent-methods "define-method" 2)
(string-table-put! scheme-mode:indent-methods "define-method-generator" 2)
;;;(string-table-put! scheme-mode:indent-methods "method" 1)

(case microcode-id/operating-system
((UNIX)
((ref-command shell) #t)
#|
((ref-command kill-buffer) "*scheme*")
(if (string=? "kleph" ((make-primitive-procedure 'hostname)))
((ref-command run-notifier)))
|#)
((OS/2)
(let ((set-prefs
(lambda (font fore back w h x y)
((ref-command set-font) font)
((ref-command set-foreground-color) fore)
((ref-command set-background-color) back)
((ref-command set-frame-size) w h)
(if (and x y) ((ref-command set-frame-position) x y)))))
(let ((font "6.Small")
(fore "#cd853f")
(back "#000000"))
(cond ((and (= (os2/desktop-width) 640)
(= (os2/desktop-height) 480))
(set-prefs font fore back 80 46 150 -1))
((and (= (os2/desktop-width) 800)
(= (os2/desktop-height) 600))
(set-prefs font fore back 80 57 308 1))
((and (= (os2/desktop-width) 1024)
(= (os2/desktop-height) 768))
(set-prefs font fore back 80 74 536 0))
((and (= (os2/desktop-width) 1280)
(= (os2/desktop-height) 1024))
;;(set-prefs font "black" "white" 128 99 500 0)
(set-prefs "8.Courier" "black" "white" 80 76 628 0))
(else
(set-prefs font fore back 80 46 #f #f)))))
(add-event-receiver! (ref-variable frame-creation-hook)
(lambda (screen)
(if (> (screen-x-size screen) 80)
(os2-screen/set-size! screen 80 (screen-y-size screen)))))
(set-default-directory "~")
((ref-command shell) #t))
((NT)
(cond ((and (= (win32-screen-width) 1024)
(= (win32-screen-height) 768))
(let ((font "Courier New 8"))
((ref-command set-default-font) font)
((ref-command set-font) font)
((ref-command set-frame-size) 80 44)
((ref-command set-frame-position) 376 0)))
((and (= (win32-screen-width) 1280)
(= (win32-screen-height) 1024))
(let ((font "Courier New 8"))
((ref-command set-default-font) font)
((ref-command set-font) font)
((ref-command set-frame-size) 80 60)
((ref-command set-frame-position) 632 0))))))
#|
(if (file-exists? "~/TODO")
(find-file "~/TODO"))
|#
;;; Edwin Variables:
;;; scheme-environment: '(edwin)
;;; scheme-syntax-table: edwin-syntax-table
;;; End:

0 new messages