unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Reiner Steib <Reiner.Steib@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: PCL-CVS: `A' removes cvs-mode from buffer *cvs*
Date: Fri, 07 Sep 2007 23:12:35 -0400	[thread overview]
Message-ID: <jwvejh9yhok.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <v9ps166tsg.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Wed\, 29 Aug 2007 21\:10\:39 +0200")

> [ (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)))))

      parent reply	other threads:[~2007-09-08  3:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 19:28 PCL-CVS: `A' removes cvs-mode from buffer *cvs* Reiner Steib
2007-08-21 15:32 ` Stefan Monnier
2007-08-25 12:13   ` Reiner Steib
2007-08-25 19:36     ` Stefan Monnier
2007-08-25 19:51       ` David Kastrup
2007-08-25 21:12       ` Reiner Steib
2007-08-29 19:10         ` Reiner Steib
2007-08-30 17:09           ` Reiner Steib
2007-09-08  2:55             ` Stefan Monnier
2007-09-23 20:09               ` Reiner Steib
2007-09-08  3:12           ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvejh9yhok.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=Reiner.Steib@gmx.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).