emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: find-file sometimes doesn't


From: Stefan Monnier
Subject: Re: find-file sometimes doesn't
Date: Tue, 13 Dec 2005 11:07:23 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> 2005-12-12  Bill Wohler  <address@hidden>

>       * vc-svn.el (vc-svn-registered): Fix problem of visiting
>       non-writable Subversion-controlled files by saving window
>       configuration before calling vc-do-command. vc-do-command calls
>       pop-to-buffer on error which is unexpected during registration.

> Index: vc-svn.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/vc-svn.el,v
> retrieving revision 1.22
> diff -u -r1.22 vc-svn.el
> --- vc-svn.el 14 Nov 2005 04:33:03 -0000      1.22
> +++ vc-svn.el 13 Dec 2005 00:42:59 -0000
> @@ -114,13 +114,18 @@
>                                          (file-name-directory file)))
>      (with-temp-buffer
>        (cd (file-name-directory file))
> -      (condition-case nil
> -       (vc-svn-command t 0 file "status" "-v")
> -     ;; Some problem happened.  E.g. We can't find an `svn' executable.
> -        ;; We used to only catch `file-error' but when the process is run on
> -        ;; a remote host via Tramp, the error is only reported via the
> -        ;; exit status which is turned into an `error' by vc-do-command.
> -     (error nil))
> +        (condition-case nil
> +            ;; Save configuration since vc-do-command calls pop-to-buffer on
> +            ;; error (such as visiting a Subversion-controlled file that you
> +            ;; don't have permission to edit). This causes later problems
> +            ;; during registration.
> +            (save-window-excursion
> +              (vc-svn-command t 0 file "status" "-v"))
> +          ;; Some problem happened.  E.g. We can't find an `svn' executable.
> +          ;; We used to only catch `file-error' but when the process is run 
> on
> +          ;; a remote host via Tramp, the error is only reported via the
> +          ;; exit status which is turned into an `error' by vc-do-command.
> +          (error nil))
>        (vc-svn-parse-status t)
>        (eq 'SVN (vc-file-getprop file 'vc-backend)))))
 
Interesting.
But the above solution still has the following problem: pop-to-buffer may
create a new frame, in which case the save-window-excursion won't be enough.
Basically, we need to tell vc-do-command not to call pop-to-buffer.

I'll install a patch for it, thanks.


        Stefan




reply via email to

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