comparison lisp/custom.el @ 5383:294ab9180fad

#'custom-add-to-group: warn if GROUP is nil. 2011-03-24 Aidan Kehoe <kehoea@parhasard.net> * custom.el (custom-add-to-group): Warn if adding an option to the nil group; this is usually an error on the part of the programmer. * cmdloop.el (suggest-key-bindings): Specify a group for this variable, it didn't previously have one.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 24 Mar 2011 06:22:25 +0000
parents b6e59ea11533
children 4dee0387b9de
comparison
equal deleted inserted replaced
5382:d363790fd936 5383:294ab9180fad
407 "Hash-table of non-empty groups.") 407 "Hash-table of non-empty groups.")
408 408
409 (defun custom-add-to-group (group option widget) 409 (defun custom-add-to-group (group option widget)
410 "To existing GROUP add a new OPTION of type WIDGET. 410 "To existing GROUP add a new OPTION of type WIDGET.
411 If there already is an entry for OPTION and WIDGET, nothing is done." 411 If there already is an entry for OPTION and WIDGET, nothing is done."
412 (or group (display-warning 'custom
413 (format "custom: widget %s, option %s has no associated group"
414 widget option)))
412 (let ((members (get group 'custom-group)) 415 (let ((members (get group 'custom-group))
413 (entry (list option widget))) 416 (entry (list option widget)))
414 (unless (member entry members) 417 (unless (member entry members)
415 (put group 'custom-group (nconc members (list entry))))) 418 (put group 'custom-group (nconc members (list entry)))))
416 (puthash group t custom-group-hash-table)) 419 (puthash group t custom-group-hash-table))