From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: vc-state and unregistered Date: Sun, 24 Apr 2016 20:35:47 +0300 Message-ID: <80b86343-9324-1de0-e66c-a02e80467740@yandex.ru> References: <6ok2vyzwf9.fsf@fencepost.gnu.org> <08f70cda-44be-0657-e50a-2b2c80d2c21c@yandex.ru> <87oa9dzgl0.fsf@gmx.de> <87potshczh.fsf@gmx.de> <87bn57otja.fsf_-_@gmx.de> <515b3451-820d-ad50-8c98-d0330a0f4266@yandex.ru> <87lh4arpbg.fsf@gmx.de> <87ega2rodp.fsf@gmx.de> <87vb37ury1.fsf@gmx.de> <87potfuqdt.fsf@gmx.de> <557a2987-39e8-051e-55fd-678bc01a6a40@yandex.ru> <87lh43upd9.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1461519378 7206 80.91.229.3 (24 Apr 2016 17:36:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2016 17:36:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 24 19:36:12 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1auNx5-0005DR-Io for ged-emacs-devel@m.gmane.org; Sun, 24 Apr 2016 19:36:11 +0200 Original-Received: from localhost ([::1]:56079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auNx4-0000rc-MZ for ged-emacs-devel@m.gmane.org; Sun, 24 Apr 2016 13:36:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auNwo-0000oz-H9 for emacs-devel@gnu.org; Sun, 24 Apr 2016 13:35:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auNwl-0001mP-Bp for emacs-devel@gnu.org; Sun, 24 Apr 2016 13:35:54 -0400 Original-Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auNwl-0001mJ-4g for emacs-devel@gnu.org; Sun, 24 Apr 2016 13:35:51 -0400 Original-Received: by mail-wm0-x241.google.com with SMTP id n3so18970277wmn.1 for ; Sun, 24 Apr 2016 10:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=dFIA1gDrQfzF9WvhVjy9JTKTrHT3yZ7NH2Yr/LdTY2g=; b=vchh7WNC58utdUmSHlAtdCwUS2CTJjA2vztgitiuq7R9R+D3M6vfDeZuXgjCnz15ZR W7yCjQ88rd3GW+OQHeFukQ+rvrl3vzJ8ql7i+umnu2j4epzL8yL7F9H7wzZLshulhLq4 kb1CygIgVHDtozMK5uRZ04pGs3c9wHGYzcS+j+wYfk1X4VnEoQF9RB9qZ19kYpyz2s5Z bjfJzSMN9DRFt3OnZjOzONQU+gxSSo8tqmu+3is4Rx9lUBxzLRAT0Mul4ogJOtUKgBJr XanwsquzpwX37BCrmcQKyro8g2l4s8Ehud+4rzxf0eBLf8spXNMnqbvGpb5lqZdkyEDK 16LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=dFIA1gDrQfzF9WvhVjy9JTKTrHT3yZ7NH2Yr/LdTY2g=; b=TMnT9HdESwRoMXCPHJAoEjkRSmgPerdtztNPzIN7j55/wMspQ/TXGPlgl4aid+Omf8 nakQCX/susrS39MGBNbqp8J7oEmS4xK+TaVa5kOpg9CZry0oyjbiix1Y1V8RhCeLHVpd rMXiipBzy0EPseBExymiTRQqBkPlny4ui0VE/ZaHgnRzHmQ+wpmNi00mip2N7WC+Zb/C n35DX4Mva6yYvLCXhcYmp/pLejtxAsfiZ8fnXop9XCeDtAnwPTJJ5e0BUkmZMwFBPAPu 52qYw3XeFKvknYzb8FOYteaXuwHLEEPjZPUgiyxzCSM9BgVzQWHKAiRdvlLRKEaOajTC qCCQ== X-Gm-Message-State: AOPr4FWsxrFqwS2JM+onfjkBMkVut078YVJ3LX4yTjMy0dzoY4h8dz6XfHBclIf4ujqKGg== X-Received: by 10.194.204.100 with SMTP id kx4mr30424169wjc.145.1461519350451; Sun, 24 Apr 2016 10:35:50 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id w82sm12223204wmw.5.2016.04.24.10.35.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Apr 2016 10:35:49 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <87lh43upd9.fsf@gmx.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203269 Archived-At: On 04/24/2016 04:07 PM, Michael Albinus wrote: > Pls show me the bugs, I might have introduced. As far as bugs go, here's one: you never return nil from vc-state anymore. Try evaluating: (progn (vc-file-clearprops buffer-file-name) (vc-state buffer-file-name 'CVS)) And if the goal is to always return non-nil (which would be a change to the documented behavior), there is an easier way to do that than checking (vc-registered file), like: diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 0535565..5c31d20 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -475,11 +475,11 @@ vc-state ;; FIXME: New (sub)states needed (?): ;; - `copied' and `moved' (might be handled by `removed' and `added') (or (vc-file-getprop file 'vc-state) - (and (not (vc-registered file)) 'unregistered) (when (> (length file) 0) ;Why?? --Stef - (setq backend (or backend (vc-responsible-backend file))) + (setq backend (or backend (vc-backend file))) (when backend - (vc-state-refresh file backend))))) + (vc-state-refresh file backend))) + 'unregistered)) (defun vc-state-refresh (file backend) "Quickly recompute the `state' of FILE."