67 |
|
|
68 |
;;;###autoload |
;;;###autoload |
69 |
(defcustom add-log-mailing-address nil |
(defcustom add-log-mailing-address nil |
70 |
"*Electronic mail address of user, for inclusion in ChangeLog daily headers. |
"*Electronic mail addresses of user, for inclusion in ChangeLog headers. |
71 |
This defaults to the value of `user-mail-address'." |
This defaults to the value of `user-mail-address'. In addition to |
72 |
|
being a simple string, this value can also be a list. All elements |
73 |
|
will be recognized as referring to the same user; when creating a new |
74 |
|
ChangeLog entry, one element will be chosen at random." |
75 |
:type '(choice (const :tag "Default" nil) |
:type '(choice (const :tag "Default" nil) |
76 |
string) |
(repeat string)) |
77 |
:group 'change-log) |
:group 'change-log) |
78 |
|
|
79 |
(defcustom add-log-time-format 'add-log-iso8601-time-string |
(defcustom add-log-time-format 'add-log-iso8601-time-string |
479 |
(skip-chars-forward "\n")) |
(skip-chars-forward "\n")) |
480 |
|
|
481 |
;; Advance into first entry if it is usable; else make new one. |
;; Advance into first entry if it is usable; else make new one. |
482 |
(let ((new-entry (concat (funcall add-log-time-format) |
(let ((new-entries (mapcar (lambda (addr) |
483 |
" " add-log-full-name |
(concat (funcall add-log-time-format) |
484 |
" <" add-log-mailing-address ">"))) |
" " add-log-full-name |
485 |
|
" <" addr ">")) |
486 |
|
(if (consp add-log-mailing-address) |
487 |
|
add-log-mailing-address |
488 |
|
(list add-log-mailing-address))))) |
489 |
(if (and (not add-log-always-start-new-record) |
(if (and (not add-log-always-start-new-record) |
490 |
(looking-at (regexp-quote new-entry))) |
(let ((hit nil)) |
491 |
|
(dolist (entry new-entries hit) |
492 |
|
(when (looking-at (regexp-quote entry)) |
493 |
|
(setq hit t))))) |
494 |
(forward-line 1) |
(forward-line 1) |
495 |
(insert new-entry "\n\n") |
(insert (nth (random (length new-entries)) |
496 |
|
new-entries) |
497 |
|
"\n\n") |
498 |
(forward-line -1))) |
(forward-line -1))) |
499 |
|
|
500 |
;; Determine where we should stop searching for a usable |
;; Determine where we should stop searching for a usable |