Mercurial > emacs
comparison lisp/cus-edit.el @ 97546:57c9b0f7df3e
(custom-toggle-hide): Allow hiding only if widget is saved.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Tue, 19 Aug 2008 01:49:04 +0000 |
parents | cc5f94eeb1d8 |
children | 8038a4df451c |
comparison
equal
deleted
inserted
replaced
97545:b24a1581ac16 | 97546:57c9b0f7df3e |
---|---|
2242 | 2242 |
2243 (defun custom-toggle-hide (widget) | 2243 (defun custom-toggle-hide (widget) |
2244 "Toggle visibility of WIDGET." | 2244 "Toggle visibility of WIDGET." |
2245 (custom-load-widget widget) | 2245 (custom-load-widget widget) |
2246 (let ((state (widget-get widget :custom-state))) | 2246 (let ((state (widget-get widget :custom-state))) |
2247 (cond ((memq state '(invalid modified)) | 2247 (cond ((memq state '(invalid modified set)) |
2248 (error "There are unset changes")) | 2248 (error "There are unsaved changes")) |
2249 ((eq state 'hidden) | 2249 ((eq state 'hidden) |
2250 (widget-put widget :custom-state 'unknown)) | 2250 (widget-put widget :custom-state 'unknown)) |
2251 (t | 2251 (t |
2252 (widget-put widget :documentation-shown nil) | 2252 (widget-put widget :documentation-shown nil) |
2253 (widget-put widget :custom-state 'hidden))) | 2253 (widget-put widget :custom-state 'hidden))) |