From 4cdc1d4b2d56076be98b797b3fa10afed817bcec Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 20 Nov 1993 22:00:55 +0000 Subject: [PATCH] (tex-start-shell): Don't use -v option. (tex-send-command): Insert text in the buffer, then use comint-send-input to send it. --- lisp/textmodes/tex-mode.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index f91245c81d6..eddf642468f 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -763,7 +763,7 @@ line numbers for the errors." (make-comint "tex-shell" (or tex-shell-file-name (getenv "ESHELL") (getenv "SHELL") "/bin/sh") - nil "-v")) + nil)) (let ((proc (get-process "tex-shell"))) (set-process-sentinel proc 'tex-shell-sentinel) (process-kill-without-query proc) @@ -792,22 +792,27 @@ line numbers for the errors." (setq default-directory directory)))) (defun tex-send-command (command &optional file background) - "Send COMMAND to tex-shell, substituting optional FILE for *. + "Send COMMAND to TeX shell process, substituting optional FILE for *. Do this in background if optional BACKGROUND is t. If COMMAND has no *, FILE will be appended, preceded by a blank, to COMMAND. If FILE is nil, no substitution will be made in COMMAND. COMMAND can be any expression that evaluates to a command string." (save-excursion (let* ((cmd (eval command)) + (proc (get-process "tex-shell")) (star (string-match "\\*" cmd)) - (front (substring cmd 0 star)) - (back (if star (substring cmd (1+ star)) ""))) - (comint-proc-query (get-process "tex-shell") - (concat - (if file (if star (concat front file back) - (concat cmd " " file)) - cmd) - (if background "&\n" "\n")))))) + (string + (concat + (if file + (if star (concat (substring cmd 0 star) + file (substring cmd (1+ star))) + (concat cmd " " file)) + cmd) + (if background "&" "")))) + (set-buffer (process-buffer proc)) + (goto-char (process-mark proc)) + (insert string) + (comint-send-input)))) (defun tex-delete-last-temp-files () "Delete any junk files from last temp file." -- 2.39.5