[Top][All Lists]

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

Re: vc-state and unregistered

From: Dmitry Gutov
Subject: Re: vc-state and unregistered
Date: Tue, 19 Apr 2016 11:43:04 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 04/19/2016 11:31 AM, Michael Albinus wrote:

The very first line in `vc-state' doesn't make sense for unregistered

  (or (vc-file-getprop file 'vc-state)

Even if we know that a file is unregistered, and we have set the file
property to nil accordingly, This information isn't used. For
unregistered files, the cached value isn't used, and the file's state is
computed again.

That's not really true, try stepping through the function with Edebug, and see for yourself. It does go farther than the first line, but it doesn't call `vc-git-state' or `vc-git-registered' every time.

IOW: if vc-file-getprop returns nil, we don't know what this
means. Either "don't know", because the state hasn't been computed
yet. Or it means "unregistered".

That could be fixed with using `none' instead, like `vc-backend' does. Which I've mentioned already.

But I'm not convinced we even need to make that effort.

reply via email to

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