From xemacs-m  Wed Jul 30 15:33:15 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 PAA10470
	for <xemacs-beta@xemacs.org>; Wed, 30 Jul 1997 15:33:13 -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 QAA28967; Wed, 30 Jul 1997 16:36:45 -0400 (EDT)
Received: from tomorrow.eng.ecf.teradyne.com. (tomorrow.ecf.teradyne.com [131.101.192.7]) by engine.ecf.teradyne.com (8.7.1/8.7.1) with SMTP id WAA20725; Wed, 30 Jul 1997 22:31:54 +0200 (MET DST)
Received: by tomorrow.eng.ecf.teradyne.com. (SMI-8.6/SMI-SVR4)
	id WAA11979; Wed, 30 Jul 1997 22:31:52 +0200
To: Jens-U H Petersen <petersen@kurims.kyoto-u.ac.jp>
Cc: xemacs-beta@xemacs.org
Subject: Re: How to determine build-dir within running XEmacs?
References: <rxszprrme68.fsf@ecf.teradyne.com> 	<199707131143.EAA02550@xemacs.eng.sun.com> 	<lbk9iu1hr1.fsf@boron.kurims.kyoto-u.ac.jp> 	<rxsg1th7mbn.fsf@midnight.ecf.teradyne.com> <199707150324.MAA21551@boron.kurims.kyoto-u.ac.jp>
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_Wed_Jul_30_22:31:52_1997-1"
Content-Transfer-Encoding: 7bit
From: Adrian Aichner <aichner@ecf.teradyne.com>
Date: 30 Jul 1997 22:31:52 +0200
In-Reply-To: Jens-U H Petersen's message of "Tue, 15 Jul 1997 12:24:44 +0900"
Message-ID: <rxszpr4e0xz.fsf@tomorrow.ecf.teradyne.com>
Lines: 293
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta15) - "Berlin"

--Multipart_Wed_Jul_30_22:31:52_1997-1
Content-Type: text/plain; charset=US-ASCII


Hello Jens,

if you want to give it a try with an updated version of
xemacs-build-report.el, here it is.


--Multipart_Wed_Jul_30_22:31:52_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.20 1997/07/30 20:22:10 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 message 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.20 $"
  "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 'srcdir (config-value-hash-table)) "/mk.err")
  "Filename where stdout and stderr of XEmacs make process has been stored."
  :group 'xemacs-build-report)

(defcustom xemacs-build-report-installation-file
  (concat (gethash 'srcdir (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 used to include files when the
feature `mime-setup' is available."
  :group 'xemacs-build-report)


(defun xemacs-create-build-report (&rest args)
  "Initializes a fresh message-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 message body. 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
    (message-mail
     xemacs-build-report-destination
     (apply 'format xemacs-build-report-subject args))
    (let ((report-begin (message-goto-body)))
      (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-editor/insert-tag
		   "application"
		   "octet-stream" 
		   (concat
		    "\nContent-Disposition: attachment;"
		    " filename=\""
		    (file-name-nondirectory
		     xemacs-build-report-make-output-file)
		    "\""))
		  (mime-editor/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-editor/insert-tag
		   "application"
		   "octet-stream" 
		   (concat
		    "\nContent-Disposition: attachment;"
		    " filename=\""
		    (file-name-nondirectory
		     xemacs-build-report-installation-file)
		    "\""))
		  (mime-editor/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"))
      (if (featurep 'mime-setup)
	  (progn
	    (goto-char (point-max))
	    (mime-editor/insert-signature)
	    )
	(message-insert-signature))
      (goto-char report-begin))))

--Multipart_Wed_Jul_30_22:31:52_1997-1
Content-Type: text/plain; charset=US-ASCII


It is updated to use config.el which became available in emacs-version 
"20.3 \"Berlin\" XEmacs  Lucid (beta15)". You'll have to apply SL
Baur's config.el patch for this version to work.

Please let me know how it works for you.

I'll include Steven's mail with the patch as well:


--Multipart_Wed_Jul_30_22:31:52_1997-1
Content-Type: message/rfc822

X-From-Line: xemacs-beta-request@xemacs.org Mon Jul 28 02:14 MET 1997
Resent-Date: Sun, 27 Jul 1997 19:12:59 -0500 (CDT)
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: How to determine build-dir within running XEmacs?
References: <rxszprrme68.fsf@ecf.teradyne.com> <199707131143.EAA02550@xemacs.eng.sun.com> <rxsyb6srtji.fsf@tomorrow.ecf.teradyne.com> <rxsvi1wm6ez.fsf@ecf.teradyne.com> <rxsbu3o2hbf.fsf@tomorrow.ecf.teradyne.com>
X-Face: `'%\i;ySOu]g?NlziJSk_$&@]KP`}~PEQPjZ5;nxSaDW_o$4+4%Ab]%Ifw3ZR;7TIT3,O,'
 @2{L;]ox6kc;$_5kU'n**9vFg-]eV~GbxSVCx|(s%uR[],*:^WKmC`B}(;|k9/m]gwt?&`t;^rfCJg
 khHH>pP1W\)xM0U@!FNDD72{3fDP$PkBhx^7Z?-WxH6DbFN:QOnT`llzW}VGdYv;n9lzljQvKTIBhQ
 YuV
X-Attribution: sb
From: SL Baur <steve@xemacs.org>
In-Reply-To: Adrian Aichner's message of "28 Jul 1997 01:42:12 +0200"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Date: 27 Jul 1997 17:16:41 -0700
Message-ID: <m2vi1w6nfa.fsf@altair.xemacs.org>
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta16) - "Budapest"
Resent-Message-ID: <"B4oVd2.0.Ts3.8G-sp"@xemacs>
Resent-From: xemacs-beta@xemacs.org
X-Mailing-List: <xemacs-beta@xemacs.org> archive/latest/11110
X-Loop: xemacs-beta@xemacs.org
Precedence: list
Resent-Sender: xemacs-beta-request@xemacs.org
Content-Type: text/plain; charset=US-ASCII
X-Content-Length: 1394
Lines: 44

Adrian Aichner <aichner@ecf.teradyne.com> writes:

> (require 'config)

> (find-file config-value-file)

> (maphash (lambda (k v) (insert (format "%s = %s\n" k v))) (config-value-hash-table))

> (gethash 'srcdir (config-value-hash-table))

Yielding the unuseful result srcdir, $srcdir.  I see two places where
srcdir occurs in the config.values file and only the first one is
useful.  Does the following patch to config.el make things work a
little better?  Is this The Right Thing to do?

At least I get "/b/XEmacs/xemacs-20.0" now (which is correct for where 
I'm building).

1997-07-27  SL Baur  <steve@altair.xemacs.org>

	* utils/config.el (config-value-hash-table): Only store the first
	occurrence of a symbol.

Index: lisp/utils/config.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/utils/config.el,v
retrieving revision 1.1
diff -u -r1.1 config.el
--- config.el	1997/07/19 22:19:14	1.1
+++ config.el	1997/07/28 00:11:27
@@ -48,7 +48,10 @@
 	(goto-char (point-min))
 	(condition-case nil
 	    (while t
-	      (puthash (read buf) (read buf) config-value-hash-table))
+	      (let* ((key (read buf))
+		     (value (read buf)))
+		(unless (gethash key config-value-hash-table)
+		  (puthash key value config-value-hash-table))))
 	  (end-of-file nil)))
       (kill-buffer " *Config*")))
   config-value-hash-table)



Cheers,

Adrian

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

--Multipart_Wed_Jul_30_22:31:52_1997-1--

