comparison lisp/add-log.el @ 5150:60fa14264c3b

(add-change-log-entry): put buffer in change-log-mode. (find-change-log): correct calculation of file one directory out.
author Richard M. Stallman <rms@gnu.org>
date Wed, 24 Nov 1993 01:53:58 +0000
parents 61c4250fb760
children 7caf06258d7b
comparison
equal deleted inserted replaced
5149:c4c063887b13 5150:60fa14264c3b
101 (file-name-directory file1)))) 101 (file-name-directory file1))))
102 ;; Give up if we are already at the root dir. 102 ;; Give up if we are already at the root dir.
103 (not (string= (file-name-directory file1) 103 (not (string= (file-name-directory file1)
104 parent-dir)))) 104 parent-dir))))
105 ;; Move up to the parent dir and try again. 105 ;; Move up to the parent dir and try again.
106 (setq file1 (expand-file-name (change-log-name) parent-dir))) 106 (setq file1 (expand-file-name
107 (file-name-nondirectory (change-log-name))
108 parent-dir)))
107 ;; If we found a change log in a parent, use that. 109 ;; If we found a change log in a parent, use that.
108 (if (or (get-file-buffer file1) (file-exists-p file1)) 110 (if (or (get-file-buffer file1) (file-exists-p file1))
109 (setq file-name file1))) 111 (setq file-name file1)))
110 ;; Make a local variable in this buffer so we needn't search again. 112 ;; Make a local variable in this buffer so we needn't search again.
111 (set (make-local-variable 'change-log-default-name) file-name) 113 (set (make-local-variable 'change-log-default-name) file-name)
148 (file-name-nondirectory buffer-file-name)))) 150 (file-name-nondirectory buffer-file-name))))
149 151
150 (if (and other-window (not (equal file-name buffer-file-name))) 152 (if (and other-window (not (equal file-name buffer-file-name)))
151 (find-file-other-window file-name) 153 (find-file-other-window file-name)
152 (find-file file-name)) 154 (find-file file-name))
155 (or (eq major-mode 'change-log-mode)
156 (change-log-mode))
153 (undo-boundary) 157 (undo-boundary)
154 (goto-char (point-min)) 158 (goto-char (point-min))
155 (if (looking-at (concat (regexp-quote (substring (current-time-string) 159 (if (looking-at (concat (regexp-quote (substring (current-time-string)
156 0 10)) 160 0 10))
157 ".* " (regexp-quote add-log-full-name) 161 ".* " (regexp-quote add-log-full-name)