all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Specifying plist requirements in defcustom?
@ 2008-10-12 20:46 jrwats
  2008-10-12 23:18 ` Lennart Borgman (gmail)
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: jrwats @ 2008-10-12 20:46 UTC (permalink / raw
  To: help-gnu-emacs

I want to have a customization type that is a list of symbols, and I
want those symbols to have certain plist requirements fulfilled.  Is
there a way to specify this kind of requirement like
(defcustom :type <complicated requirement goes here>)

I know you can have a plist type, but the true type of the customized
variable is '(repeat (symbol)).  And I want a certain plist for these
symbols.  For what it's worth, my plist is (branch <a string> drive <a
string> path <a string>).  As an example, here's how I set the
variable:


;; I'd like this to be defcustom
(defvar corext-enlistments nil
  "list of enlistments where each enlistment has a property list of:
branch, drive, and directory")

;;name (symbol - this is arbitrary), branch (string), drive (string),
path (string)
(corext-set-enlistments '((wcdeskcomm  "working.client.dekscomm"
"e:"  "e:\\wcdeskcomm")
                                         (wcdc
"working.client.dcplatform"  "e:"  "e:\\wcdc")))

(defun corext-set-enlistments (enlistment-list)
  (setq corext-enlistments
        (mapcar (lambda (arg-list)
                  (apply (lambda (new-enlistment pbranch pdrive ppath)
                           (setplist new-enlistment `(branch ,pbranch
drive ,pdrive path ,ppath))
                           new-enlistment)
                         arg-list))
        enlistment-list)))


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

end of thread, other threads:[~2008-10-15 17:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-12 20:46 Specifying plist requirements in defcustom? jrwats
2008-10-12 23:18 ` Lennart Borgman (gmail)
2008-10-13  1:31 ` Drew Adams
     [not found] ` <mailman.901.1223861517.25473.help-gnu-emacs@gnu.org>
2008-10-15 14:32   ` jrwats
2008-10-15 14:50     ` Drew Adams
2008-10-15 14:54       ` Lennart Borgman (gmail)
2008-10-15 15:41         ` Drew Adams
     [not found]         ` <mailman.1123.1224085332.25473.help-gnu-emacs@gnu.org>
2008-10-15 16:27           ` jrwats
2008-10-15 16:33             ` jrwats
2008-10-15 16:48               ` jrwats
2008-10-15 16:58             ` Drew Adams
     [not found]             ` <mailman.1126.1224089933.25473.help-gnu-emacs@gnu.org>
2008-10-15 17:43               ` jrwats

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.