aboutsummaryrefslogtreecommitdiff
path: root/coq
diff options
context:
space:
mode:
Diffstat (limited to 'coq')
-rw-r--r--coq/coq-syntax.el1
-rw-r--r--coq/coq-system.el29
2 files changed, 14 insertions, 16 deletions
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el
index 4cb6de55..0e143637 100644
--- a/coq/coq-syntax.el
+++ b/coq/coq-syntax.el
@@ -428,6 +428,7 @@ so for the following reasons:
("Global Variables" "gvs" "Global Variables # , #: #." t "Global\\s-+Variables")
("Hint Constructors" "hc" "Hint Constructors # : #." t "Hint\\s-+Constructors")
("Hint Extern" "he" "Hint Extern @{cost} @{pat} => @{tac} : @{db}." t "Hint\\s-+Extern")
+ ("Hint Mode" "hm" "Hint Mode # @{mode...} : @{db}." t "Hint\\s-+Mode")
("Hint Immediate" "hi" "Hint Immediate # : @{db}." t "Hint\\s-+Immediate")
("Hint Resolve" "hr" "Hint Resolve # : @{db}." t "Hint\\s-+Resolve")
("Hint Rewrite ->" "hrw" "Hint Rewrite -> @{t1,t2...} using @{tac} : @{db}." t "Hint\\s-+Rewrite")
diff --git a/coq/coq-system.el b/coq/coq-system.el
index 637e0a27..5b530e45 100644
--- a/coq/coq-system.el
+++ b/coq/coq-system.el
@@ -110,23 +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* ((default-directory
- (if (file-accessible-directory-p default-directory)
- default-directory
- "/"))
- (coq-command (shell-quote-argument (or coq-prog-name "coqtop"))))
- (with-temp-buffer
- ;; Use `shell-command' via `find-file-name-handler' instead of
- ;; `process-line': when the buffer is running TRAMP, PG uses
- ;; `start-file-process', loading the binary from the remote server.
- (let* ((shell-command-str (format "%s %s" coq-command (or option "")))
- (fh (find-file-name-handler default-directory 'shell-command))
- (retv (if fh (funcall fh 'shell-command shell-command-str (current-buffer))
- (shell-command shell-command-str (current-buffer)))))
- (if (or (not expectedretv) (equal retv expectedretv))
- (buffer-string))))))
+ (let ((coq-command (or coq-prog-name "coqtop"))
+ retv)
+ (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.