help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabling customization items


From: Kevin Rodgers
Subject: Re: Disabling customization items
Date: Mon, 18 Aug 2003 10:54:24 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Bill Wohler wrote:

How does one disable items in the customization interface?

Let's say I have the option foo with three features "a", "b", or "c".

    (defcustom foo "a" nil
      :type '(choice (const "a")
                     (const "b")
                     (const "c")))

Let's say feature "b" is not available on a system. I'd like to indicate that
that item is supported by my code, but not by the system. Thus, choice "b"
should be disabled.

Thus customization interface in 21.2 doesn't appear to support this. Has
anyone figured out how to do this?

It's not dynamic, but it should be good enough for the situation you've 
described:


(defcustom foo "a" nil
  :type `(choice (const "a")
                 ,@(if (featurep 'b) (list '(const "b")))
                 (const "c")))

--
Kevin Rodgers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]