emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r116999: Provide function for asking vc about pr


From: Daniel Colascione
Subject: Re: [Emacs-diffs] trunk r116999: Provide function for asking vc about project root
Date: Mon, 21 Apr 2014 14:55:32 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/21/2014 02:51 PM, Stefan Monnier wrote:
>>>> +        (condition-case err
>>>> +            (vc-call-backend backend 'root default-directory)
>>>> +          (vc-not-supported
>>>> +           (unless (eq (cadr err) 'root)
>>>> +             (signal (car err) (cdr err)))
>>>> +           nil)))))
>>> Why do we need this gymnastics?
>> So that we don't accidentally suppress errors we *don't* expect to get.
> 
> No: I see the hypothetical reason, but I was wondering about
> a practical reason.  IOW, I think this is overkill.  Note that the cost
> is not only in code complexity but catching&re-raising signals also
> defeats the backtraces in debug-on-error, which can be a pain.

We're not catching all errors --- just vc-not-supported --- and it
amounts to an assertion that nothing else went horribly wrong, because
we re-raise only in cases where we'd otherwise swallow the error, and an
error with a truncated stack is at least better than nothing at all.

> I even wonder if we should allow `root' to fail.  E.g. RCS/CVS could
> just walk up the directories until there's no RCS/CVS subdir.

Works for me. Backends could also just have their root functions
explicitly return nil if they can't figure it out.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]