This patch supersedes
> From: Adrian Aichner <aichner(a)ecf.teradyne.com>
> Subject: [xemacs-packages PATCH] add-log.el to set newdirname correctly
> To: XEmacs Patches <xemacs-patches(a)xemacs.org>
> Date: 01 Aug 2000 01:58:33 +0200
> Message-ID: <ulmyhj1hy.fsf(a)ecf.teradyne.com>
I have followed Ben's advice to use `find-change-log' which makes the
code a lot more comprehensible.
I'll commit unless getting objections.
Best regards,
Adrian
cd d:\tmp\xemacs-packages\libs\xemacs-base\
cvs diff
Compilation started at Tue Aug 15 12:14:22 2000 +0200 (W. Europe Daylight Time)
? add-log.patch
cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-packages/libs/xemacs-base/ChangeLog,v
retrieving revision 1.48
diff -u -r1.48 ChangeLog
--- ChangeLog 2000/08/04 08:43:13 1.48
+++ ChangeLog 2000/08/15 10:22:54
@@ -1,3 +1,9 @@
+2000-08-15 Adrian Aichner <aichner(a)ecf.teradyne.com>
+
+ * add-log.el (patch-to-change-log): Re-word docstring. Fix hangup
+ on non-existent ChangeLog files, by using `find-change-log', as
+ suggested by Ben.
+
2000-05-22 Karl M. Hegbloom <karlheg(a)debian.org>
* compile.el (compilation-find-file): push newly visited file
Index: add-log.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-packages/libs/xemacs-base/add-log.el,v
retrieving revision 1.8
diff -u -r1.8 add-log.el
--- add-log.el 2000/07/08 10:16:18 1.8
+++ add-log.el 2000/08/15 10:22:58
@@ -712,7 +712,7 @@
;;;###autoload
(defun patch-to-change-log (devdir &rest cl-keys)
"Convert the unified diff in the current buffer into a ChangeLog.
-DEVDIR (queried interactively) specifies that directory that the diff was
+DEVDIR (queried interactively) specifies the directory the diff was
made relative to. The ChangeLog entries are added to the appropriate
ChangeLog files (generally in the same directory as the diffed file but
possibly in a parent directory), which are left as modified Emacs buffers
@@ -812,36 +812,11 @@
(setq previous-dirname dirname)
(setq dirname-relative-to-change-log "")
(setq change-log-buffer
- (find-file-noselect
- (let (found (newdirname dirname))
- ;; look for changelogs, going up the directory hierarchy
- (while (not found)
- (let ((maybe-found
- (expand-file-name
- "ChangeLog"
- (expand-file-name newdirname devdir))))
- (if (file-exists-p maybe-found)
- (setq found maybe-found)
- (setq dirname-relative-to-change-log
- ;;(file-relative-name
- ;; (expand-file-name BAR FOO)
- ;; (expand-file-name ""))
- ;;is a tricky but correct way of
- ;;constructing FOO/BAR in a
- ;;file-system-independent way.
- (file-relative-name
- (expand-file-name
- (file-name-nondirectory newdirname)
- dirname-relative-to-change-log)
- (expand-file-name "")))
- (setq newdirname
- (file-name-directory
- (directory-file-name newdirname)))
- (if (= 0
- (length (directory-file-name newdirname)))
- (setq found (expand-file-name
- "Changelog" devdir))))))
- found)))
+ (find-file-noselect
+ ;; APA: find a change-log relative to current directory.
+ (with-temp-buffer
+ (cd dirname)
+ (find-change-log))))
(setq insertion-marker (point-min-marker change-log-buffer))
(add-change-log-string
(format (concat "%s " cl-my-name " <" cl-my-email
cvs server: Diffing etc
Compilation exited abnormally with code 1 at Tue Aug 15 12:14:33
--
Adrian Aichner <adrian(a)xemacs.org>