~vm/vm/before-save-hook

« back to all changes in this revision

Viewing changes to lisp/vm-pcrisis.el

  • Committer: Uday S Reddy
  • Date: 2012-12-19 02:09:17 UTC
  • mfrom: (1465.1.3 trunk)
  • Revision ID: u.s.reddy@cs.bham.ac.uk-20121219020917-daz9udq72h576lzi
Merged back into the current branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
(defcustom vmpc-conditions ()
87
87
  "*List of conditions which will be checked by pcrisis."
 
88
  :type '(repeat (list (choice :tag "Condition name"
 
89
                               (symbol) (string))
 
90
                       (sexp :tag "Condition")))
88
91
  :group 'vmpc)
89
92
 
90
93
(defcustom vmpc-actions ()
98
101
features of Personality Crisis, or the `vmpc-prompt-for-profile' action.
99
102
 
100
103
You may also define an action without associated commands, e.g. \"none\"."
101
 
  :type '(repeat (list (string :tag "Action name")
102
 
                       (sexp :tag "Commands")))
 
104
  :type '(repeat (cons (choice :tag "Action name"
 
105
                               (symbol) (string))
 
106
                       (repeat :tag "Commands" sexp)))
103
107
  :group 'vmpc)
104
108
 
105
109
(defun vmpc-alist-set (symbol value)
117
121
    (setq value (cdr value)))
118
122
  (set symbol value))
119
123
 
 
124
;; (defun vmpc-defcustom-alist-type ()
 
125
;;   "Generate :type for vmpc-*-alist variables."
 
126
;;   (list 'repeat
 
127
;;         (list 'cons
 
128
;;               (append '(choice :tag "Condition")
 
129
;;                       (mapcar (lambda (c) (list 'const (car c))) vmpc-conditions)
 
130
;;                       '((string)))
 
131
;;               (list 'repeat :tag "Actions to run"
 
132
;;                     (append '(choice :tag "Action")
 
133
;;                             (mapcar (lambda (a) (list 'const (car a))) vmpc-actions)
 
134
;;                             '(string))))))
 
135
 
120
136
(defun vmpc-defcustom-alist-type ()
121
137
  "Generate :type for vmpc-*-alist variables."
122
 
  (list 'repeat
123
 
        (list 'list 
124
 
              (append '(choice :tag "Condition")
125
 
                      (mapcar (lambda (c) (list 'const (car c))) vmpc-conditions)
126
 
                      '((string)))
127
 
              (list 'repeat :tag "Actions to run"
128
 
                    (append '(choice :tag "Action")
129
 
                            (mapcar (lambda (a) (list 'const (car a))) vmpc-actions)
130
 
                            '(string))))))
 
138
  `(repeat
 
139
    (cons
 
140
     (choice :tag "Condition"
 
141
             ,@(mapcar (lambda (c) `(const ,(car c))) vmpc-conditions)
 
142
             (string))
 
143
     (repeat :tag "Actions to run"
 
144
             (choice :tag "Action"
 
145
                     ,@(mapcar (lambda (a) `(const ,(car a))) vmpc-actions)
 
146
                     (string))))))
131
147
 
132
148
(defcustom vmpc-actions-alist ()
133
149
  "*An alist associating conditions with actions from `vmpc-actions'.