Mercurial > emacs
annotate lisp/emacs-lisp/gulp.el @ 19501:bd8674fd15da
(KERBEROS5, HAVE_LIBKRB4, HAVE_LIBDES425, HAVE_LIBKRB5)
(HAVE_LIBCRYPTO, HAVE_LIBCOM_ERR, HAVE_KRB5_H, HAVE_DES_H, HAVE_KRB_H)
(HAVE_KERBEROSIV_DES_H, HAVE_KERBEROSIV_KRB_H, HAVE_KERBEROS_DES_H)
(HAVE_KERBEROS_KRB_H, HAVE_COM_ERR_H): Add undefs.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 24 Aug 1997 02:21:44 +0000 |
parents | d0f4e2e9e1f8 |
children | acdb727611dd |
rev | line source |
---|---|
15178 | 1 ;;; gulp.el --- Ask for updates for Lisp packages |
2 | |
3 ;; Copyright (C) 1996 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Sam Shteingold <shteingd@math.ucla.edu> | |
6 ;; Maintainer: FSF | |
7 ;; Keywords: maintenance | |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
15742 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
15178 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;; Search the emacs/{version}/lisp directory for *.el files, extract the | |
29 ;; name of the author or maintainer and send him e-mail requesting | |
30 ;; update. | |
31 | |
32 ;;; Code: | |
33 | |
34 (defvar gulp-discard "^;+ *Maintainer: *FSF *$" | |
35 "*The regexp matching the packages not requiring the request for updates.") | |
36 | |
15211 | 37 (defvar gulp-tmp-buffer "*gulp*" "The name of the temporary buffer.") |
15178 | 38 |
39 (defvar gulp-max-len 2000 | |
15179
be7cc250142a
(gulp-search-path, gulp-packages): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents:
15178
diff
changeset
|
40 "*Distance into a Lisp source file to scan for keywords.") |
15178 | 41 |
42 (defvar gulp-request-header | |
15211 | 43 (concat |
44 "This message was created automatically. | |
18012
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
45 I'm going to start pretesting a new version of GNU Emacs soon, so I'd |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
46 like to ask if you have any updates for the Emacs packages you work on. |
15211 | 47 You're listed as the maintainer of the following package(s):\n\n") |
48 "*The starting text of a gulp message.") | |
15178 | 49 |
50 (defvar gulp-request-end | |
15211 | 51 (concat |
52 "\nIf you have any changes since the version in the previous release (" | |
53 (format "%d.%d" emacs-major-version emacs-minor-version) | |
54 "), | |
55 please send them to me ASAP. | |
15178 | 56 |
18012
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
57 Please don't send the whole file. Instead, please send a patch made with |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
58 `diff -c' that shows precisely the changes you would like me to install. |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
59 Also please include itemized change log entries for your changes; |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
60 please use lisp/ChangeLog as a guide for the style and for what kinds |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
61 of information to include. |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
62 |
15211 | 63 Thanks.") |
64 "*The closing text in a gulp message.") | |
65 | |
66 (defun gulp-send-requests (dir &optional time) | |
15179
be7cc250142a
(gulp-search-path, gulp-packages): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents:
15178
diff
changeset
|
67 "Send requests for updates to the authors of Lisp packages in directory DIR. |
15211 | 68 For each maintainer, the message consists of `gulp-request-header', |
69 followed by the list of packages (with modification times if the optional | |
70 prefix argument TIME is non-nil), concluded with `gulp-request-end'. | |
71 | |
72 You can't edit the messages, but you can confirm whether to send each one. | |
15178 | 73 |
15211 | 74 The list of addresses for which you decided not to send mail |
75 is left in the `*gulp*' buffer at the end." | |
76 (interactive "DRequest updates for Lisp directory: \nP") | |
77 (save-excursion | |
78 (set-buffer (get-buffer-create gulp-tmp-buffer)) | |
79 (let ((m-p-alist (gulp-create-m-p-alist | |
80 (directory-files dir nil "^[^=].*\\.el$" t) | |
81 dir)) | |
82 ;; Temporarily inhibit undo in the *gulp* buffer. | |
83 (buffer-undo-list t) | |
84 mail-setup-hook msg node) | |
18012
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
85 (setq m-p-alist |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
86 (sort (function (lambda (a b) |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
87 (string< (car (car a)) (car (car b))))) |
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
88 m-p-alist)) |
15211 | 89 (while (setq node (car m-p-alist)) |
90 (setq msg (gulp-create-message (cdr node) time)) | |
91 (setq mail-setup-hook | |
92 '(lambda () | |
93 (mail-subject) | |
94 (insert "It's time for Emacs updates again") | |
95 (goto-char (point-max)) | |
96 (insert msg))) | |
97 (mail nil (car node)) | |
98 (if (y-or-n-p "Send? ") (mail-send) | |
99 (kill-this-buffer) | |
100 (set-buffer gulp-tmp-buffer) | |
101 (insert (format "%s\n\n" node))) | |
102 (setq m-p-alist (cdr m-p-alist)))) | |
103 (set-buffer gulp-tmp-buffer) | |
104 (setq buffer-undo-list nil))) | |
105 | |
106 | |
107 (defun gulp-create-message (rec time) | |
15178 | 108 "Return the message string for REC, which is a list like (FILE TIME)." |
109 (let (node (str gulp-request-header)) | |
110 (while (setq node (car rec)) | |
15211 | 111 (setq str (concat str "\t" (car node) |
112 (if time (concat "\tLast modified:\t" (cdr node))) | |
113 "\n")) | |
15178 | 114 (setq rec (cdr rec))) |
115 (concat str gulp-request-end))) | |
116 | |
117 | |
15211 | 118 (defun gulp-create-m-p-alist (flist dir) |
119 "Create the maintainer/package alist for files in FLIST in DIR. | |
120 That is a list of elements, each of the form (MAINTAINER PACKAGES...)." | |
15178 | 121 (save-excursion |
18012
d0f4e2e9e1f8
(gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents:
15742
diff
changeset
|
122 (let (mplist filen node mnt-tm mnt tm fl-tm) |
15211 | 123 (get-buffer-create gulp-tmp-buffer) |
124 (set-buffer gulp-tmp-buffer) | |
125 (setq buffer-undo-list t) | |
126 (while flist | |
127 (setq fl-tm (gulp-maintainer (setq filen (car flist)) dir)) | |
128 (if (setq tm (cdr fl-tm) mnt (car fl-tm));; there is a definite maintainer | |
129 (if (setq node (assoc mnt mplist));; this is not a new maintainer | |
130 (setq mplist (cons (cons mnt (cons (cons filen tm) (cdr node))) | |
131 (delete node mplist))) | |
132 (setq mplist (cons (list mnt (cons filen (cdr fl-tm))) mplist)))) | |
133 (setq flist (cdr flist))) | |
134 (erase-buffer) | |
135 mplist))) | |
136 | |
137 (defun gulp-maintainer (filenm dir) | |
138 "Return a list (MAINTAINER TIMESTAMP) for the package FILENM in directory DIR." | |
139 (save-excursion | |
140 (let* ((fl (concat dir filenm)) mnt | |
15178 | 141 (timest (format-time-string "%Y-%m-%d %a %T %Z" |
142 (elt (file-attributes fl) 5)))) | |
143 (set-buffer gulp-tmp-buffer) | |
144 (erase-buffer) | |
145 (insert-file-contents fl nil 0 gulp-max-len) | |
146 (goto-char 1) | |
147 (if (re-search-forward gulp-discard nil t) | |
148 (setq mnt nil) ;; do nothing, return nil | |
149 (goto-char 1) | |
150 (if (and (re-search-forward "^;+ *Maintainer: \\(.*\\)$" nil t) | |
151 (> (length (setq mnt (match-string 1))) 0)) | |
152 () ;; found! | |
153 (goto-char 1) | |
154 (if (re-search-forward "^;+ *Author: \\(.*\\)$" nil t) | |
155 (setq mnt (match-string 1)))) | |
156 (if (= (length mnt) 0) (setq mnt nil))) ;; "^;; Author: $" --> nil | |
157 (cons mnt timest)))) | |
158 | |
159 ;;; gulp.el ends here |