Blob Blame Raw
--- ./elisp/ansi-doc.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/ansi-doc.el	2014-09-06 20:00:00.000000000 -0600
@@ -9,6 +9,8 @@
 ;; xdvi.   You may gzip the .dvi files and it will unzip them into tmp
 ;; as needed.
 
+(eval-and-compile
+  (require 'cl))
 
 (defvar ansi-doc-dir "/usr/local/doc/dpANS2")
 (defvar ansi-doc-alist nil)
@@ -55,38 +57,28 @@ return that file otherwise return file"
 or topic.   If there are several pieces of documentation then go through
 them successively.   Requires copying the "
   (interactive )
-  (let (x tem name lis first chap tmp-chap)
-    (or ansi-doc-alist
-	(progn
-	  (create-index-el-from-index-idx )
-	  (load (concat ansi-doc-dir "/index.el"))))
-    (setq name (completing-read "Doc on: " ansi-doc-alist nil t))
-    (progn  (setq ans nil)   (setq lis ansi-doc-alist)
-	    (while lis
-	      (cond ((equal (car  (car lis)) name)
-		     (setq ans (append ans (cdr  (cdr (car lis)))))))
-	      (setq lis (cdr lis)))
-	    )	    
-    (setq tem ans)
-    (if (cdr tem) (setq first "First") (setq first ""))
-    (while tem
-      (setq x (car tem))
-      (setq chap (concat ansi-doc-dir
-		  (downcase (format "/chap-%s.dvi"  (car x)))))
-      (setq chap (maybe-gzip-to-tmp chap))
-      (message "%s Doc in Chapter %s page %s) %s .." first (car x) (cdr x))
-      (if (cdr tem) (setq first "Next") (setq next "Final"))
-      (shell-command (concat "xdvi  -expert -xoffset .2 -yoffset -.2 "
-			     " -paper 7.2x8.5 "
-			     " -display "
-			     (or x-display-name ":0")
-			     "  -geometry -2-2 +" (+ (cdr x) 2)" "
-			     chap
-			     ))
-      (setq tem (cdr tem))
-
-      )
-    )
-  (message nil)
-  
-  )
+  (unless ansi-doc-alist
+    (create-index-el-from-index-idx )
+    (load (concat ansi-doc-dir "/index.el")))
+  (let* ((name (completing-read "Doc on: " ansi-doc-alist nil t))
+	 (tem (mapcan #'(lambda (elem)
+			  (and (equal name (car elem)) (cddr elem)))
+		      ansi-doc-alist))
+	 (first (if (cdr tem) "First" "")))
+    (dolist (x tem)
+      (message "%s Doc in Chapter %s page %s) .." first (car x) (cdr x))
+      (let ((chap (maybe-gzip-to-tmp
+		   (concat ansi-doc-dir
+			   (downcase (format "/chap-%s.dvi"  (car x)))))))
+	(setq first (if (cdr tem) "Next" "Final"))
+	(shell-command (concat "xdvi  -expert -xoffset .2 -yoffset -.2 "
+			       " -paper 7.2x8.5 "
+			       " -display "
+			       (or
+				(if (featurep 'xemacs)
+				    (console-connection (selected-console))
+				  x-display-name)
+				":0")
+			       "  -geometry -2-2 +" (+ (cdr x) 2)" "
+			       chap)))))
+  (message nil))
--- ./elisp/dbl.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/dbl.el	2014-09-06 20:00:00.000000000 -0600
@@ -97,29 +97,35 @@
 ;(define-key ctl-x-map "&" 'send-dbl-command)
 
 ;;Of course you may use `def-dbl' with any other dbl command, including
-;;user defined ones.   
+;;user defined ones.
 
-(defmacro def-dbl (name key &optional doc)
+(defmacro def-dbl (name keys &optional doc)
+  (unless (consp keys)
+    (setq keys (list keys)))
   (let* ((fun (intern (format "dbl-%s" (read name))))
-	 )
-    (list 'progn
- 	  (list 'defun fun '(arg)
-		(or doc "")
-		'(interactive "p")
-		(list 'dbl-call name 'arg))
-	  (list 'define-key 'dbl-mode-map key  (list 'quote fun)))))
+	 (keydefs (mapcar #'(lambda (key) `(define-key dbl-mode-map ,key
+					    (quote ,fun)))
+		   keys)))
+    `(progn
+      (defun ,fun (arg)
+	,(or doc "")
+	(interactive "p")
+	(dbl-call ,name arg))
+      ,@keydefs)))
 
-(def-dbl ":step %p"   "\M-s" "Step one source line with display")
-(def-dbl ":step %p"   "\C-c\C-s" "Step one source line with display")
-(def-dbl ":stepi %p"  "\C-c\t" "Step one instruction with display")
-(def-dbl ":next %p"   "\M-n" "Step one source line (skip functions)")
-(def-dbl ":next %p"   "\C-c\C-n" "Step one source line (skip functions)")
+(def-dbl ":step %p"  ("\M-s" "\C-c\C-s") "Step one source line with display")
+(def-dbl ":stepi %p" "\C-c\t" "Step one instruction with display")
+(def-dbl ":next %p"  ("\M-n" "\C-c\C-n") "Step one source line (skip functions)")
 (def-dbl ":r"   "\M-c" "Continue with display")
 
 (def-dbl ":finish" "\C-c\C-f" "Finish executing current function")
 (def-dbl ":up %p"     "\C-cu"   "Go up N stack frames (numeric arg) with display")
 (def-dbl ":down %p"   "\C-cd"   "Go down N stack frames (numeric arg) with display")
 
+(defvar dbl-last-frame nil)
+(defvar dbl-last-frame-displayed-p t)
+(defvar dbl-delete-prompt-marker nil)
+
 
 (defun dbl-mode ()
   "Major mode for interacting with an inferior Lisp or Maxima process.
@@ -227,7 +233,7 @@ You may also enter keyword break command
 
 
 (defun dbl (p)
- 
+
  "Makes a dbl buffer, suitable for running an inferior
   gcl.  You are prompted for a name for the buffer.  After the shell
   starts you should start up your lisp program (eg gcl).  The bufferd
@@ -235,16 +241,13 @@ You may also enter keyword break command
   debug loop with (si::dbl) or :dbl in a debug loop.  "
 
   (interactive "p")
-  
-  (let ( tem
-	(dir default-directory)
-	;; important for winnt version of emacs
+
+  (let (;; important for winnt version of emacs
 	(binary-process-input t)
 	(binary-process-output nil)
-	switches
 	(name (concat "dbl" (if (equal p 1) "" p) ""))
 	)
-    
+
     (switch-to-buffer (concat "*" name "*"))
     (or (bolp) (newline))
     (insert "Current directory is " default-directory "\n")
@@ -291,15 +294,6 @@ the `--fullname' keyword as in:
 ;; It records the filename and line number, and maybe displays that file.
 (defun dbl-filter (proc string)
   (let ((inhibit-quit t))
-    (set-buffer (process-buffer proc))
-    (goto-char (point-max))
-    (insert string)
-    (goto-char (point-max))
-    ))
-
-
-(defun dbl-filter (proc string)
-  (let ((inhibit-quit t))
     (if dbl-filter-accumulator
 	(dbl-filter-accumulate-marker proc
 				      (concat dbl-filter-accumulator string))
@@ -314,14 +308,13 @@ the `--fullname' keyword as in:
 	  (let ((end (string-match "\n" string)))
 	    (if end
               (progn
-		(setq me string)
 		(cond ((string-match
 			"\032\032\\([A-Za-z]?:?[^:]*\\):\\([0-9]*\\):[^\n]+\n"
 			string)
 		       (setq dbl-last-frame
 			      (cons
 			      (match-string 1 string)
-			      (string-to-int  (match-string 2 string))))
+			      (string-to-number (match-string 2 string))))
 		       
 		       (cond ((equal (cdr dbl-last-frame)  0)
 			      ;(message "got 0")
@@ -358,8 +351,7 @@ the `--fullname' keyword as in:
 (defun dbl-filter-insert (proc string)
   (let (moving
 	output-after-point 
-	(old-buffer (current-buffer))
-	start)
+	(old-buffer (current-buffer)))
     (set-buffer (process-buffer proc))
     ;; test to see if we will move the point.   We want that the
     ;; window-point of the buffer, should be equal to process-mark. 
@@ -370,7 +362,6 @@ the `--fullname' keyword as in:
 	(save-excursion
 	  ;; Insert the text, moving the process-marker.
 	  (goto-char (process-mark proc))
-	  (setq start (point))
 	  (insert string)
 	  (set-marker (process-mark proc) (point))
 	 ; (setq bill (cons (list 'hi (process-mark proc) (marker-position (process-mark proc)) (point)) bill))
@@ -488,19 +479,22 @@ If a non process buffer, just return cur
   (interactive)
   (save-excursion
     (end-of-line)
-    (cond ((get-buffer-process (current-buffer))
-	   (cond
-	    ((save-excursion
-	       (beginning-of-line)
-		(get-text-property (point) 'file-line)))
-	    ((progn (end-of-line) (re-search-backward " \\([^: ]+\\):\\([0-9]+\\)" 300 nil))
-	     (setq file (buffer-substring (match-beginning 1) (match-end 1)))
-	     (setq line (buffer-substring (match-beginning 2) (match-end 2)))
-	     (setq line (read line))
-	     (and (integerp line)
-		  (setq file (search-path file 'dbl-dirs))
-		  (list file line)))))
-	  (t (list (buffer-file-name) (+ 1 (count-lines (point))))))))
+    (cond
+     ((get-buffer-process (current-buffer))
+      (cond
+       ((progn
+	  (beginning-of-line)
+	  (get-text-property (point) 'file-line)))
+       ((progn (end-of-line) (re-search-backward " \\([^: ]+\\):\\([0-9]+\\)" 300 nil))
+	(let ((file (buffer-substring (match-beginning 1) (match-end 1)))
+	      (line (buffer-substring (match-beginning 2) (match-end 2))))
+	  (setq line (read line))
+	  (and (integerp line)
+	       (setq file (search-path file 'dbl-dirs))
+	       (list file line))))))
+     (t (list (buffer-file-name)
+	      (+ 1 (if (featurep 'xemacs) (line-number)
+		     (line-number-at-pos))))))))
 
 (defun dbl-find-and-display-line ()
   (interactive)
@@ -511,11 +505,11 @@ If a non process buffer, just return cur
   (let* ((buffer (dbl-find-file true-file))
 	 (window (display-buffer buffer t))
 	 (pos))
-    (save-excursion
-      (set-buffer buffer)
+    (with-buffer buffer
       (save-restriction
 	(widen)
-	(goto-line line)
+	(goto-char (point-min))
+	(forward-line (1- line))
 	(setq pos (point))
 	(setq overlay-arrow-string "=>")
 	(or overlay-arrow-position
@@ -554,8 +548,8 @@ If a non process buffer, just return cur
   (goto-char (point-max))
   (setq dbl-delete-prompt-marker (point-marker))
   (dbl-set-buffer)
-  (send-string (get-buffer-process current-dbl-buffer)
-	       (concat command "\n"))))
+  (process-send-string (get-buffer-process current-dbl-buffer)
+		       (concat command "\n"))))
 
 (defun dbl-subtitute-% (command n)
   (let* (result
@@ -566,8 +560,8 @@ If a non process buffer, just return cur
 	   (cond (in-dbl (setq file-line (dbl-find-line)))
 		 (t (setq file-line
 			  (list (buffer-file-name)
-				(+ 1 (count-lines
-							 (point)))))))))
+				(+ 1 (if (featurep 'xemacs) (line-number)
+				       (line-number-at-pos)))))))))
     (while (and command (string-match "\\([^%]*\\)%\\([adeflp]\\)" command))
       (let ((letter (string-to-char (substring command (match-beginning 2))))
 	    subst)
@@ -620,8 +614,8 @@ If a non process buffer, just return cur
 	     (if (get-buffer-process (current-buffer))
 		 (setq current-dbl-buffer (current-buffer)))
 	     (message name)
-	     (send-string (get-buffer-process current-dbl-buffer)
-			  (concat name "\n"))
+	     (process-send-string (get-buffer-process current-dbl-buffer)
+				  (concat name "\n"))
 	     (other-window 1)
 	     )))
 	(t
@@ -632,20 +626,21 @@ If a non process buffer, just return cur
 		       (1+ (count-lines 1 (point))))))
 	   (and    downcase-filenames-for-dbl
 		   (setq file-name (downcase file-name)))
-	   (send-string (get-buffer-process current-dbl-buffer)
-			(concat "break " file-name ":" line "\n"))))))
+	   (process-send-string (get-buffer-process current-dbl-buffer)
+				(concat "break " file-name ":" line "\n"))))))
 	
 	
 (defun dbl-read-address()
   "Return a string containing the core-address found in the buffer at point."
   (save-excursion
-   (let ((pt (dot)) found begin)
-     (setq found (if (search-backward "0x" (- pt 7) t)(dot)))
-     (cond (found (forward-char 2)(setq result
-			(buffer-substring found
-				 (progn (re-search-forward "[^0-9a-f]")
-					(forward-char -1)
-					(dot)))))
+   (let* ((pt (dot))
+	  (found (if (search-backward "0x" (- pt 7) t) (dot)))
+	  begin)
+     (cond (found (forward-char 2)
+		  (buffer-substring found
+				    (progn (re-search-forward "[^0-9a-f]")
+					   (forward-char -1)
+					   (dot))))
 	   (t (setq begin (progn (re-search-backward "[^0-9]") (forward-char 1)
 				 (dot)))
 	      (forward-char 1)
@@ -680,6 +675,6 @@ It is for customization by you.")
 	  (t (setq comm addr)))
     (switch-to-buffer current-dbl-buffer)
     (goto-char (dot-max))
-    (insert-string comm)))
+    (insert comm)))
 
 (provide 'dbl)
--- ./elisp/doc-to-texi.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/doc-to-texi.el	2014-09-06 20:00:00.000000000 -0600
@@ -51,7 +51,7 @@
 	   (let ((fun (get-match 1))
 		 (type (get-match 2))
 		 (package (get-match 3))
-		 args body)
+		 body)
 	     (goto-char (match-end 0))
 	     (setq body (buffer-substring (point) (- end 1)))
 	     (delete-region beg end )
@@ -78,22 +78,22 @@
 			  (?d .  "{Declaration}"))))))
       (if u (replace-match u)))))
 
-(setq b-alist '((?n . "number.texi")
-		(?s . "sequence.texi")
-		(?c . "character.texi")
-		(?l . "list.texi")
-		(?i . "io.texi")
-		(?a . "internal.texi")
-		(?f . "form.texi")
-		(?C . "compile.texi")
-		(?S . "symbol.texi")
-		(?t . "system.texi")
-		(?d . "structure.texi")
-		(?I . "iteration.texi")
-		(?u . "user-interface.texi")
-		(?d . "doc.texi")
-		(?b . "type.texi")
-		))
+(defvar b-alist '((?n . "number.texi")
+		  (?s . "sequence.texi")
+		  (?c . "character.texi")
+		  (?l . "list.texi")
+		  (?i . "io.texi")
+		  (?a . "internal.texi")
+		  (?f . "form.texi")
+		  (?C . "compile.texi")
+		  (?S . "symbol.texi")
+		  (?t . "system.texi")
+		  (?d . "structure.texi")
+		  (?I . "iteration.texi")
+		  (?u . "user-interface.texi")
+		  (?d . "doc.texi")
+		  (?b . "type.texi")
+		  ))
 (defun try1 ()
   (interactive)
   (while (re-search-forward "\n@def" nil t)
@@ -114,7 +114,7 @@
       
 
       
-(setq xall	  (mapcar 'cdr  b-alist))
+(defvar xall	  (mapcar 'cdr  b-alist))
 
 ;(let ((all xall)) (while all (set-buffer (car all))  (write-file (car all)) (setq all (cdr all))))
 ;(let ((all xall)) (while all   (find-file (car all)) (setq all (cdr all))))	
--- ./elisp/gcl.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/gcl.el	2014-09-06 20:00:00.000000000 -0600
@@ -14,6 +14,7 @@
 ;; M-p complete the current input by looking back through the buffer to see what was last typed
 ;;        using this prompt and this beginning.   Useful in shell, in lisp, in gdb,...
 
+(require 'inf-lisp)
 
 (setq lisp-mode-hook  'remote-lisp)
 
@@ -23,6 +24,9 @@
 ;(global-set-key "p" 'lisp-complete)
 (global-set-key "p" 'smart-complete)
 
+(defvar lisp-package nil)
+(defvar lisp-process nil)
+
 (defun remote-lisp (&rest l)
   (and (boundp 'lisp-mode-map)
        lisp-mode-map
@@ -158,12 +162,12 @@ by get-buffer-package.
 	))
     
 
-    (send-string this-lisp-process
-		 (concat ";;end of form" "\n" telnet-new-line))
+    (process-send-string this-lisp-process
+			 (concat ";;end of form" "\n" telnet-new-line))
     (cond (arg
 	   (if (numberp arg) (setq arg "compile"))
-	   (send-string this-lisp-process (concat "(" arg "'" fun ")"
-						  telnet-new-line))))
+	   (process-send-string this-lisp-process (concat "(" arg "'" fun ")"
+							  telnet-new-line))))
     (and time-to-throw-away
 	 (string-match "telnet"(buffer-name (process-buffer proc)))
 	 (dump-output proc time-to-throw-away))
@@ -194,7 +198,7 @@ by get-buffer-package.
 
 (defun my-send-region (proc beg end)
   (cond ((or (string-match "telnet" (process-name proc)))
-	 (send-region proc beg end))
+	 (process-send-region proc beg end))
 	(t
 	 (let ((package (get-buffer-package)))
 	   (save-excursion
@@ -213,7 +217,7 @@ by get-buffer-package.
 		 (write-region (point-min) (point-max) tmp-lisp-file nil nil)))
 	   (write-region beg end tmp-lisp-file t nil)
 	   (message "sending ..")
-	   (send-string
+	   (process-send-string
 	    proc
 	    (concat "(lisp::let ((*load-verbose* nil)) (#+sdebug si::nload #-sdebug load \""
 		    tmp-lisp-file
@@ -268,9 +272,9 @@ by get-buffer-package.
 		       (prog2 (other-window 1)
 			      (get-buffer-process (current-buffer))
 			      (other-window 1)))))
-	(send-string current-lisp-process "(macroexpand '")
-	(send-region current-lisp-process  beg (point) )
-	(send-string current-lisp-process ")\n")))))
+	(process-send-string current-lisp-process "(macroexpand '")
+	(process-send-region current-lisp-process  beg (point) )
+	(process-send-string current-lisp-process ")\n")))))
 
 (defun delete-comment-char (arg) 
   (while (and (> arg 0) (looking-at comment-start)) (delete-char 1) 
@@ -333,8 +337,8 @@ so a second comment-region adds another
  (interactive "P") 
  (save-excursion 
    (let ((beg (dot)) 
-	 (ok t)(end (mark)))
-          (comment-region1 beg end arg))))
+	 (end (mark)))
+     (comment-region1 beg end arg))))
 
 (defun comment-region1 (beg end arg)
   (let ((ok t))
@@ -347,7 +351,7 @@ so a second comment-region adds another
 	   (while ok 
 	     (cond (arg 
 		    (delete-comment-char arg)) 
-		   (t   (insert-string comment-start)))
+		   (t   (insert comment-start)))
 	     (if (< end (dot)) (setq ok nil)
 	       (if  (search-forward "\n" end t) nil (setq ok nil))) )
 	 (widen))))
@@ -363,13 +367,13 @@ so a second comment-region adds another
 	     (current-lisp-process (or  proc lisp-process)))
 	(other-window 1)
 	(message "Tracing: %s" (buffer-substring (point) end))
-	(send-string current-lisp-process "(trace ")
-	(send-region current-lisp-process (point) end)
-	(send-string current-lisp-process ")\n")))))
+	(process-send-string current-lisp-process "(trace ")
+	(process-send-region current-lisp-process (point) end)
+	(process-send-string current-lisp-process ")\n")))))
 
 (defun gcl-mode ()
   (interactive)
   (lisp-mode)
   )
 
-(provide 'gcl)
\ No newline at end of file
+(provide 'gcl)
--- ./elisp/man1-to-texi.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/man1-to-texi.el	2014-09-06 20:00:00.000000000 -0600
@@ -106,6 +106,8 @@
 ;	End of indented unfilled display.
 ; 
 
+(require 'makeinfo)
+
 (defun do-replace (lis &optional not-in-string)
   (let (x case-fold-search)
     (while lis
@@ -229,7 +231,9 @@
       (kill-buffer (get-buffer "foo.info")))
 
   (find-file "foo.n")
-  (toggle-read-only 0)
+  (if (featurep 'xemacs)
+      (toggle-read-only 0)
+    (read-only-mode 1))
   (doit)
   (write-file "foo.texi")
   (makeinfo-buffer ))
@@ -285,15 +289,14 @@
     (while (< i (length vec)) (setq tot (+ (aref vec i) tot)) (setq i (+ i 1)))
     (setq surplus (/ (- 70 tot) (+ 1 (length (car items)))))
     (while items
-      (setq tem (car items))
-      (setq i 0)
-      (let (ans x)
+      (let ((tem (car items)))
+	(setq i 0)
 	(insert "")
-	(while tem
-	  (insert (tex-center (car tem) (+ (aref vec i) surplus) 'left
-			      (real-length (car tem))))
-	  (setq tem (cdr tem)) (setq i (+ i 1)))
-	(insert "\n"))
+	(dolist (elem tem)
+	  (insert (tex-center elem (+ (aref vec i) surplus) 'left
+			      (real-length elem)))
+	  (setq i (+ i 1))))
+      (insert "\n")
       (setq items (cdr items)))
     )
   )
@@ -330,22 +333,7 @@
 	(insert "@w{" ) (end-of-line) (insert "}")
 	    (forward-line 1) (beginning-of-line))))
 
-(defun add-keywords ()
-  (let ((tem tk-control-options)x lis l y)
-    (while tem
-      (setq l (car tem))
-      (setq tem (cdr tem))
-      (setq x (symbol-name (car l )))
-      (setq lis (car (cdr l)))
-      (while lis
-	(cond ((atom lis) (setq lis nil))
-	      (t (setq y (symbol-name (car lis)))
-		 (do-replace (list (list (concat x  " "y "")
-					 (concat x " :"y "")
-					 )))))
-	(setq lis (cdr lis))))))
-
-(setq tk-control-options
+(defvar tk-control-options
       '((after fixnum) 
 	(exit fixnum) 
 	(lower window) 
@@ -375,7 +363,22 @@
 	(update (idletasks)) 
 	))
 
-(setq tk-widget-options
+(defun add-keywords ()
+  (let ((tem tk-control-options)x lis l y)
+    (while tem
+      (setq l (car tem))
+      (setq tem (cdr tem))
+      (setq x (symbol-name (car l )))
+      (setq lis (car (cdr l)))
+      (while lis
+	(cond ((atom lis) (setq lis nil))
+	      (t (setq y (symbol-name (car lis)))
+		 (do-replace (list (list (concat x  " "y "")
+					 (concat x " :"y "")
+					 )))))
+	(setq lis (cdr lis))))))
+
+(defvar tk-widget-options
       '(
 	(button (activate configure deactivate flash invoke)) 
 	(listbox ( configure curselection delete get insert nearest
@@ -404,7 +407,7 @@
 	(toplevel ( configure)) 
 	))
 
-(setq manual-sections
+(defvar manual-sections
       '(after bind button canvas checkbutton destroy  entry exit focus foo frame grab label lbSingSel listbox lower menu menubar menubutton message option options pack-old pack place radiobutton raise scale scrollbar selection send text tk tkerror tkvars tkwait toplevel update winfo wm))
 
 ;(setq widgets (sort (mapcar 'car tk-widget-options) 'string-lessp))
--- ./elisp/smart-complete.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/smart-complete.el	2014-09-06 20:00:00.000000000 -0600
@@ -85,8 +85,7 @@
 	(pat (concat (regexp-for-this-prompt prompt)
 		     "\\(" (regexp-quote str) "\\)" ))
 	offered (not-yet t)
-	)
-    (setq bill pat)
+	at this)
     (while (and  not-yet
 		 (re-search-backward pat nil t))
       (goto-char (match-beginning 1))
--- ./elisp/sshell.el.orig	2014-09-06 09:45:30.000000000 -0600
+++ ./elisp/sshell.el	2014-09-06 20:00:00.000000000 -0600
@@ -119,9 +119,9 @@ and lisp-send-defun."
 	 (ff
 	  (save-excursion
 	    (skip-chars-backward "[a-z---_0-9$/A-Z~#.]")
-	    (buffer-substring (setq beg (point)) p))))
-    (setq dir (or (file-name-directory ff) default-directory))
-    (setq file (file-name-nondirectory ff))
+	    (buffer-substring (setq beg (point)) p)))
+	 (dir (or (file-name-directory ff) default-directory))
+	 (file (file-name-nondirectory ff)))
     (cond ((and (setq tem (file-name-completion (or file "") dir))
 		(not (equal tem file)))
 	   (cond ((eq tem t))
@@ -181,11 +181,10 @@ If yours does, you will probably want to
 
 (defun make-sshell (name program &optional startfile &rest switches)
   (let ((buffer (get-buffer-create (concat "*" name "*")))
-	proc status size)
+	proc status)
     (setq proc (get-buffer-process buffer))
     (if proc (setq status (process-status proc)))
-    (save-excursion
-      (set-buffer buffer)
+    (with-buffer buffer
       ;;    (setq size (buffer-size))
       (if (memq status '(run stop))
 	  nil
@@ -376,4 +375,4 @@ Also put cursor there."
 	       (point)))
 (require 'smart-complete)
 
-(provide 'sshell)
\ No newline at end of file
+(provide 'sshell)