diff options
| author | Richard M. Stallman | 1993-01-08 21:13:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-01-08 21:13:23 +0000 |
| commit | 6d7ee041a28c9d3362dcac8b97eff329e25351d3 (patch) | |
| tree | ece6d9013c42a56c231887b1b1502282e6a88ab4 | |
| parent | c193197b500603f5cec36ea670e0316392dcd472 (diff) | |
| download | emacs-6d7ee041a28c9d3362dcac8b97eff329e25351d3.tar.gz emacs-6d7ee041a28c9d3362dcac8b97eff329e25351d3.zip | |
(add-change-log-entry): Search for existing ChangeLog
in parent dir and its parents.
| -rw-r--r-- | lisp/add-log.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el index 8c187bf4b77..edd0db80659 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -70,6 +70,22 @@ Third arg OTHER-WINDOW non-nil means visit in other window." | |||
| 70 | ;; for several related directories. | 70 | ;; for several related directories. |
| 71 | (setq file-name | 71 | (setq file-name |
| 72 | (expand-file-name (or (file-symlink-p file-name) file-name))) | 72 | (expand-file-name (or (file-symlink-p file-name) file-name))) |
| 73 | ;; Move up in the dir hierarchy till we find a change log file. | ||
| 74 | (let ((file1 file-name) | ||
| 75 | parent-dir) | ||
| 76 | (while (and (not (file-exists-p file1)) | ||
| 77 | (progn (setq parent-dir | ||
| 78 | (file-name-directory | ||
| 79 | (directory-file-name | ||
| 80 | (file-name-directory file1)))) | ||
| 81 | ;; Give up if we are already at the root dir. | ||
| 82 | (not (string= (file-name-directory file1) parent-dir)))) | ||
| 83 | ;; Move up to the parent dir and try again. | ||
| 84 | (setq file1 (expand-file-name (change-log-name) parent-dir))) | ||
| 85 | ;; If we found a change log in a parent, use that. | ||
| 86 | (if (file-exists-p file1) | ||
| 87 | (setq file-name file1))) | ||
| 88 | |||
| 73 | (set (make-local-variable 'change-log-default-name) file-name) | 89 | (set (make-local-variable 'change-log-default-name) file-name) |
| 74 | 90 | ||
| 75 | ;; Set ENTRY to the file name to use in the new entry. | 91 | ;; Set ENTRY to the file name to use in the new entry. |