From: Paul Pogonyshev <pogonyshev@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Dmitry Gutov <dmitry@gutov.dev>,
65763@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#65763: Error opening a file from a Git working directory if Git is not installed
Date: Sun, 10 Sep 2023 19:36:47 +0200 [thread overview]
Message-ID: <CAG7Bpap+XcXwkLoxk1b2tjvGwQkpj+Gxn6trPfSMipkBQRVPMQ@mail.gmail.com> (raw)
In-Reply-To: <837coyrvtb.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]
- ((setq backend (with-demoted-errors "VC refresh error: %S"
- (vc-backend buffer-file-name)))
+ ((setq backend (let (debug-on-error)
+ (with-demoted-errors "VC refresh error: %S"
+ (vc-backend buffer-file-name))))
From my experience, you should always comment such things. Or add an
automated test ensuring it. Or even better, do both. It is extremely
non-obvious why this is needed at all and someone can easily undo your
changes a few years later.
Paul
On Sun, 10 Sept 2023 at 15:40, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 10 Sep 2023 16:21:00 +0300
> > Cc: pogonyshev@gmail.com, 65763@debbugs.gnu.org
> > From: Dmitry Gutov <dmitry@gutov.dev>
> >
> > On 10/09/2023 09:26, Eli Zaretskii wrote:
> > > diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
> > > index a4de0a6..0715236 100644
> > > --- a/lisp/vc/vc-hooks.el
> > > +++ b/lisp/vc/vc-hooks.el
> > > @@ -799,7 +799,7 @@ vc-refresh-state
> > > (add-hook 'vc-mode-line-hook #'vc-mode-line nil t)
> > > (let (backend)
> > > (cond
> > > - ((setq backend (with-demoted-errors "VC refresh error: %S"
> > > + ((setq backend (ignore-errors
> > > (vc-backend buffer-file-name)))
> > > ;; Let the backend setup any buffer-local things he needs.
> > > (vc-call-backend backend 'find-file-hook)
> >
> > This seems to work better:
>
> That'd be fine by me, but I'd still want to understand why
> ignore-errors didn't work.
>
> Thanks.
>
[-- Attachment #2: Type: text/html, Size: 2521 bytes --]
next prev parent reply other threads:[~2023-09-10 17:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 18:54 bug#65763: Error opening a file from a Git working directory if Git is not installed Paul Pogonyshev
2023-09-05 19:44 ` Eli Zaretskii
2023-09-05 20:06 ` Paul Pogonyshev
2023-09-05 20:14 ` Paul Pogonyshev
2023-09-06 2:25 ` Eli Zaretskii
2023-09-06 7:29 ` Paul Pogonyshev
2023-09-06 12:13 ` Eli Zaretskii
2023-09-06 12:35 ` Dmitry Gutov
2023-09-06 12:49 ` Paul Pogonyshev
2023-09-06 12:52 ` Dmitry Gutov
2023-09-06 13:11 ` Paul Pogonyshev
2023-09-06 14:31 ` Dmitry Gutov
2023-09-06 15:46 ` Eli Zaretskii
2023-09-06 15:59 ` Dmitry Gutov
2023-09-10 6:26 ` Eli Zaretskii
2023-09-10 13:21 ` Dmitry Gutov
2023-09-10 13:40 ` Eli Zaretskii
2023-09-10 17:36 ` Paul Pogonyshev [this message]
2023-09-10 17:52 ` Eli Zaretskii
2023-09-06 13:06 ` Eli Zaretskii
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=CAG7Bpap+XcXwkLoxk1b2tjvGwQkpj+Gxn6trPfSMipkBQRVPMQ@mail.gmail.com \
--to=pogonyshev@gmail.com \
--cc=65763@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=eliz@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).