123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- (require 'cl)
- (require 'update-changelog)
- (defvar patch-greeting "hello guile maintainers,\n\n"
- "*String to insert at beginning of patch mail.")
- (defun patch-scan-files ()
- (let (files)
- (save-excursion
- (while (re-search-forward "^[+][+][+] \\(\\S-+\\)" (point-max) t)
- (setq files (cons (cons (match-string 1)
- (match-beginning 0))
- files))))
- (reverse files)))
- (defun patch-common-prefix (filenames)
- (let* ((first-file (car filenames))
- (prefix (and first-file (file-name-directory first-file))))
- (while (and prefix
- (not (string= "" prefix))
- (not (every (lambda (filename)
- (string-match (concat "^" prefix) filename))
- filenames)))
- (setq prefix (file-name-directory (substring prefix 0 -1))))
- prefix))
- (defun patch-changelog-skeleton ()
- (let* ((file-info (patch-scan-files))
- (fullpath-files (mapcar 'car file-info))
- (cut (length (patch-common-prefix fullpath-files)))
- (files (mapcar (lambda (fullpath-file)
- (substring fullpath-file cut))
- fullpath-files)))
- (mapconcat
- (lambda (file)
- (concat (make-string (length file) ?_) "\n" file "\n[writeme]"))
- files
- "\n")))
- (defun patch-send (buffer subject)
- (interactive "bBuffer: \nsSubject: ")
- (when (string= "" subject)
- (error "(empty subject)"))
- (compose-mail "bug-guile@gnu.org" subject)
- (insert (with-current-buffer buffer (buffer-string)))
- (mail-text)
- (insert patch-greeting)
- (save-excursion
- (insert "here is a patch ... [overview/observations/etc]\n\n"
- (patch-changelog-skeleton) "\n\n\n"
- (make-string 72 ?_) "\n")))
-
|