aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-02-09 09:14:53 +0000
committerRichard M. Stallman1999-02-09 09:14:53 +0000
commit666f4056900138f1febfef568cc2018d42990f2b (patch)
treeb8b42eedcd49963889386c6a83fd92cdecd2bc16
parent4315d68ee5bdc204b155b80e532148ac9fb4019c (diff)
downloademacs-666f4056900138f1febfef568cc2018d42990f2b.tar.gz
emacs-666f4056900138f1febfef568cc2018d42990f2b.zip
(add-log-file-name-function): New variable.
(add-change-log-entry): Call that function, if non-nil.
-rw-r--r--lisp/add-log.el23
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 63a758dd2ce..0c8c36dc51c 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -111,6 +111,14 @@ this variable."
111 :type 'boolean 111 :type 'boolean
112 :group 'change-log) 112 :group 'change-log)
113 113
114(defcustom add-log-file-name-function nil
115 "*If non-nil, function to call to identify the filename for a ChangeLog entry.
116This function is called with one argument, `buffer-file-name' in that buffer.
117If this is nil, the default is to use the file's name
118relative to the directory of the change log file."
119 :type 'function
120 :group 'change-log)
121
114(defvar change-log-font-lock-keywords 122(defvar change-log-font-lock-keywords
115 '(;; 123 '(;;
116 ;; Date lines, new and old styles. 124 ;; Date lines, new and old styles.
@@ -305,12 +313,15 @@ non-nil, otherwise in local time."
305 (and buffer-file-name 313 (and buffer-file-name
306 ;; Never want to add a change log entry for the ChangeLog file itself. 314 ;; Never want to add a change log entry for the ChangeLog file itself.
307 (not (string= buffer-file-name file-name)) 315 (not (string= buffer-file-name file-name))
308 (setq entry (if (string-match 316 (setq entry
309 (concat "^" (regexp-quote (file-name-directory 317 (if add-log-file-name-function
310 file-name))) 318 (funcall add-log-file-name-function buffer-file-name)
311 buffer-file-name) 319 (if (string-match
312 (substring buffer-file-name (match-end 0)) 320 (concat "^" (regexp-quote (file-name-directory
313 (file-name-nondirectory buffer-file-name)))) 321 file-name)))
322 buffer-file-name)
323 (substring buffer-file-name (match-end 0))
324 (file-name-nondirectory buffer-file-name)))))
314 325
315 (let ((buffer (find-buffer-visiting file-name))) 326 (let ((buffer (find-buffer-visiting file-name)))
316 (setq add-log-debugging (list (gap-position) (gap-size)))) 327 (setq add-log-debugging (list (gap-position) (gap-size))))