Mercurial > emacs
comparison lisp/add-log.el @ 9886:f54af6fe889e
(find-change-log): If change-log-default-name
has no dir component, search through parent dirs for it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 10 Nov 1994 22:03:43 +0000 |
parents | 3e99bdb36cbb |
children | d453910ac3da |
comparison
equal
deleted
inserted
replaced
9885:841621b2305f | 9886:f54af6fe889e |
---|---|
75 ;;;###autoload | 75 ;;;###autoload |
76 (defun find-change-log (&optional file-name) | 76 (defun find-change-log (&optional file-name) |
77 "Find a change log file for \\[add-change-log-entry] and return the name. | 77 "Find a change log file for \\[add-change-log-entry] and return the name. |
78 | 78 |
79 Optional arg FILE-NAME specifies the file to use. | 79 Optional arg FILE-NAME specifies the file to use. |
80 If FILE-NAME is nil, use the value of `change-log-default-name' if non-nil. | 80 If FILE-NAME is nil, use the value of `change-log-default-name'. |
81 Otherwise, search in the current directory and its successive parents | 81 If 'change-log-default-name' is nil, behave as though it were 'ChangeLog' |
82 for a file named `ChangeLog' (or whatever we use on this operating system). | 82 \(or whatever we use on this operating system). |
83 | |
84 If 'change-log-default-name' contains a leading directory component, then | |
85 simply find it in the current directory. Otherwise, search in the current | |
86 directory and its successive parents for a file so named. | |
83 | 87 |
84 Once a file is found, `change-log-default-name' is set locally in the | 88 Once a file is found, `change-log-default-name' is set locally in the |
85 current buffer to the complete file name." | 89 current buffer to the complete file name." |
86 ;; If user specified a file name or if this buffer knows which one to use, | 90 ;; If user specified a file name or if this buffer knows which one to use, |
87 ;; just use that. | 91 ;; just use that. |
88 (or file-name | 92 (or file-name |
89 (setq file-name change-log-default-name) | 93 (setq file-name (and change-log-default-name |
94 (file-name-directory change-log-default-name) | |
95 change-log-default-name)) | |
90 (progn | 96 (progn |
91 ;; Chase links in the source file | 97 ;; Chase links in the source file |
92 ;; and use the change log in the dir where it points. | 98 ;; and use the change log in the dir where it points. |
93 (setq file-name (or (and buffer-file-name | 99 (setq file-name (or (and buffer-file-name |
94 (file-name-directory | 100 (file-name-directory |