diff --git a/coq/coq-system.el b/coq/coq-system.el index db8cbc6e6..9e8a45784 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) + (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.