52.219 Help

Here is a list of things that we might need for help. I'll try and add to it as I go along, and feel free to send me additions. As an aside, I think we should all attempt to minimise typing. It's slooooooooow, and prone 2o erorrs. Some of the stuff below is aimed at achieving this. Read on :)


EMACS

Start emacs in background: emacs& (NOTE: do this from directory files exist in)
Change Font: control rightmouse, or shift/left-mouse
Run scheme in emacs: meta x run-scheme (meta is beside Alt)
To change buffer: control leftmouse
Delete line: ctl k
next page: ctl v
prev page: meta v
centre on cursor: ctl l
to search for text: ctl s textIwanttofind
to search for text (backwards): ctl r textIwanttofind
cancel command: ctl g (and it will go beep!)
get a file: ctl x ctl f filenameIwant
save file: ctl x ctl s
save file with a name: ctl x ctl
to quit emacs: ctl x ctl c
to replace text: meta x replace-string
set up scheme mode: meta x scheme-mode

Scheme in EMACS

Why bother?

Note

NOTE 1. Make sure you have my init file (/home/s7/pat/scheme/pub/ScmInit.scm) in your home directory: ScmInit.scm

NOTE 2. Always use file with .scm extension, example btree.scm This is because emacs will then recognise this as a scheme file and edit/format it as such

NOTE 3. When typing in source text for a function use line feed to get correct formatting (rather than line feed). Otherwise put mouse on line then hit tab key

NOTE 4. Try and adopt style consistent with that used in the course That is, use cond rather than if, close off function on last line (not many trailing closing brackets), feel free to use set! and do, ignore lambda (use syntactic sugar)

running scheme: meta x run scheme
redo previous line: meta p
go back two lines: meta p meta p
go back three lines: meta p meta p meta p
go forwards one line: meta n
go forwards two lines: meta n meta n

UNIX, some useful stuff

set up tc-shell: tcsh& (gives us ability to repeat and edit commands.)
cd dirname; change directory
cd ~ ; go to top directory
Concatenate files: cat
Copy a file: cp f1 f2
chmod 700 f: gives ME all access
chmod 755 f; gives ME all access, staff read/ex, students read/ex
Difference between two files: diff f1 f2
Direct output to a file: >
Find string in file: grep 'string' fname
head -n file gives first n lines of file
Kill printer file: lpq to get spool number then ... lprm xxx
List all files: ls -a
List files in chrono order: ls -t
List files with long info: ls -l
paste f1 f2 gives new file with f1 before f2 record by record
Pipe to program: |
Print a file on screen: pr [-n] fname (alternatively : page fname)
Print last 10 lines: tail fname
Purge a file: rm fname
Rename a file: mv f1 f2 looks a lot like move file f1 to f2
script filename: trace to filename, terminate with exit
Set bracket matching in vi: set sm
Spelling check: spell f1
Two Up: psnup -2 x.ps > y.ps
tvtwm& fires up window manager
Time and date: date
Who's on: who
Wild cards: * for any number of chars
Wild cards: ? for 1 char
Wild cards: [A-Z] for selection of chars
Word count: wc fname