From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: vc-annotate error Date: Fri, 07 Apr 2006 18:36:55 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1144460239 7676 80.91.229.2 (8 Apr 2006 01:37:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2006 01:37:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 08 03:37:18 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FS2O5-0003SE-HH for ged-emacs-devel@m.gmane.org; Sat, 08 Apr 2006 03:37:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FS2O5-0006yw-3w for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2006 21:37:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FS2Ns-0006y5-CT for emacs-devel@gnu.org; Fri, 07 Apr 2006 21:37:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FS2Nr-0006xR-Kk for emacs-devel@gnu.org; Fri, 07 Apr 2006 21:37:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FS2Nr-0006xL-A5 for emacs-devel@gnu.org; Fri, 07 Apr 2006 21:37:03 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FS2Rw-0000CE-CD for emacs-devel@gnu.org; Fri, 07 Apr 2006 21:41:16 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FS2Nn-0003R5-70 for emacs-devel@gnu.org; Sat, 08 Apr 2006 03:36:59 +0200 Original-Received: from turtle.as.arizona.edu ([128.196.208.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Apr 2006 03:36:59 +0200 Original-Received: from jdsmith by turtle.as.arizona.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Apr 2006 03:36:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 52 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: turtle.as.arizona.edu User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52527 Archived-At: On Fri, 07 Apr 2006 18:40:35 -0600, Kevin Rodgers wrote: > JD Smith wrote: >> vc-annotate is giving me a similar error as was reported earlier for >> vc.el revision 1.408: >> >> (file-error "Cannot open load file" "vc-nil") >> >> This occurs because I have specified a default annotate mode of >> 'fullscale, and the `vc-annotate-display-autoscale' function still >> relies on the variable `vc-annotate-backend' to call the appropriate >> backend time functions I wrote years ago. This was formerly a global >> variable, but Stefan's changes to `vc-annotate' circa 1.408 made it >> buffer local: >> >> (with-current-buffer temp-buffer-name >> (set (make-local-variable 'vc-annotate-backend) (vc-backend file)) >> (set (make-local-variable 'vc-annotate-parent-file) file) (set >> (make-local-variable 'vc-annotate-parent-rev) rev) (set >> (make-local-variable 'vc-annotate-parent-display-mode) >> display-mode)) > > That snippet immediately follows this: > > (with-output-to-temp-buffer temp-buffer-name > (vc-call annotate-command file (get-buffer temp-buffer-name) rev)) > > So could the problem be that those variables are set _after_ the annotate > buffer contents have been inserted and displayed (via > temp-buffer-show-function -> vc-annotate-display-select)? Shouldn't they > be set before? > >> For whatever reason, these are not currently being set in the annotate >> output buffer, which breaks the auto-scaling annotation display, since >> it doesn't know the backend to use. I haven't figured out how the >> buffer-local variables are being lost. Other annotate display modes >> don't have backend-specific functions, so they continue to work. > > Are you sure they're not being set at all, vs. being set too late? I think that's probably correct, but after reversing the order I could find no combination of buffer calls which would get the same buffer behavior as currently, and also leave those local variables set. I believe the 'with-output-to-temp-buffer' body won't have access to those values, since it doesn't actually set the current buffer to its output buffer. Given all the buffer switching that VC seems to do, it may be somewhat unsafe to have these be buffer local. Thanks, JD