annotate lisp/obsolete/vmsproc.el @ 96849:d049ef97c446

* print.c (print_object): Check print_depth before searching for circularities.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 21 Jul 2008 05:02:31 +0000
parents 090433f48c5f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96523
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
1 ;; -*- no-byte-compile: t -*-
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
2 ;; Not byte compiled because it uses functions that are not part of
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
3 ;; emacs, so it would generate unnecessary warnings.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
4 ;;; vmsproc.el --- run asynchronous VMS subprocesses under Emacs
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
5
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
6 ;; Copyright (C) 1986, 2001, 2002, 2003, 2004, 2005,
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
7 ;; 2006, 2007, 2008 Free Software Foundation, Inc.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
8
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
9 ;; Author: Mukesh Prasad
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
10 ;; Maintainer: FSF
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
11 ;; Keywords: vms
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
12
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
14
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
18 ;; (at your option) any later version.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
19
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
23 ;; GNU General Public License for more details.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
24
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
27
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
28 ;;; Commentary:
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
29
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
30 ;;; Code:
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
31
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
32 (defvar display-subprocess-window nil
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
33 "If non-nil, the subprocess window is displayed whenever input is received.")
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
34
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
35 (defvar command-prefix-string "$ "
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
36 "String to insert to distinguish commands entered by user.")
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
37
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
38 (defvar subprocess-running nil)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
39 (defvar subprocess-buf nil)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
40
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
41 (defvar command-mode-map
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
42 (let ((map (make-sparse-keymap)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
43 (define-key map "\C-m" 'command-send-input)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
44 (define-key map "\C-u" 'command-kill-line)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
45 map))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
46
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
47 (defun subprocess-input (name str)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
48 "Handle input from a subprocess. Called by Emacs."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
49 (if display-subprocess-window
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
50 (display-buffer subprocess-buf))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
51 (with-current-buffer subprocess-buf
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
52 (goto-char (point-max))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
53 (insert str ?\n)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
54
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
55 (defun subprocess-exit (name)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
56 "Called by Emacs upon subprocess exit."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
57 (setq subprocess-running nil))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
58
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
59 (defun start-subprocess ()
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
60 "Spawn an asynchronous subprocess with output redirected to
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
61 the buffer *COMMAND*. Within this buffer, use C-m to send
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
62 the last line to the subprocess or to bring another line to
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
63 the end."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
64 (if subprocess-running
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
65 (return t))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
66 (setq subprocess-buf (get-buffer-create "*COMMAND*"))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
67 (with-current-buffer subprocess-buf
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
68 (use-local-map command-mode-map))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
69 (setq subprocess-running (spawn-subprocess 1 'subprocess-input
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
70 'subprocess-exit))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
71 ;; Initialize subprocess so it doesn't panic and die upon
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
72 ;; encountering the first error.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
73 (and subprocess-running
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
74 (send-command-to-subprocess 1 "ON SEVERE_ERROR THEN CONTINUE")))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
75
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
76 (defun subprocess-command-to-buffer (command buffer)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
77 "Execute COMMAND and redirect output into BUFFER."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
78 (let (cmd args)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
79 (setq cmd (substring command 0 (string-match " " command)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
80 (setq args (substring command (string-match " " command)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
81 (call-process cmd nil buffer nil "*dcl*" args)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
82 ;; BUGS: only the output up to the end of the first image activation is trapped.
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
83 ;; (if (not subprocess-running)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
84 ;; (start-subprocess))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
85 ;; (with-current-buffer buffer
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
86 ;; (let ((output-filename (concat "SYS$SCRATCH:OUTPUT-FOR-"
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
87 ;; (getenv "USER") ".LISTING")))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
88 ;; (while (file-exists-p output-filename)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
89 ;; (delete-file output-filename))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
90 ;; (define-logical-name "SYS$OUTPUT" (concat output-filename "-NEW"))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
91 ;; (send-command-to-subprocess 1 command)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
92 ;; (send-command-to-subprocess 1 (concat
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
93 ;; "RENAME " output-filename
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
94 ;; "-NEW " output-filename))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
95 ;; (while (not (file-exists-p output-filename))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
96 ;; (sleep-for 1))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
97 ;; (define-logical-name "SYS$OUTPUT" nil)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
98 ;; (insert-file output-filename)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
99 ;; (delete-file output-filename))))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
100
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
101 (defun subprocess-command ()
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
102 "Start asynchronous subprocess if not running and switch to its window."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
103 (interactive)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
104 (if (not subprocess-running)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
105 (start-subprocess))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
106 (and subprocess-running
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
107 (progn (pop-to-buffer subprocess-buf) (goto-char (point-max)))))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
108
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
109 (defun command-send-input ()
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
110 "If at last line of buffer, send the current line to
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
111 the spawned subprocess. Otherwise bring back current
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
112 line to the last line for resubmission."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
113 (interactive)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
114 (beginning-of-line)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
115 (let ((current-line (buffer-substring (point) (line-end-position))))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
116 (if (eobp)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
117 (progn
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
118 (if (not subprocess-running)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
119 (start-subprocess))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
120 (if subprocess-running
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
121 (progn
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
122 (beginning-of-line)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
123 (send-command-to-subprocess 1 current-line)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
124 (if command-prefix-string
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
125 (progn (beginning-of-line) (insert command-prefix-string)))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
126 (forward-line 1))))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
127 ;; else -- if not at last line in buffer
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
128 (goto-char (point-max))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
129 (backward-char)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
130 (forward-line 1)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
131 (insert
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
132 (if (compare-strings command-prefix-string nil nil
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
133 current-line 0 (length command-prefix-string))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
134 (substring current-line (length command-prefix-string))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
135 current-line)))))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
136
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
137 (defun command-kill-line ()
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
138 "Kill the current line. Used in command mode."
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
139 (interactive)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
140 (beginning-of-line)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
141 (kill-line))
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
142
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
143 (define-key esc-map "$" 'subprocess-command)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
144
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
145 (provide 'vmsproc)
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
146
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
147 ;; arch-tag: 600b2512-f903-4887-bcd2-e76b306f5b66
090433f48c5f * vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
148 ;;; vmsproc.el ends here