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

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

bug#15479: Feature request: defcustom inherit type


From: Devin Homan
Subject: bug#15479: Feature request: defcustom inherit type
Date: Fri, 27 Sep 2013 22:20:03 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 SeaMonkey/2.20

I think that it would be useful for client code to be able to create defcustom 
variables that
inherit their type properties from another defcustom variable so that changes 
in the provided code
are reflected in the client.  This would allow client code to create 
defcustom's that are used as
temporary, dynamic bindings that the user can customize without having to worry 
about additions to
the accepted types in the provided code.

For example, in the provided source there is:

(defcustom foo-bar "A" "Doc." :group foo :type '(string))

(defun foo-smash () "Doc." (message "%s" foo-bar))

(provide 'foo)

then the client code can have:

(require 'foo)

(defcustom cat-thing1 "B" "Doc." :group cat :type '(inherit foo-bar))

(defcustom cat-thing2 "C" "Doc." :group cat :type '(inherit foo-bar))

(let ((foo-bar cat-thing1)) (foo-smash))

(let ((foo-bar cat-thing2)) (foo-smash))

So if the maintainer of 'foo' decides to add an additional type, such as 
integer, then that change
will automatically be shown in 'cat'.





reply via email to

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