Mercurial > hg > xemacs-beta
comparison lisp/build-report.el @ 217:d44af0c54775 r20-4b7
Import from CVS: tag r20-4b7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:08:34 +0200 |
parents | |
children | 262b8bb4a523 |
comparison
equal
deleted
inserted
replaced
216:43306a74e31c | 217:d44af0c54775 |
---|---|
1 ;;; xemacs-build-report.el --- Automatically formatted build reports for XEmacs | |
2 | |
3 ;; Copyright (C) 1997 Adrian Aichner | |
4 | |
5 ;; Author: Adrian Aichner, Teradyne GmbH Munich <aichner@ecf.teradyne.com> | |
6 ;; Date: Sun., Apr. 20, 1997. | |
7 ;; Version: 1.28 | |
8 ;; Keywords: internal | |
9 | |
10 ;; This file is part of XEmacs. | |
11 | |
12 ;; XEmacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; XEmacs is distributed in the hope that it will be useful, but | |
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 ;; General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
25 ;; 02111-1307, USA. | |
26 | |
27 ;;; Synched up with: Not synched. | |
28 | |
29 ;;; Commentary: | |
30 | |
31 ;; The Idea: | |
32 ;; Let XEmacs report interesting aspects of how it was built. | |
33 | |
34 ;; The Concept: | |
35 ;; User creates an XEmacs Build Report by just calling | |
36 ;; M-x xemacs-create-build-report | |
37 ;; which will initialize a mail buffer with relevant information | |
38 ;; derived from the XEmacs build process. Point is left at the | |
39 ;; beginning of the report for user to input some personal notes and | |
40 ;; send the report. | |
41 | |
42 ;; The Status: | |
43 ;; This is the first `Proof of Concept'. | |
44 | |
45 ;; The Author: | |
46 ;; Adrian Aichner, Teradyne GmbH Munich, Sun., Apr. 20, 1997. | |
47 | |
48 ;;; Code: | |
49 | |
50 (require 'config) | |
51 (provide 'xemacs-build-report) | |
52 | |
53 ;; Due to recommandation by developers on xemacs-beta@xemacs.org, | |
54 ;; release versions are to be checked out using `co -u -kv ...'. | |
55 (defconst xemacs-build-report-version | |
56 "1.28" | |
57 "Version number of xemacs-build-report.") | |
58 | |
59 (defgroup xemacs-build-report nil | |
60 "Package automating the process of sending Xemacs Build Reports.") | |
61 | |
62 (defcustom xemacs-build-report-destination | |
63 "xemacs-beta@xemacs.org" | |
64 "The mail address XEmacs Build Reports should go to." | |
65 :group 'xemacs-build-report) | |
66 | |
67 (defcustom xemacs-build-report-keep-regexp | |
68 "make\\[\\|error\\|warn\\|pure.*\\(space\\|size\\)\\|hides\\b\\|strange\\|shadowings" | |
69 "Regexp of make process output lines to keep in the report." | |
70 :group 'xemacs-build-report) | |
71 | |
72 (defcustom xemacs-build-report-delete-regexp | |
73 "confl.*with.*auto-inlining" | |
74 "Regexp of make process output lines to delete from the report." | |
75 :group 'xemacs-build-report) | |
76 | |
77 (defcustom xemacs-build-report-make-output-file | |
78 (concat (gethash 'blddir (config-value-hash-table)) "/beta.err") | |
79 "Filename where stdout and stderr of XEmacs make process have been stored. | |
80 mk.err will not be created automatically. You'll have to run make with | |
81 output redirection. I use an alias | |
82 alias mk 'make \!* >>&\! \!$.err &' | |
83 for that, so that I get beta.err went I run `mk beta'." | |
84 :group 'xemacs-build-report) | |
85 | |
86 (defcustom xemacs-build-report-installation-file | |
87 (concat (gethash 'blddir (config-value-hash-table)) "/Installation") | |
88 "Installation file produced by XEmacs configure process." | |
89 :group 'xemacs-build-report) | |
90 | |
91 (defcustom xemacs-build-report-subject | |
92 (concat "[%s] " emacs-version " on " system-configuration) | |
93 "XEmacs Build Report Subject Line. %s-sequences will be substituted | |
94 with user input through `xemacs-create-build-report' according to | |
95 `xemacs-build-report-prompts' using `format'." | |
96 :group 'xemacs-build-report) | |
97 | |
98 (defcustom xemacs-build-report-prompts | |
99 '(("Status?: " "Success" "Failure")) | |
100 "XEmacs Build Report Prompt(s). This is a list of prompt-string | |
101 lists used by `xemacs-create-build-report' in conjunction with | |
102 `xemacs-build-report-subject'. Each list consists of a prompt string | |
103 followed by any number of strings which can be chosen via the history | |
104 mechanism." | |
105 :group 'xemacs-build-report) | |
106 | |
107 (defcustom xemacs-build-report-file-encoding | |
108 "7bit" | |
109 "XEmacs Build Report File Encoding to be used when MIME support is | |
110 available." | |
111 :group 'xemacs-build-report) | |
112 | |
113 ;; Symbol Name mappings from TM to SEMI serving as | |
114 ;; Compatibility Bandaid | |
115 ;; If 'mime-editor/version-name is bound, we must be using TM(-edit). | |
116 (if (featurep 'mime-setup) | |
117 (if (locate-library "tm-edit") | |
118 (progn | |
119 ;; No (defvaralias ...) so far. T | |
120 ;; Thanks to "Didier Verna" verna@inf.enst.fr for reporting my | |
121 ;; incorrect defvaraliasing of `mime-editor/insert-tag'. | |
122 (defalias | |
123 'mime-edit-insert-tag | |
124 'mime-editor/insert-tag | |
125 ) | |
126 (defalias | |
127 'mime-edit-insert-binary-file | |
128 'mime-editor/insert-binary-file | |
129 )))) | |
130 | |
131 (defun xemacs-create-build-report (&rest args) | |
132 "Initializes a fresh mail-mode buffer with the contents of XEmacs | |
133 Installation file and excerpts from XEmacs make output and errors and | |
134 leaves point at the beginning of the mail text. See also | |
135 `xemacs-build-report-destination', | |
136 `xemacs-build-report-keep-regexp', | |
137 `xemacs-build-report-delete-regexp', | |
138 `xemacs-build-report-make-output-file' and | |
139 `xemacs-build-report-installation-file'." | |
140 (interactive | |
141 (let (prompt | |
142 hist | |
143 arg | |
144 (prompts xemacs-build-report-prompts)) | |
145 (progn | |
146 (while prompts | |
147 (setq prompt (caar prompts)) | |
148 (setq hist (cdar prompts)) | |
149 (setq prompts (cdr prompts)) | |
150 (setq arg (cons (read-string prompt "" 'hist) arg))) | |
151 arg))) | |
152 (save-excursion | |
153 (compose-mail | |
154 xemacs-build-report-destination | |
155 (apply 'format xemacs-build-report-subject args) | |
156 nil | |
157 nil | |
158 nil | |
159 nil | |
160 nil) | |
161 (let ((report-begin (mail-text))) | |
162 (xemacs-build-report-insert-make-output report-begin) | |
163 (xemacs-build-report-insert-installation-file report-begin) | |
164 (xemacs-build-report-insert-header report-begin) | |
165 ))) | |
166 | |
167 (defun xemacs-build-report-insert-header (where) | |
168 "Inserts the xemacs-build-report-header at the point specified by `where'." | |
169 (goto-char where) | |
170 (insert "\n> XEmacs Build Report as generated\n> by " | |
171 "xemacs-build-report-version " | |
172 xemacs-build-report-version | |
173 " follows:\n\n")) | |
174 | |
175 (defun xemacs-build-report-insert-make-output (where) | |
176 "Inserts the output of the XEmacs Beta make run. | |
177 The make process output must have been saved in | |
178 `xemacs-build-report-make-output-file' during the XEmacs Beta building." | |
179 (goto-char where) | |
180 (if (file-exists-p xemacs-build-report-make-output-file) | |
181 (progn | |
182 (if (featurep 'mime-setup) | |
183 (progn | |
184 (setq xemacs-build-report-keep-regexp | |
185 (concat "^--\\[\\[\\|\\]\\]$\\|" | |
186 xemacs-build-report-keep-regexp)) | |
187 (mime-edit-insert-tag | |
188 "application" | |
189 "octet-stream" | |
190 (concat | |
191 "\nContent-Disposition: attachment;" | |
192 " filename=\"" | |
193 (file-name-nondirectory | |
194 xemacs-build-report-make-output-file) | |
195 "\"")) | |
196 (mime-edit-insert-binary-file | |
197 xemacs-build-report-make-output-file | |
198 xemacs-build-report-file-encoding)) | |
199 (insert-file-contents xemacs-build-report-make-output-file)) | |
200 (goto-char where) | |
201 (delete-non-matching-lines | |
202 xemacs-build-report-keep-regexp) | |
203 (goto-char where) | |
204 (delete-matching-lines xemacs-build-report-delete-regexp) | |
205 (goto-char where) | |
206 (insert "> Contents of " | |
207 xemacs-build-report-make-output-file | |
208 "\n> keeping lines matching\n> \"" | |
209 xemacs-build-report-keep-regexp | |
210 "\"\n> and then deleting lines matching\n> \"" | |
211 xemacs-build-report-delete-regexp | |
212 "\"\n\n")) | |
213 (insert "> " xemacs-build-report-make-output-file | |
214 " does not exist!\n\n"))) | |
215 | |
216 (defun xemacs-build-report-insert-installation-file (where) | |
217 "Inserts the contents of the `xemacs-build-report-installation-file' | |
218 created by the XEmacs Beta configure process." | |
219 (goto-char where) | |
220 (if (file-exists-p xemacs-build-report-installation-file) | |
221 (progn | |
222 (insert "> Contents of " | |
223 xemacs-build-report-installation-file | |
224 ":\n\n") | |
225 (if (featurep 'mime-setup) | |
226 (progn | |
227 (mime-edit-insert-tag | |
228 "application" | |
229 "octet-stream" | |
230 (concat | |
231 "\nContent-Disposition: attachment;" | |
232 " filename=\"" | |
233 (file-name-nondirectory | |
234 xemacs-build-report-installation-file) | |
235 "\"")) | |
236 (mime-edit-insert-binary-file | |
237 xemacs-build-report-installation-file | |
238 xemacs-build-report-file-encoding)) | |
239 (insert-file-contents xemacs-build-report-installation-file))) | |
240 (insert "> " xemacs-build-report-installation-file | |
241 " does not exist!\n\n"))) | |
242 | |
243 ;;; xemacs-build-report.el ends here |