GNU bug report logs - #65763
Error opening a file from a Git working directory if Git is not installed

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Tue, 5 Sep 2023 18:56:01 UTC

Severity: normal

Full log


Message #53 received at 65763 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 65763 <at> debbugs.gnu.org, pogonyshev <at> gmail.com
Subject: Re: bug#65763: Error opening a file from a Git working directory if
 Git is not installed
Date: Sun, 10 Sep 2023 16:21:00 +0300
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:

diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index a4de0a6e791..53271d9d3c2 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -799,8 +799,9 @@ 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"
-                        (vc-backend buffer-file-name)))
+       ((setq backend (let (debug-on-error)
+                        (with-demoted-errors "VC refresh error: %S"
+                          (vc-backend buffer-file-name))))
         ;; Let the backend setup any buffer-local things he needs.
         (vc-call-backend backend 'find-file-hook)
 	;; Compute the state and put it in the mode line.





This bug report was last modified 1 year and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.