Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Bad bounding indices" error on invalid _CoqProject #708

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions coq/coq-system.el
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,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