From xemacs-m  Tue Apr 15 19:02:05 1997
Received: from greatdane.webnexus.com (greatdane.webnexus.com [165.227.96.3])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA04472
	for <xemacs-beta@xemacs.org>; Tue, 15 Apr 1997 19:02:04 -0500 (CDT)
Received: from apprentice.silicon-sorcery.com (apprentice.silicon-sorcery.com [205.179.145.161])
	by greatdane.webnexus.com (8.8.5/8.8.5/WN-1.2) with ESMTP id RAA05414
	for <xemacs-beta@xemacs.org>; Tue, 15 Apr 1997 17:02:03 -0700 (PDT)
Received: from mage.silicon-sorcery.com (mage [128.0.0.100]) by apprentice.silicon-sorcery.com (8.7.5/8.7.3) with ESMTP id QAA23152; Tue, 15 Apr 1997 16:58:42 -0700 (PDT)
Received: (from mac@localhost)
	by mage.silicon-sorcery.com (8.8.5/8.8.5) id QAA04140;
	Tue, 15 Apr 1997 16:59:47 -0700 (PDT)
Date: Tue, 15 Apr 1997 16:59:47 -0700 (PDT)
Message-Id: <199704152359.QAA04140@mage.silicon-sorcery.com>
From: <mac@silicon-sorcery.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: xemacs-beta@xemacs.org
Subject: RFC on how to add link to custom in a mode's menubar
X-Mailer: VM 6.23 under 20.1 XEmacs Lucid (beta11)
Reply-To: mac@silicon-sorcery.com
X-Face:  h&j3qWe;+!`nKY~1T%IspQ[^}[s#|*2T68-NmG<hqK)^/6IlKy[e$tI,N'{!_v&R_m*f#8O
 au_+w3/b!3pF$H/]J(Q6Z)*:&Jy/.OGPM?7*<kyi}r/3Pf3hd[(J+%lmXp/;0e-EY_s2Dy{M|t



In my verilog-mode.el (which I'm going to release real soon) I include
support for custom, using the following hacks to make it co-exist
peacefully with emacsen which have no departments of commerce...

Of course this is based on the famous example set in w3/w3-cus.el, and
what I am looking for is comments on this as perhaps the suggested
style for all modes to perform. The new bit is defmacro'ing custom to
a function that says we don't have custom installed in this version of
emacs; this allows me to stick things in the menubar which essentially
encourage folks to upgrade!


;; Allow use of one syntax to support custom based option settings, as 
;; well as defvar and the like.
;;
(eval-and-compile
  (condition-case ()
      (require 'custom)
    (error nil))
  (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
      nil ;; We've got what we needed
    ;; We have the old custom-library, hack around it!
    (defmacro defgroup (&rest args)
      nil)
    (defmacro customize (&rest args)
      (message "Sorry, Customize is not available with this version of emacs"))
    (defmacro defcustom (var value doc &rest args) 
      (` (defvar (, var) (, value) (, doc))))))

(defun verilog-customize ()
  "Link to customize screen for Verilog"
  (interactive)
  (customize 'verilog-mode)
  )

(defgroup verilog-mode nil
  "Faciliates easy editing of Verilog source text"
  :group 'languages)
      
(defcustom verilog-indent-level 3
  "*Indentation of Verilog statements with respect to containing block."
  :group 'verilog-mode
  :type 'integer 
  )

	...
And later:

    (defvar verilog-xemacs-menu
      '("Verilog"
	...
	["Customize Verilog Mode..." verilog-customize t]
	"XEmacs menu for VERILOG mode."))
	

