diff options
Diffstat (limited to 'lisp')
| -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. |