From xemacs-m  Sun Aug 10 19:27:47 1997
Received: from steadfast.teradyne.com (steadfast.teradyne.com [131.101.1.200])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA18198
	for <xemacs-beta@xemacs.org>; Sun, 10 Aug 1997 19:27:46 -0500 (CDT)
Received: from engine.ecf.teradyne.com (engine.ecf.teradyne.com [131.101.192.6]) by steadfast.teradyne.com (8.7.1/8.7.1) with ESMTP id UAA01073 for <xemacs-beta@xemacs.org>; Sun, 10 Aug 1997 20:32:05 -0400 (EDT)
Received: (from aichner@localhost) by engine.ecf.teradyne.com (8.7.1/8.7.1) id CAA13598; Mon, 11 Aug 1997 02:27:12 +0200 (MET DST)
To: XEmacs Beta Mailing List <xemacs-beta@xemacs.org>
Subject: xemacs-build-report.el<1.23> using mail, supporting TM, SEMI or none
X-Face: 4[iHdXiTu\V3u[~\I)<f9HC);%~nG8`oUqv#uzvs6=\V{AjN6Sn
 c/qi;YLwRmEbt8Y*=j5n(urqY@chPh@J'D"QlqD!C8>*}#kYF[-tYl3VZga/HSOP|K,{L
 Rtu@f0y/=O&Cu}\:~d|P$JON?pn?j,&CnPb1z#/TL9bkAJwyol&a:SvYj-VYbM=Dtxhk9
 =w|R6U3_;SH&B<Mfy6Q%#
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Aug_11_02:27:11_1997-1"
Content-Transfer-Encoding: 7bit
From: Adrian Aichner <aichner@ecf.teradyne.com>
Date: 11 Aug 1997 02:27:12 +0200
Message-ID: <rxsafipsgwv.fsf@ecf.teradyne.com>
Lines: 272
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta17) - "Bucharest"

--Multipart_Mon_Aug_11_02:27:11_1997-1
Content-Type: text/plain; charset=US-ASCII


Since there has been interest from some of you and Bucharest is still
young, here is the lastest version of:


--Multipart_Mon_Aug_11_02:27:11_1997-1
Content-Type: application/octet-stream; type=emacs-lisp
Content-Disposition: attachment; filename="xemacs-build-report.el"
Content-Transfer-Encoding: 7bit

;; 	$Id: xemacs-build-report.el,v 1.23 1997/08/11 00:15:15 aichner Exp $	
;; The Idea:
;; Let XEmacs report interesting aspects of how it was built.

;; The Concept:
;; User creates an XEmacs Build Report by just calling
;; M-x xemacs-create-build-report
;; which will initialize a mail buffer with relevant information
;; derived from the XEmacs build process. Point is left at the
;; beginning of the report for user to input some personal notes and
;; send the report.

;; The Status:
;; This is the first `Proof of Concept'.

;; The Author:
;; Adrian Aichner, Teradyne GmbH Munich, Sun., Apr. 20, 1997.

