CS 227 lecture -*- Outline -*- * working with emacs and scheme See the handout "How to Run Scheme" will show you 3 ways, the last of which is best, but others useful to know for other languages ** the hard way edit file in emacs % emacs C-x C-f quit emacs C-x C-c start scheme % scheme (load "file.ss") quit scheme C-d edit file in emacs... ** unix processes to Unix a process is the execution of a program (a task) (like our series of steps) can have more than one around at a time *** only one process taking input from your keyboard at a time this is the foreground process there may be other processes that are suspended not running but will pick up where they left off *** an easier way ----------- % scheme ... C-z % emacs ... C-z % fg %scheme ;back in scheme (load "hw2b.ss") > ... C-z % ------------ C-z means typing control and at the same time z in scheme this echos as ^Z C-z suspends job, fg resumes it (puts in foreground) when scheme resumes, it doesn't prompt you again, but it is waiting for input you can type in a number, such as 7, and then return to see a prompt Don't forget to save your files before suspending emacs, scheme reads only the file on disk, not the emacs buffer a good way to save files in emacs is C-x s, and then answer y to the questions When you logout, you should properly exit emacs and scheme *** the jobs command the jobs command shows what processes you have suspended (from your shell) ----------- % scheme ... C-z % jobs [1] + Suspended scheme % emacs ... C-x C-z % jobs [1] - Suspended scheme [2] + Suspended emacs % fg %scheme ;back in scheme (load "anotherfile.ss") > ... C-z % jobs [1] + Suspended scheme [2] - Suspended emacs % ------------ background processes given a job number (printed in square brackets) on fg command can use job number: fg %1 or command name: fg %emacs leaving off argument resumes the + job: fg ** even easier (requires a workstation) open an emacs window, and run scheme in the vincent window ----------- % emacs & % scheme > ... ----------- separate the windows so it's clear to which you're typing type scheme to the vincent prompt, not in emacs You MUST save your files before you load them into scheme, scheme reads only the file on disk, not the emacs buffer this will be a disaster if you're not on a workstation ** even easier using scheme mode in emacs M-x run-scheme will be using this in lectures...