diff options
| author | Sam Steingold | 2001-05-29 15:47:01 +0000 |
|---|---|---|
| committer | Sam Steingold | 2001-05-29 15:47:01 +0000 |
| commit | b781e739bfe13f50f98e2616e5c6a9bb8f7da5f4 (patch) | |
| tree | 4244f30ea8d978dfdfe1ab256ec2b35a651ba0f3 | |
| parent | 4c329aa8be20b6cf7692e2e996fb281353c4fa02 (diff) | |
| download | emacs-b781e739bfe13f50f98e2616e5c6a9bb8f7da5f4.tar.gz emacs-b781e739bfe13f50f98e2616e5c6a9bb8f7da5f4.zip | |
fix live process/dead buffer bub on w32
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 35 |
2 files changed, 33 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 10373d61889..cad0cd77755 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2001-05-29 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * textmodes/tex-mode.el (tex-feed-input, tex-display-shell): | ||
| 4 | Use `tex-shell-buf'. | ||
| 5 | (tex-shell-proc): Use `tex-shell-running'. | ||
| 6 | (tex-shell-buf-no-error): New function. | ||
| 7 | (tex-send-tex-command): Use it. | ||
| 8 | (tex-shell-running): Kill tex-shell when the buffer is dead for w32. | ||
| 9 | (tex-kill-job): Check the process before calling `quit-process'. | ||
| 10 | |||
| 1 | 2001-05-29 Gerd Moellmann <gerd@gnu.org> | 11 | 2001-05-29 Gerd Moellmann <gerd@gnu.org> |
| 2 | 12 | ||
| 3 | * international/utf-8.el (ccl-decode-mule-utf-8): Handle | 13 | * international/utf-8.el (ccl-decode-mule-utf-8): Handle |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 4269111eaa9..3701a02b6a3 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1260,8 +1260,8 @@ Mark is left at original location." | |||
| 1260 | (forward-char 1) | 1260 | (forward-char 1) |
| 1261 | (forward-sexp 1)))))) | 1261 | (forward-sexp 1)))))) |
| 1262 | (message "%s words" count)))) | 1262 | (message "%s words" count)))) |
| 1263 | 1263 | ||
| 1264 | 1264 | ||
| 1265 | 1265 | ||
| 1266 | ;;; Invoking TeX in an inferior shell. | 1266 | ;;; Invoking TeX in an inferior shell. |
| 1267 | 1267 | ||
| @@ -1292,13 +1292,13 @@ Mark is left at original location." | |||
| 1292 | In the tex buffer this can be used to continue an interactive tex run. | 1292 | In the tex buffer this can be used to continue an interactive tex run. |
| 1293 | In the tex shell buffer this command behaves like `comint-send-input'." | 1293 | In the tex shell buffer this command behaves like `comint-send-input'." |
| 1294 | (interactive) | 1294 | (interactive) |
| 1295 | (set-buffer (process-buffer (get-process "tex-shell"))) | 1295 | (set-buffer (tex-shell-buf)) |
| 1296 | (comint-send-input) | 1296 | (comint-send-input) |
| 1297 | (tex-recenter-output-buffer nil)) | 1297 | (tex-recenter-output-buffer nil)) |
| 1298 | 1298 | ||
| 1299 | (defun tex-display-shell () | 1299 | (defun tex-display-shell () |
| 1300 | "Make the TeX shell buffer visible in a window." | 1300 | "Make the TeX shell buffer visible in a window." |
| 1301 | (display-buffer (process-buffer (get-process "tex-shell"))) | 1301 | (display-buffer (tex-shell-buf)) |
| 1302 | (tex-recenter-output-buffer nil)) | 1302 | (tex-recenter-output-buffer nil)) |
| 1303 | 1303 | ||
| 1304 | (defun tex-shell-sentinel (proc msg) | 1304 | (defun tex-shell-sentinel (proc msg) |
| @@ -1322,9 +1322,12 @@ In the tex shell buffer this command behaves like `comint-send-input'." | |||
| 1322 | (make-variable-buffer-local 'tex-send-command-modified-tick) | 1322 | (make-variable-buffer-local 'tex-send-command-modified-tick) |
| 1323 | 1323 | ||
| 1324 | (defun tex-shell-proc () | 1324 | (defun tex-shell-proc () |
| 1325 | (or (get-process "tex-shell") (error "No TeX subprocess"))) | 1325 | (or (tex-shell-running) (error "No TeX subprocess"))) |
| 1326 | (defun tex-shell-buf () | 1326 | (defun tex-shell-buf () |
| 1327 | (process-buffer (tex-shell-proc))) | 1327 | (process-buffer (tex-shell-proc))) |
| 1328 | (defun tex-shell-buf-no-error () | ||
| 1329 | (let ((proc (tex-shell-running))) | ||
| 1330 | (and proc (process-buffer proc)))) | ||
| 1328 | 1331 | ||
| 1329 | (defun tex-send-command (command &optional file background) | 1332 | (defun tex-send-command (command &optional file background) |
| 1330 | "Send COMMAND to TeX shell process, substituting optional FILE for *. | 1333 | "Send COMMAND to TeX shell process, substituting optional FILE for *. |
| @@ -1443,8 +1446,9 @@ ALL other buffers." | |||
| 1443 | (tex-send-tex-command compile-command dir))) | 1446 | (tex-send-tex-command compile-command dir))) |
| 1444 | 1447 | ||
| 1445 | (defun tex-send-tex-command (cmd &optional dir) | 1448 | (defun tex-send-tex-command (cmd &optional dir) |
| 1446 | (unless (or (equal dir (with-current-buffer (tex-shell-buf) | 1449 | (unless (or (equal dir (let ((buf (tex-shell-buf-no-error))) |
| 1447 | default-directory)) | 1450 | (and buf (with-current-buffer buf |
| 1451 | default-directory)))) | ||
| 1448 | (not dir)) | 1452 | (not dir)) |
| 1449 | (let (shell-dirtrack-verbose) | 1453 | (let (shell-dirtrack-verbose) |
| 1450 | (tex-send-command tex-shell-cd-command dir))) | 1454 | (tex-send-command tex-shell-cd-command dir))) |
| @@ -1685,18 +1689,25 @@ This function is more useful than \\[tex-buffer] when you need the | |||
| 1685 | 1689 | ||
| 1686 | (defun tex-shell-running () | 1690 | (defun tex-shell-running () |
| 1687 | (let ((proc (get-process "tex-shell"))) | 1691 | (let ((proc (get-process "tex-shell"))) |
| 1688 | (and proc | 1692 | (when proc |
| 1689 | (eq (process-status (get-process "tex-shell")) 'run) | 1693 | (if (and (eq (process-status proc) 'run) |
| 1690 | (buffer-live-p (process-buffer proc))))) | 1694 | (buffer-live-p (process-buffer proc))) |
| 1695 | ;; return the TeX process on success | ||
| 1696 | proc | ||
| 1697 | ;; get rid of the process permanently | ||
| 1698 | ;; this should get rid of the annoying w32 problem with | ||
| 1699 | ;; dead tex-shell buffer and live process | ||
| 1700 | (delete-process proc))))) | ||
| 1691 | 1701 | ||
| 1692 | (defun tex-kill-job () | 1702 | (defun tex-kill-job () |
| 1693 | "Kill the currently running TeX job." | 1703 | "Kill the currently running TeX job." |
| 1694 | (interactive) | 1704 | (interactive) |
| 1695 | ;; quit-process leads to core dumps of the tex process (except if | 1705 | ;; `quit-process' leads to core dumps of the tex process (except if |
| 1696 | ;; coredumpsize has limit 0kb as on many environments). One would | 1706 | ;; coredumpsize has limit 0kb as on many environments). One would |
| 1697 | ;; like to use (kill-process proc 'lambda), however that construct | 1707 | ;; like to use (kill-process proc 'lambda), however that construct |
| 1698 | ;; does not work on some systems and kills the shell itself. | 1708 | ;; does not work on some systems and kills the shell itself. |
| 1699 | (quit-process (get-process "tex-shell") t)) | 1709 | (let ((proc (get-process "tex-shell"))) |
| 1710 | (when proc (quit-process proc t)))) | ||
| 1700 | 1711 | ||
| 1701 | (defun tex-recenter-output-buffer (linenum) | 1712 | (defun tex-recenter-output-buffer (linenum) |
| 1702 | "Redisplay buffer of TeX job output so that most recent output can be seen. | 1713 | "Redisplay buffer of TeX job output so that most recent output can be seen. |