aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-05-11 11:08:11 +0000
committerRichard M. Stallman1996-05-11 11:08:11 +0000
commit8060ee8f145887733387da5d163a66a0e9b8cccb (patch)
treed4d92fc40f9560bfeafbab4d824ce748b02ea167
parent70ffb393eaf1624e41222d3c94ecb74623853bdd (diff)
downloademacs-8060ee8f145887733387da5d163a66a0e9b8cccb.tar.gz
emacs-8060ee8f145887733387da5d163a66a0e9b8cccb.zip
Lots of fixes.
-rw-r--r--lisp/emacs-lisp/gulp.el129
1 files changed, 80 insertions, 49 deletions
diff --git a/lisp/emacs-lisp/gulp.el b/lisp/emacs-lisp/gulp.el
index 953ef1a8286..259085b44d7 100644
--- a/lisp/emacs-lisp/gulp.el
+++ b/lisp/emacs-lisp/gulp.el
@@ -33,72 +33,103 @@
33(defvar gulp-discard "^;+ *Maintainer: *FSF *$" 33(defvar gulp-discard "^;+ *Maintainer: *FSF *$"
34 "*The regexp matching the packages not requiring the request for updates.") 34 "*The regexp matching the packages not requiring the request for updates.")
35 35
36(defvar gulp-tmp-buffer " *gulp*" "The name of the temporary buffer.") 36(defvar gulp-tmp-buffer "*gulp*" "The name of the temporary buffer.")
37 37
38(defvar gulp-max-len 2000 38(defvar gulp-max-len 2000
39 "*Distance into a Lisp source file to scan for keywords.") 39 "*Distance into a Lisp source file to scan for keywords.")
40 40
41(defvar gulp-request-header 41(defvar gulp-request-header
42 "This message was created automatically. 42 (concat
43Apparently, you are the maintainer of the following package(s):\n\n" 43 "This message was created automatically.
44 "*Text to use at the start of a message sent to request updates.") 44A new version of GNU Emacs, "
45 (format "%d.%d" emacs-major-version (+ emacs-minor-version 1))
46 ", is entering the pretest state,
47and it is high time to submit the updates to the various emacs packages.
48You're listed as the maintainer of the following package(s):\n\n")
49 "*The starting text of a gulp message.")
45 50
46(defvar gulp-request-end 51(defvar gulp-request-end
47 "\nIf your copy is newer than mine, please email me the patches ASAP.\n\n" 52 (concat
48 "*Text to add at the end of a message sent to request updates.") 53 "\nIf you have any changes since the version in the previous release ("
54 (format "%d.%d" emacs-major-version emacs-minor-version)
55 "),
56please send them to me ASAP.
49 57
50(defun gulp-send-requests (dir) 58Thanks.")
59 "*The closing text in a gulp message.")
60
61(defun gulp-send-requests (dir &optional time)
51 "Send requests for updates to the authors of Lisp packages in directory DIR. 62 "Send requests for updates to the authors of Lisp packages in directory DIR.
52The prepared message consists of `gulp-request-header', followed by the 63For each maintainer, the message consists of `gulp-request-header',
53list of packages with modification times, concluded with `gulp-request-end'. 64followed by the list of packages (with modification times if the optional
54You can't edit the message, but you can confirm whether to send it. 65prefix argument TIME is non-nil), concluded with `gulp-request-end'.
55The list of rejected addresses will be put into `gulp-tmp-buffer'." 66
56 (interactive "DRequest updates for Lisp directory: ") 67You can't edit the messages, but you can confirm whether to send each one.
57 (let ((m-p-alist (gulp-create-m-p-alist 68
58 (directory-files dir nil "\\.el$" t))) 69The list of addresses for which you decided not to send mail
59 mail-setup-hook msg node) 70is left in the `*gulp*' buffer at the end."
60 (while (setq node (car m-p-alist)) 71 (interactive "DRequest updates for Lisp directory: \nP")
61 (setq msg (gulp-create-message (cdr node))) 72 (save-excursion
62 (setq mail-setup-hook '(lambda () (goto-char (point-max)) (insert msg))) 73 (set-buffer (get-buffer-create gulp-tmp-buffer))
63 (mail nil (car node)) 74 (let ((m-p-alist (gulp-create-m-p-alist
64 (if (y-or-n-p "Send? ") (mail-send) 75 (directory-files dir nil "^[^=].*\\.el$" t)
65 (kill-this-buffer) 76 dir))
66 (set-buffer gulp-tmp-buffer) 77 ;; Temporarily inhibit undo in the *gulp* buffer.
67 (insert (format "%s\n\n" node))) 78 (buffer-undo-list t)
68 (setq m-p-alist (cdr m-p-alist))))) 79 mail-setup-hook msg node)
69 80 (while (setq node (car m-p-alist))
70(defun gulp-create-message (rec) 81 (setq msg (gulp-create-message (cdr node) time))
82 (setq mail-setup-hook
83 '(lambda ()
84 (mail-subject)
85 (insert "It's time for Emacs updates again")
86 (goto-char (point-max))
87 (insert msg)))
88 (mail nil (car node))
89 (if (y-or-n-p "Send? ") (mail-send)
90 (kill-this-buffer)
91 (set-buffer gulp-tmp-buffer)
92 (insert (format "%s\n\n" node)))
93 (setq m-p-alist (cdr m-p-alist))))
94 (set-buffer gulp-tmp-buffer)
95 (setq buffer-undo-list nil)))
96
97
98(defun gulp-create-message (rec time)
71 "Return the message string for REC, which is a list like (FILE TIME)." 99 "Return the message string for REC, which is a list like (FILE TIME)."
72 (let (node (str gulp-request-header)) 100 (let (node (str gulp-request-header))
73 (while (setq node (car rec)) 101 (while (setq node (car rec))
74 (setq str (concat str "\t" (car node) "\tLast modified:\t" (cdr node) "\n")) 102 (setq str (concat str "\t" (car node)
103 (if time (concat "\tLast modified:\t" (cdr node)))
104 "\n"))
75 (setq rec (cdr rec))) 105 (setq rec (cdr rec)))
76 (concat str gulp-request-end))) 106 (concat str gulp-request-end)))
77 107
78(defun gulp-create-m-p-alist (flist)
79 "Create the maintainer/package alist for files in FLIST.
80List of elements (MAINTAINER . (LIST of PACKAGES))"
81 (let (mplist filen node fl-tm)
82 (get-buffer-create gulp-tmp-buffer)
83 (while flist
84 (setq fl-tm (gulp-maintainer (setq filen (car flist))))
85 (if (setq mnt (car fl-tm));; there is a definite maintainer
86 (if (setq node (assoc mnt mplist));; this is not a new maintainer
87 (setq mplist (cons (cons (car node)
88 (cons (cons filen (cdr fl-tm))
89 (cdr node)))
90 (delete node mplist)))
91 (setq mplist (cons (list mnt (cons filen (cdr fl-tm))) mplist))))
92 (message "%s -- %s" filen fl-tm)
93 (setq flist (cdr flist)))
94 (set-buffer gulp-tmp-buffer)
95 (erase-buffer)
96 mplist))
97 108
98(defun gulp-maintainer (filenm) 109(defun gulp-create-m-p-alist (flist dir)
99 "Return a list (MAINTAINER TIMESTAMP) for the package FILENM." 110 "Create the maintainer/package alist for files in FLIST in DIR.
111That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
112 (save-excursion
113 (let (mplist filen node mnt-tm mnt tm)
114 (get-buffer-create gulp-tmp-buffer)
115 (set-buffer gulp-tmp-buffer)
116 (setq buffer-undo-list t)
117 (while flist
118 (setq fl-tm (gulp-maintainer (setq filen (car flist)) dir))
119 (if (setq tm (cdr fl-tm) mnt (car fl-tm));; there is a definite maintainer
120 (if (setq node (assoc mnt mplist));; this is not a new maintainer
121 (setq mplist (cons (cons mnt (cons (cons filen tm) (cdr node)))
122 (delete node mplist)))
123 (setq mplist (cons (list mnt (cons filen (cdr fl-tm))) mplist))))
124 (message "%s -- %s" filen fl-tm)
125 (setq flist (cdr flist)))
126 (erase-buffer)
127 mplist)))
128
129(defun gulp-maintainer (filenm dir)
130 "Return a list (MAINTAINER TIMESTAMP) for the package FILENM in directory DIR."
100 (save-excursion 131 (save-excursion
101 (let* ((fl (concat gulp-search-path filenm)) mnt 132 (let* ((fl (concat dir filenm)) mnt
102 (timest (format-time-string "%Y-%m-%d %a %T %Z" 133 (timest (format-time-string "%Y-%m-%d %a %T %Z"
103 (elt (file-attributes fl) 5)))) 134 (elt (file-attributes fl) 5))))
104 (set-buffer gulp-tmp-buffer) 135 (set-buffer gulp-tmp-buffer)