# HG changeset patch # User Stefan Monnier # Date 1184962184 0 # Node ID 43f5e1e99ca4d451bdc19897b85881beb249706d # Parent b450385acac9b88e14b4e5022a254635b1fc91f4 (add-log-file-name): Use file-relative-name. diff -r b450385acac9 -r 43f5e1e99ca4 lisp/ChangeLog --- 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 + * 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. diff -r b450385acac9 -r 43f5e1e99ca4 lisp/add-log.el --- 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.