unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* defcustom - help
@ 2011-08-03 14:57 Jambunathan K
  2011-08-04  3:39 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Jambunathan K @ 2011-08-03 14:57 UTC (permalink / raw)
  To: emacs-devel


There are two defcustoms - one for configuring a list of items and one
for choosing the preferred among those. Read ahead ...

1. Copy these two to scratch buffer and install them using C-x C-e.

(defcustom kjn--list-items
  '("a" "b" "c")
  "A list of items."
  :group 'kjn
  :type '(repeat (string :tag "Output format")))

(defcustom kjn--preferred-list-item "a"
  "Preferred item in the list."
  :group 'kjn
  :type `(choice (const :tag "None" nil)
		 ,@(mapcar (lambda (c)
		 	     `(const :tag ,c ,c))
		 	   kjn--list-items)))

2. M-x customize-variable RET kjn--preferred-list-item RET

   - Note that all the items "a", "b" and "c" are offered as a choice in
     drop-down list.

3. M-x customize-variable RET kjn--list-items RET
   
   and add an item "d" to the list. Save it for current session.

4. Now repeat step 2. Note that the newly added item doesn't show up in
   the dropdown list.

Can someone help me with achieving the desired behaviour in step 4. 

Jambunathan K.

-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-04  3:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-03 14:57 defcustom - help Jambunathan K
2011-08-04  3:39 ` Katsumi Yamaoka
2011-08-04  3:46   ` Katsumi Yamaoka

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).