Subject: Re: bug#3418: Issue with compile.el and compilation-parse-errors-filename-function

From: [email-masked]
Date: Sat, 12 Aug 2017 11:42:05 -0400

Eli Zaretskii <[email-masked]> writes:

>> We could do something like
>> 
>>     (condition-case err
>>         (funcall compilation-parse-errors-filename-function filename spec-dir)
>>       (wrong-number-of-arguments
>>        ;; Try again with single arg for backwards compatibility.
>>        (funcall compilation-parse-errors-filename-function filename)))
>
> Or use func-arity?

I think func-arity could fail in case the function is advised or created
with `apply-partially'.  On the other hand the condition-case trick can
cause problems if there is an unrelated wrong arguments error inside the
function (perhaps this can be migitated by checking the error
information).  Doesn't really matter too much either way I guess, it's
all minor corner cases.