comparison lisp/textmodes/tex-mode.el @ 56792:db21eaa33109

(tex-validate-buffer): Distinguish between 0, 1, and many mismatches. (tex-start-shell): Use `set-process-query-on-exit-flag'.
author John Paul Wallington <jpw@pobox.com>
date Wed, 25 Aug 2004 19:04:13 +0000
parents 624ac8a21b21
children 4520af567a84 d8411455de48
comparison
equal deleted inserted replaced
56791:a0d8e0ecba72 56792:db21eaa33109
1139 help-echo "mouse-2: go to this invalidity")) 1139 help-echo "mouse-2: go to this invalidity"))
1140 (put-text-property text-beg (- text-end 1) 1140 (put-text-property text-beg (- text-end 1)
1141 'occur-target tem))))) 1141 'occur-target tem)))))
1142 (goto-char prev-end)))) 1142 (goto-char prev-end))))
1143 (with-current-buffer standard-output 1143 (with-current-buffer standard-output
1144 (if (eq num-matches 0) 1144 (let ((no-matches (zerop num-matches)))
1145 (insert "None!\n")) 1145 (if no-matches
1146 (if (interactive-p) 1146 (insert "None!\n"))
1147 (message "%d mismatches found" num-matches)))))) 1147 (if (interactive-p)
1148 (message "%s mismatch%s found"
1149 (if no-matches "No" num-matches)
1150 (if (> num-matches 1) "es" ""))))))))
1148 1151
1149 (defun tex-validate-region (start end) 1152 (defun tex-validate-region (start end)
1150 "Check for mismatched braces or $'s in region. 1153 "Check for mismatched braces or $'s in region.
1151 Returns t if no mismatches. Returns nil and moves point to suspect 1154 Returns t if no mismatches. Returns nil and moves point to suspect
1152 area if a mismatch is found." 1155 area if a mismatch is found."
1457 "tex-shell" 1460 "tex-shell"
1458 (or tex-shell-file-name (getenv "ESHELL") shell-file-name) 1461 (or tex-shell-file-name (getenv "ESHELL") shell-file-name)
1459 nil) 1462 nil)
1460 (let ((proc (get-process "tex-shell"))) 1463 (let ((proc (get-process "tex-shell")))
1461 (set-process-sentinel proc 'tex-shell-sentinel) 1464 (set-process-sentinel proc 'tex-shell-sentinel)
1462 (process-kill-without-query proc) 1465 (set-process-query-on-exit-flag proc nil)
1463 (tex-shell) 1466 (tex-shell)
1464 (while (zerop (buffer-size)) 1467 (while (zerop (buffer-size))
1465 (sleep-for 1))))) 1468 (sleep-for 1)))))
1466 1469
1467 (defun tex-feed-input () 1470 (defun tex-feed-input ()
1926 (setq begin-of-error (match-beginning 0) 1929 (setq begin-of-error (match-beginning 0)
1927 end-of-error (match-end 0))) 1930 end-of-error (match-end 0)))
1928 (re-search-forward 1931 (re-search-forward
1929 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) 1932 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move))
1930 (let* ((this-error (copy-marker begin-of-error)) 1933 (let* ((this-error (copy-marker begin-of-error))
1931 (linenum (string-to-int (match-string 1))) 1934 (linenum (string-to-number (match-string 1)))
1932 (error-text (regexp-quote (match-string 3))) 1935 (error-text (regexp-quote (match-string 3)))
1933 (filename 1936 (filename
1934 (save-excursion 1937 (save-excursion
1935 (with-syntax-table tex-error-parse-syntax-table 1938 (with-syntax-table tex-error-parse-syntax-table
1936 (backward-up-list 1) 1939 (backward-up-list 1)