changeset 82002:43f5e1e99ca4

(add-log-file-name): Use file-relative-name.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 20 Jul 2007 20:09:44 +0000
parents b450385acac9
children 571d99dbf19d
files lisp/ChangeLog lisp/add-log.el
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jul 20 20:08:21 2007 +0000
+++ b/lisp/ChangeLog	Fri Jul 20 20:09:44 2007 +0000
@@ -1,5 +1,7 @@
 2007-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* add-log.el (add-log-file-name): Use file-relative-name.
+
 	* pcvs.el (cvs-mode-add-change-log-entry-other-window): Use a directory
 	name for buffer-file-name if it refers to a directory.
 
--- a/lisp/add-log.el	Fri Jul 20 20:08:21 2007 +0000
+++ b/lisp/add-log.el	Fri Jul 20 20:09:44 2007 +0000
@@ -460,11 +460,7 @@
     (if add-log-file-name-function
 	(funcall add-log-file-name-function buffer-file)
       (setq buffer-file
-	    (if (string-match
-		 (concat "^" (regexp-quote (file-name-directory log-file)))
-		 buffer-file)
-		(substring buffer-file (match-end 0))
-	      (file-name-nondirectory buffer-file)))
+            (file-relative-name buffer-file (file-name-directory log-file)))
       ;; If we have a backup file, it's presumably because we're
       ;; comparing old and new versions (e.g. for deleted
       ;; functions) and we'll want to use the original name.