From xemacs-m  Thu Feb 13 11:19:53 1997
Received: from mgate2.uni-hannover.de (mgate2.uni-hannover.de [130.75.2.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id LAA01355
	for <xemacs-beta@xemacs.org>; Thu, 13 Feb 1997 11:19:51 -0600 (CST)
Received: from helios (actually helios.tnt.uni-hannover.de) 
          by mgate2.uni-hannover.de with SMTP (PP);
          Thu, 13 Feb 1997 18:21:05 +0100
Received: from daedalus.tnt.uni-hannover.de by helios (SMI-8.6/SMI-SVR4) 
          id SAA09394; Thu, 13 Feb 1997 18:18:18 +0100
Received: by daedalus.tnt.uni-hannover.de (SMI-8.6/SMI-SVR4) id SAA17422;
          Thu, 13 Feb 1997 18:18:17 +0100
Date: Thu, 13 Feb 1997 18:18:17 +0100
Message-Id: <199702131718.SAA17422@daedalus.tnt.uni-hannover.de>
From: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
To: jmiller@bay1.bayserve.net
Cc: xemacs-beta@xemacs.org
Subject: Re: grr, need help on menus.
In-Reply-To: <Pine.SUN.3.95.970212202355.22062E-100000@bay1.bayserve.net>
References: <199702121053.LAA14541@daedalus.tnt.uni-hannover.de> <Pine.SUN.3.95.970212202355.22062E-100000@bay1.bayserve.net>
X-Face: n}R'l6CHRf>pi&bj7[x0CW3:kmXm@1)7m+l*9[fp;-Ow4Xe~=5E;skf?2> 
        y]f{HzB|Q(\V9+y$PP~.4G[2n4W7{6Ilm[AMY9B:0kj.K_$-d%p4YIF*bX;=ADp6{ 
        HS@NEv9c.VII+9PgXHASx}K(jy^t=q%qzZ72q1e4E;O!$A$`&wgtLk"1%p.nC_G!] 
        4d1!+J4Q#YD_iXeEy`1x)d\r$1Qn\'23n|[8Y_xzuXJJ7W(EGqnzB]`]aq??;+z=) 
        DW~\'Vq&F'g%QU[Mv2:}nS>SdZFTEC2GsgB=Q,:~H<R5S[:ZN%B:s0;|v1x"Jb
Mime-Version: 1.0 (generated by tm-edit 7.90)
Content-Type: text/plain; charset=US-ASCII

>>>>> "Jeff" == Jeff Miller <jmiller@bay1.bayserve.net> writes:


    Jeff> Loading mule-init...  Loading gui...  Loading mode-motion...
    Jeff> Loading mouse...  Loading x-menubar...*** Error in XEmacs
    Jeff> initialization (error "menu name (first element) must be a
    Jeff> string" (cons "Select Printer" (mapcar (quote (lambda
    Jeff> (printer) (vector (car printer) (list (quote
    Jeff> hm-select-new-ps-printer) (car printer)) :style (quote
    Jeff> radio) :selected (list (quote string=) (quote
    Jeff> hm-current-ps-printer) (car printer)))))
    Jeff> hm-ps-printer-alist))) *** Backtrace
    Jeff> really-early-error-handler((error "menu name (first element)
    Jeff> must be a string" (cons "Select Printer" (mapcar
    Jeff> ... hm-ps-printer-alist)))) signal(error ("menu name (first
    Jeff> element) must be a string" (cons "Select Printer" (mapcar
    Jeff> ... hm-ps-printer-alist)))) # bind (menubar-p menu)
    Jeff> check-menu-syntax((cons "Select Printer" (mapcar (quote ...)
    Jeff> hm-ps-printer-alist))) # bind (menuitem item menubar-p menu)
    Jeff> check-menu-syntax(("Printing Options" ["Command-Line
    Jeff> Switches for `lpr'/`lp'..." (setq lpr-switches ...) t] (cons
    Jeff> "Select Printer" (mapcar ... hm-ps-printer-alist))
    Jeff> ["Pretty-Print With Color" (setq ps-print-color-p ...)
    Jeff> :style toggle :selected ps-print-color-p] ("Pretty-Print
    Jeff> Paper Size" ["Letter" ... :style radio :selected ...]
    Jeff> ["Letter-small" ... :style radio :selected ...] ["Legal"
    Jeff> ... :style

I think, that your mistake is to use something like
      ("Printing Options"
       ["Command-Line Switches for `lpr'/`lp'..."
	(setq lpr-switches
	      (read-expression "Switches for `lpr'/`lp': "
			       (format "%S" lpr-switches)))
	t]
;; stelen from Heiko Muenkel
      (cons    
       "Select Printer" 
	(mapcar '(lambda (printer)
		   (vector (car printer)
			   (list 'hm-select-new-ps-printer 
				 (car printer))
			   :style 'radio
			   :selected (list 'string= 
					   'hm-current-ps-printer 
					   (car printer))))
		hm-ps-printer-alist)
	)

as the menu, but you must use it to build the menu! So you've to write
something like:

(add-submenu '("Options")
	     (list "Printing Options"
		   ["Command-Line Switches for `lpr'/`lp'..."
		    (setq lpr-switches
			  (read-expression "Switches for `lpr'/`lp': "
					   (format "%S" lpr-switches)))
		    t]
		   (cons    
		    "Select Printer" 
		    (mapcar '(lambda (printer)
			       (vector (car printer)
				       (list 'hm-select-new-ps-printer 
					     (car printer))
				       :style 'radio
				       :selected (list 'string= 
							 'hm-current-ps-printer 
							 (car printer))))
			    hm-ps-printer-alist)
		    )))

