From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: PCL-CVS: `A' removes cvs-mode from buffer *cvs* Date: Fri, 07 Sep 2007 23:12:35 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189221169 7616 80.91.229.12 (8 Sep 2007 03:12:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2007 03:12:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Reiner Steib Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 08 05:12:50 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITqka-0000mI-8s for ged-emacs-devel@m.gmane.org; Sat, 08 Sep 2007 05:12:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITqkY-0004yh-2I for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2007 23:12:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITqkU-0004yP-PQ for emacs-devel@gnu.org; Fri, 07 Sep 2007 23:12:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITqkQ-0004xz-Ai for emacs-devel@gnu.org; Fri, 07 Sep 2007 23:12:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITqkQ-0004xw-88 for emacs-devel@gnu.org; Fri, 07 Sep 2007 23:12:38 -0400 Original-Received: from tomts10.bellnexxia.net ([209.226.175.54] helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ITqkQ-0001D5-05 for emacs-devel@gnu.org; Fri, 07 Sep 2007 23:12:38 -0400 Original-Received: from ceviche.home ([70.55.141.227]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070908031237.NCAM9197.tomts10-srv.bellnexxia.net@ceviche.home> for ; Fri, 7 Sep 2007 23:12:37 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 278E2B4609; Fri, 7 Sep 2007 23:12:35 -0400 (EDT) In-Reply-To: (Reiner Steib's message of "Wed\, 29 Aug 2007 21\:10\:39 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) 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:78213 Archived-At: > [ (add-hook 'cvs-mode-hook > (lambda () > (add-hook 'change-major-mode-hook 'debug nil t))) ] >> I added it to my init files. > ... and today it triggered (on Windows; Emacs 22.1). Here's the > backtrace (byte code stripped, lines wrapped): I've installed the patch below in the 22 branch. Thanks again, Stefan Index: lisp/pcvs.el =================================================================== RCS file: /sources/emacs/emacs/lisp/pcvs.el,v retrieving revision 1.98.2.9 diff -u -r1.98.2.9 pcvs.el --- lisp/pcvs.el 25 Aug 2007 12:18:42 -0000 1.98.2.9 +++ lisp/pcvs.el 8 Sep 2007 03:09:31 -0000 @@ -2210,13 +2210,21 @@ (defun-cvs-mode cvs-mode-add-change-log-entry-other-window () "Add a ChangeLog entry in the ChangeLog of the current directory." (interactive) + ;; Require `add-log' explicitly, because if it gets autoloaded when we call + ;; add-change-log-entry-other-window below, the + ;; add-log-buffer-file-name-function ends up unbound when we leave the `let'. + (require 'add-log) (dolist (fi (cvs-mode-marked nil nil)) (let* ((default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi))) - (buffer-file-name (expand-file-name (cvs-fileinfo->file fi)))) - (if (file-directory-p buffer-file-name) - ;; Be careful to use a directory name, otherwise add-log starts - ;; looking for a ChangeLog file in the parent dir. - (setq buffer-file-name (file-name-as-directory buffer-file-name))) + (add-log-buffer-file-name-function + (lambda () + (let ((file (expand-file-name (cvs-fileinfo->file fi)))) + (if (file-directory-p file) + ;; Be careful to use a directory name, otherwise add-log + ;; starts looking for a ChangeLog file in the + ;; parent dir. + (file-name-as-directory file) + file))))) (kill-local-variable 'change-log-default-name) (save-excursion (add-change-log-entry-other-window)))))