unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r116999: Provide function for asking vc about project root
Date: Mon, 21 Apr 2014 14:55:32 -0700	[thread overview]
Message-ID: <535593D4.2000107@dancol.org> (raw)
In-Reply-To: <jwvtx9mnymv.fsf-monnier+emacsdiffs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  reply	other threads:[~2014-04-21 21:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Wc15p-0001h2-Rk@vcs.savannah.gnu.org>
2014-04-21 14:43 ` [Emacs-diffs] trunk r116999: Provide function for asking vc about project root Stefan Monnier
2014-04-21 17:26   ` Daniel Colascione
2014-04-21 21:51     ` Stefan Monnier
2014-04-21 21:55       ` Daniel Colascione [this message]
2014-04-22  1:44         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535593D4.2000107@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).