]> code.delx.au - gnu-emacs/blobdiff - lisp/vmsproc.el
(image-mode): Revert 2007-01-30 changes.
[gnu-emacs] / lisp / vmsproc.el
index 562376936704faa81103e70edd1cab6390a82501..71bb5e015741be194592e713cc318749afb0c305 100644 (file)
@@ -1,6 +1,7 @@
 ;;; vmsproc.el --- run asynchronous VMS subprocesses under Emacs
 
-;; Copyright (C) 1986, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Mukesh Prasad
 ;; Maintainer: FSF
@@ -34,6 +35,8 @@
   "String to insert to distinguish commands entered by user.")
 
 (defvar subprocess-running nil)
+(defvar subprocess-buf nil)
+
 (defvar command-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "\C-m" 'command-send-input)
     map))
 
 (defun subprocess-input (name str)
-  "Handles input from a subprocess.  Called by Emacs."
+  "Handle input from a subprocess.  Called by Emacs."
   (if display-subprocess-window
       (display-buffer subprocess-buf))
-  (let ((old-buffer (current-buffer)))
-    (set-buffer subprocess-buf)
+  (with-current-buffer subprocess-buf
     (goto-char (point-max))
-    (insert str)
-    (insert ?\n)
-    (set-buffer old-buffer)))
+    (insert str ?\n)))
 
 (defun subprocess-exit (name)
   "Called by Emacs upon subprocess exit."
   (setq subprocess-running nil))
 
 (defun start-subprocess ()
-  "Spawns an asynchronous subprocess with output redirected to
+  "Spawn an asynchronous subprocess with output redirected to
 the buffer *COMMAND*.  Within this buffer, use C-m to send
 the last line to the subprocess or to bring another line to
 the end."
@@ -98,7 +98,7 @@ the end."
   ;;     (delete-file output-filename))))
 
 (defun subprocess-command ()
-  "Starts asynchronous subprocess if not running and switches to its window."
+  "Start asynchronous subprocess if not running and switch to its window."
   (interactive)
   (if (not subprocess-running)
       (start-subprocess))
@@ -106,8 +106,8 @@ the end."
        (progn (pop-to-buffer subprocess-buf) (goto-char (point-max)))))
 
 (defun command-send-input ()
-  "If at last line of buffer, sends the current line to
-the spawned subprocess.  Otherwise brings back current
+  "If at last line of buffer, send the current line to
+the spawned subprocess.  Otherwise bring back current
 line to the last line for resubmission."
   (interactive)
   (beginning-of-line)
@@ -134,7 +134,7 @@ line to the last line for resubmission."
          current-line)))))
 
 (defun command-kill-line ()
-  "Kills the current line.  Used in command mode."
+  "Kill the current line.  Used in command mode."
   (interactive)
   (beginning-of-line)
   (kill-line))