changeset 82001:b450385acac9

(cvs-mode-add-change-log-entry-other-window): Use a directory name for buffer-file-name if it refers to a directory.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 20 Jul 2007 20:08:21 +0000
parents 066eaef90bfb
children 43f5e1e99ca4
files lisp/ChangeLog lisp/pcvs.el
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jul 20 20:02:32 2007 +0000
+++ b/lisp/ChangeLog	Fri Jul 20 20:08:21 2007 +0000
@@ -1,5 +1,8 @@
 2007-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* pcvs.el (cvs-mode-add-change-log-entry-other-window): Use a directory
+	name for buffer-file-name if it refers to a directory.
+
 	* vc-arch.el (vc-arch-diff): Fix last change.
 
 	* progmodes/compile.el (compilation-start): Remember the original
--- a/lisp/pcvs.el	Fri Jul 20 20:02:32 2007 +0000
+++ b/lisp/pcvs.el	Fri Jul 20 20:08:21 2007 +0000
@@ -2207,6 +2207,10 @@
   (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)))
       (kill-local-variable 'change-log-default-name)
       (save-excursion (add-change-log-entry-other-window)))))