summaryrefslogtreecommitdiff
path: root/lisp/add-log.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-02-09 09:14:53 +0000
committerRichard M. Stallman <rms@gnu.org>1999-02-09 09:14:53 +0000
commit666f4056900138f1febfef568cc2018d42990f2b (patch)
treeb8b42eedcd49963889386c6a83fd92cdecd2bc16 /lisp/add-log.el
parent4315d68ee5bdc204b155b80e532148ac9fb4019c (diff)
downloademacs-666f4056900138f1febfef568cc2018d42990f2b.tar.gz
(add-log-file-name-function): New variable.
(add-change-log-entry): Call that function, if non-nil.
Diffstat (limited to 'lisp/add-log.el')
-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."
:type 'boolean
:group 'change-log)
+(defcustom add-log-file-name-function nil
+ "*If non-nil, function to call to identify the filename for a ChangeLog entry.
+This function is called with one argument, `buffer-file-name' in that buffer.
+If this is nil, the default is to use the file's name
+relative to the directory of the change log file."
+ :type 'function
+ :group 'change-log)
+
(defvar change-log-font-lock-keywords
'(;;
;; Date lines, new and old styles.
@@ -305,12 +313,15 @@ non-nil, otherwise in local time."
(and buffer-file-name
;; Never want to add a change log entry for the ChangeLog file itself.
(not (string= buffer-file-name file-name))
- (setq entry (if (string-match
- (concat "^" (regexp-quote (file-name-directory
- file-name)))
- buffer-file-name)
- (substring buffer-file-name (match-end 0))
- (file-name-nondirectory buffer-file-name))))
+ (setq entry
+ (if add-log-file-name-function
+ (funcall add-log-file-name-function buffer-file-name)
+ (if (string-match
+ (concat "^" (regexp-quote (file-name-directory
+ file-name)))
+ buffer-file-name)
+ (substring buffer-file-name (match-end 0))
+ (file-name-nondirectory buffer-file-name)))))
(let ((buffer (find-buffer-visiting file-name)))
(setq add-log-debugging (list (gap-position) (gap-size))))