From 11c1a5f3bdffb28a7872f80a3c069856ea2a121f Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Tue, 3 Oct 2023 11:03:29 +0200 Subject: [PATCH 1/2] Fix a "Bad bounding indices" error on my system Fixes #707 --- coq/coq-system.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/coq/coq-system.el b/coq/coq-system.el index db8cbc6e6..2db3b96d1 100644 --- a/coq/coq-system.el +++ b/coq/coq-system.el @@ -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) + (warn "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. From d2d2e8a8efee65dda2113937918ee15136bced1b Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Tue, 3 Oct 2023 11:05:03 +0200 Subject: [PATCH 2/2] make CoqProject parsing failure noticeable (maybe an 'error' would be even better?) --- coq/coq-system.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coq/coq-system.el b/coq/coq-system.el index 2db3b96d1..9e8a45784 100644 --- a/coq/coq-system.el +++ b/coq/coq-system.el @@ -553,7 +553,7 @@ If ARITY is nil, return SWITCH." (cond ((not arity) switch) ((< (length raw-args) arity) - (warn "Invalid _CoqProject: not enough arguments for %S" switch) + (message "Invalid _CoqProject: not enough arguments for %S" switch) switch) (t (let ((arguments (cl-subseq raw-args 0 arity)))