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

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

Specifying plist requirements in defcustom?


From: jrwats
Subject: Specifying plist requirements in defcustom?
Date: Sun, 12 Oct 2008 13:46:34 -0700 (PDT)
User-agent: G2/1.0

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)))


reply via email to

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