(custom-toggle-hide): Allow hiding only if widget is saved.

This commit is contained in:
Chong Yidong 2008-08-19 01:49:04 +00:00
parent ca40134198
commit fdbdd068b1

View file

@ -2244,8 +2244,8 @@ and `face'."
"Toggle visibility of WIDGET."
(custom-load-widget widget)
(let ((state (widget-get widget :custom-state)))
(cond ((memq state '(invalid modified))
(error "There are unset changes"))
(cond ((memq state '(invalid modified set))
(error "There are unsaved changes"))
((eq state 'hidden)
(widget-put widget :custom-state 'unknown))
(t