From abfcd41041f5ba00d9d8f007808d67a312fbe8c4 Mon Sep 17 00:00:00 2001 From: Hendrik Tews Date: Fri, 20 Nov 2020 23:38:22 +0100 Subject: protect coq-callcoq against escaping signals This hopefully fixes compilation without coqtop and especially the github tests. --- coq/coq-system.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'coq') diff --git a/coq/coq-system.el b/coq/coq-system.el index 2cc29e00..5b530e45 100644 --- a/coq/coq-system.el +++ b/coq/coq-system.el @@ -110,16 +110,20 @@ If it doesn't look right, try `coq-autodetect-version'." "Call coqtop with the given OPTION and return the output. The given option should make coqtop return immediately. Optionally check the return code and return nil if the check -fails. +fails. Return also nil on other kinds of errors (e.g., `coq-prog-name' +not found). This function supports calling coqtop via tramp." (let ((coq-command (or coq-prog-name "coqtop")) retv) - (with-temp-buffer - (setq retv (if option - (process-file coq-command nil t nil option) - (process-file coq-command nil t nil))) - (if (or (not expectedretv) (equal retv expectedretv)) - (buffer-string))))) + (condition-case nil + (with-temp-buffer + (setq retv (if option + (process-file coq-command nil t nil option) + (process-file coq-command nil t nil))) + (if (or (not expectedretv) (equal retv expectedretv)) + (buffer-string))) + (error nil)))) + (defun coq-autodetect-version (&optional interactive-p) "Detect and record the version of Coq currently in use. -- cgit v1.2.3