Skip to content

Commit

Permalink
Merge pull request #708 from gasche/bad-bounding-indices
Browse files Browse the repository at this point in the history
Fix "Bad bounding indices" error on invalid _CoqProject
  • Loading branch information
monnier authored Nov 28, 2023
2 parents db2280f + d2d2e8a commit 879444c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions coq/coq-system.el
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,14 @@ alreadyopen is t if buffer already existed."
(defun coq--read-one-option-from-project-file (switch arity raw-args)
"Cons SWITCH with ARITY arguments from RAW-ARGS.
If ARITY is nil, return SWITCH."
(if arity
(let ((arguments
(condition-case-unless-debug nil
(cl-subseq raw-args 0 arity)
(warn "Invalid _CoqProject: not enough arguments for %S" switch))))
(cons switch arguments))
switch))
(cond
((not arity) switch)
((< (length raw-args) arity)
(message "Invalid _CoqProject: not enough arguments for %S" switch)
switch)
(t
(let ((arguments (cl-subseq raw-args 0 arity)))
(cons switch arguments)))))

(defun coq--read-options-from-project-file (contents)
"Read options from CONTENTS of _CoqProject.
Expand Down

0 comments on commit 879444c

Please sign in to comment.