(require 'config)
(provide 'xemacs-build-report)

;; Building the version from the RCS Revision keyword was lifted from
;; lisp/packages/auto-save.el.
;; This was later taken out due to recommandation by developers on
;; xemacs-beta@xemacs.org. Release versions are to be checked out
;; using `co -u -kv ...'.
(defconst xemacs-build-report-version
  "$Revision: 1.23 $"
  "Version number of xemacs-build-report.")

(defgroup xemacs-build-report nil
  "Package automating the process of sending Xemacs Build Reports.")

(defcustom xemacs-build-report-destination
  "xemacs-beta@xemacs.org"
  "The mail address XEmacs Build Reports should go to."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-keep-regexp
  "make\\[\\|warn\\|pure.*\\(space\\|size\\)"
  "Regexp of make process output lines to keep in the report."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-delete-regexp
  "confl.*with.*auto-inlining"
  "Regexp of make process output lines to delete from the report."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-make-output-file
  (concat (gethash 'blddir (config-value-hash-table)) "/mk.err")
  "Filename where stdout and stderr of XEmacs make process have been stored.
mk.err will not be created automatically. You'll have to run make with
output redirection. I use an alias
alias mk 'make \!* >>&\! \!$.err &'
for that, so that I get mk.err went I run mk."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-installation-file
  (concat (gethash 'blddir (config-value-hash-table)) "/Installation")
  "Installation file produced by XEmacs configure process."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-subject
  (concat "Build %s: " emacs-version " on " system-configuration)
  "XEmacs Build Report Subject Line. %s-sequences will be substituted
with user input through `xemacs-create-build-report' according to
`xemacs-build-report-prompts' using `format'."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-prompts
  '(("Status?: "  "Success" "Failure"))
  "XEmacs Build Report Prompt(s). This is a list of prompt-string
lists used by `xemacs-create-build-report' in conjunction with
`xemacs-build-report-subject'. Each list consists of a prompt string
followed by any number of strings which can be chosen via the history
mechanism."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-file-encoding
  "7bit"
  "XEmacs Build Report File Encoding to be used when MIME support is
available."
:group 'xemacs-build-report)

;; Symbol Name mappings from TM to SEMI serving as
;; Compatibility Bandaid
;; If 'mime-editor/version-name is bound, we must be using TM(-edit).
(if (boundp 'mime-editor/version-name)
    (progn
      (defvaralias
	'mime-edit-insert-tag
	'mime-editor/insert-tag)
      (defalias
	'mime-edit-insert-binary-file
	'mime-editor/insert-binary-file)))

(defun xemacs-create-build-report (&rest args)
  "Initializes a fresh mail-mode buffer with the contents of XEmacs 
Installation file and excerpts from XEmacs make output and errors and
leaves point at the beginning of the mail text. See also
`xemacs-build-report-destination',
`xemacs-build-report-keep-regexp',
`xemacs-build-report-delete-regexp',
`xemacs-build-report-make-output-file' and
`xemacs-build-report-installation-file'."
  (interactive
   (let (prompt
	 hist
	 arg
	 (prompts xemacs-build-report-prompts))
     (progn
       (while prompts
	 (setq prompt (caar prompts))
	 (setq hist (cdar prompts))
	 (setq prompts (cdr prompts))
	 (setq arg (cons (read-string prompt "" 'hist) arg)))
       arg)))
  (save-excursion
    (mail
     t
     xemacs-build-report-destination
     (apply 'format xemacs-build-report-subject args))
    (let ((report-begin (mail-text)))
      (if (file-exists-p xemacs-build-report-make-output-file)
	  (progn
 	    (if (featurep 'mime-setup)
		(progn
		  (setq xemacs-build-report-keep-regexp
			(concat "^--\\[\\[\\|\\]\\]$\\|"
				xemacs-build-report-keep-regexp))
		  (mime-edit-insert-tag
		   "application"
		   "octet-stream" 
		   (concat
		    "\nContent-Disposition: attachment;"
		    " filename=\""
		    (file-name-nondirectory
		     xemacs-build-report-make-output-file)
		    "\""))
		  (mime-edit-insert-binary-file
		   xemacs-build-report-make-output-file
		   xemacs-build-report-file-encoding))
	      (insert-file-contents xemacs-build-report-make-output-file))
	    (goto-char report-begin)
	    (delete-non-matching-lines
	     xemacs-build-report-keep-regexp)
	    (goto-char report-begin)
	    (delete-matching-lines xemacs-build-report-delete-regexp)
	    (goto-char report-begin)
	    (insert "> Contents of " 
		    xemacs-build-report-make-output-file
		    "\n> keeping lines matching\n> \""
		    xemacs-build-report-keep-regexp
		    "\"\n> and then deleting lines matching\n> \""
		    xemacs-build-report-delete-regexp
		    "\"\n\n"))
	(insert "> " xemacs-build-report-make-output-file
		" does not exist!\n\n"))
      (goto-char report-begin)
      (insert "\n> XEmacs Build Report as generated\n> by "
	      "xemacs-build-report-version "
	      xemacs-build-report-version
	      " follows:\n\n")
      (if (file-exists-p xemacs-build-report-installation-file)
	  (progn
	    (insert "> Contents of "
		    xemacs-build-report-installation-file
		    ":\n\n")
	    (if (featurep 'mime-setup)
		(progn
		  (mime-edit-insert-tag
		   "application"
		   "octet-stream" 
		   (concat
		    "\nContent-Disposition: attachment;"
		    " filename=\""
		    (file-name-nondirectory
		     xemacs-build-report-installation-file)
		    "\""))
		  (mime-edit-insert-binary-file
		   xemacs-build-report-installation-file
		   xemacs-build-report-file-encoding))
	      (insert-file-contents xemacs-build-report-installation-file)))
	(insert "> " xemacs-build-report-installation-file
		" does not exist!\n\n"))
      (goto-char report-begin))))

--Multipart_Mon_Aug_11_02:27:11_1997-1
Content-Type: text/plain; charset=US-ASCII


and here is part of the latest RCS history:


--Multipart_Mon_Aug_11_02:27:11_1997-1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

RCS file: /u/aichner/el/RCS/xemacs-build-report.el,v
Working file: xemacs-build-report.el
head: 1.23
branch:
locks: strict
access list:
symbolic names:
comment leader: "; "
keyword substitution: kv
total revisions: 23;	selected revisions: 23
description:
Emacs-Lisp module to create XEmacs Build Reports.
----------------------------
revision 1.23
date: 1997/08/11 00:15:15;  author: aichner;  state: Exp;  lines: +29 -17=

Using (mail ...) instead of (message-mail ...) which is only available
in Gnus.

Defaulting customizable variables from the new `blddir'
config-value-hash-table entry where appropriate.

Supporting TM and SEMI by aliasing TM symbols to SEMI symbols and
implementing against SEMI. This will only work if there are no
conceptual incompatibilities between TM and SEMI; e.g. function
argument order, count and usage.

Updated docstrings and file comments.
----------------------------
revision 1.22
date: 1997/08/05 10:58:14;  author: aichner;  state: Exp;  lines: +7 -9
Took out signature insertion. If the user like it s?he should set the
relevant message-mode variables.
Added advise to docstring of `xemacs-build-report-make-output-file'
how to run make to create mk.err.
----------------------------
revision 1.21
date: 1997/08/02 15:01:28;  author: aichner;  state: Exp;  lines: +4 -4
Taking the `car' of the 'srcdir slot in `config-value-hash-table'.
----------------------------
revision 1.20
date: 1997/07/30 20:22:10;  author: aichner;  state: Exp;  lines: +5 -4
Updated to use config.el which is new in emacs-version "20.3
\"Berlin\" XEmacs Lucid (beta15)". The config.el patch needs to be
installed for this module to work in `Berlin'.
----------------------------

Comments are welcome,

Adrian

-- =

                            Adrian Aichner
                        Applications Engineer
  Teradyne GmbH
  Semiconductor Test Group    Telephone +49/89/41861(0)-208
  Dingolfinger Stra=DFe 2       Fax       +49/89/41861-217
  D-81673 M=DCNCHEN             E-mail    aichner@ecf.teradyne.com

--Multipart_Mon_Aug_11_02:27:11_1997-1--

