	    Outline for IAP Intro to UNIX Soft Dev Course
				DAY 2
		      Erik Nygren     1995.01.19
		======================================
		   --------------------------------

VII. RCS, the Revision Control System
	A. Why should one use RCS?
		1. Keep history of changes to program
			so can revert to older versions and generate patches
		2. Arbitrate file usage between multiple users
	B. Basic concepts
		1. RCS repository: either foo,v or RCS/foo,v
		2. Checking files in an out
		3. Locks
	C. Basic commands
		1.  ci	     --- checks in and removes existing copy
		2.  ci -u    --- checks in and releases lock (file
				 becomes read-only)
		3.  ci -l    --- checks in and retains lock (file is rw)
		4.  co 	     --- checks out with no lock (read-only)
		5.  co -u    --- checks out with no lock (read-only)
		6.  co -l    --- checks out and obtains exclusive lock
		7.  rlog     --- look at log
		8.  rcsdiff  --- compare revisions and create patches
			rcsdiff -r1.4 -c foo.c
		9.  rcs -u   --- break locks
		10. rcs      --- do random things to rcs file
	D. Lots of other options (briefly mention)
		1. History trees
		2. Merging versions
		3. Symbolic version names
		4. For info, read man pages: 
			rcsintro, rcsdiff, ci, co, rcs, rcsmerge
	E. Logs/headers in files:
		$Header$
		$Id$
		$Date$
		$Log$
		$Author$
	F. Reverting to old versions without dealing with branch messiness
		ci -l foo	# save old version before clobbering
				# plus get a lock
		co -r1.5 foo	# revert to version 1.5
		ci -u foo	# check in the reverted file and unlock
	G. Diffs and patches
		1. Creating diff's:
			diff file1 file2
			rcsdiff -r1.5 -c foo  # changes from 1.5 to present
		2. Types of diffs
			- Old style
				diff
			- Context (my favorite)
				diff -c
			- Unified
				diff -u
			- Ed (???)
				diff -e
		3. Applying diffs/patches
			patch < foo.patch -p -E
	H. Other options
		1. SCCS - like RCS but not as available here
		2. CVS - layer on top of RCS which allows for dealing
			with really big source trees



IX. Emacs as a Unified Environment
	A. Emacs19
		add emacs19; emacs19
	A. Buffers and files and windows
		C-x C-f		open file in a new buffer 
		C-x C-w		write file out with a different name
		C-x C-s		save buffer under current name
		C-x b		switch to buffer
		C-x k		kill current buffer
		C-g		cancel
		C-x 2		split current window
		C-x o		switch to other window
		C-x 1		make current window only window
		C-x 0		remove current window
	B. .emacs file and elisp
		1. ESC ESC		enter elisp command
		2.

		(defun startup19 () "startup for emacs19"
				(...)
				(...)
				(...)
			(cond (window system
				(...)
				(...)
				(...)
			))
		)
		(if (string-match "^19" emacs-version) (startup19))

		3. dotfiles locker.  
			add dotfiles; cd /mit/dotfiles/Emacs
		4. Lisp-interaction-mode
			C-j executes commands
	C. Regions
		C-SPACE	then move to end
			or
		mouse with button 1 to drag select
	D. c-mode
		1. M-x c-mode	enters C mode
		2. Indentation of code: press TAB anwhere on line
			M-C-\ will indent current region
		3. Make return auto-indent:
			(define-key c-mode-map "\C-m" 'newline-and-indent)
		4. Paren matching
			(load-library "paren")
			region face defines color
		5. M-; for adding comments
		6. M-x comment-region		comments out regions
		7. M-/ for completing words
		8. M-C-e	move to end of function
		9. M-C-h	select function
		10. M-x c-macro-expand-region
		11. C-_  undo
	E. M-x compile

		1.

		;; Use C-c C-c in c-mode to do a compile
		(defun my-save-and-compile ()
		  (interactive "")
		  (save-buffer 0)
		  (compile "make -k"))  
		(define-key c-mode-map "\C-c\C-c" 'my-save-and-compile)

		2. Middle button goes to error
		3. M-n goes to next error

			(define-key c-mode-map "\M-n" 'next-error)

	F. Tags
		etags *.[ch]		generates TAGS file
		M-.			looks up current tag

	G. Faces and colorization
		1. M-x list-faces-display
		2. (set-face-foreground 'face "color")		
		3. (set-face-background 'face "color")
		4. Font-lock minor mode
		5. (require 'hilit19)
		6. (font-lock-mode 1)		
		7. (transient-mark-mode 1)	highlight active region
		8. C coloring:

		        ;; comments
		        (hilit-translate comment 'pink)
		        ;; string constants
		        (hilit-translate string 'lightsalmon)
		        ;; "#include"
		        (hilit-translate include 'yellow)
		        ;; keywords (if, for, ...)
		        (hilit-translate keyword 'green)
		        ;; function definitions
		        (hilit-translate defun 'aquamarine2)
		        ;; "#define"
		        (hilit-translate define 'yellow)
		        ;; struct definitions
		        (hilit-translate decl 'gray80)

		9. Colorize on file writes

	        ;;; colorize on file writes
	        (if (not (memq 'hilit-rehighlight-buffer write-file-hooks))
	           (setq write-file-hooks
	                  (cons 'hilit-rehighlight-buffer write-file-hooks)))
		
	H. M-x shell
		M-p, M-n   for history

	J. M-x gdb
		M-p, M-n   	for history
		C-c TAB		for step
		C-x C-a C-b	in c file will set break point at that line
