Mercurial > emacs
comparison lisp/emacs-lisp/eieio-custom.el @ 105474:0a64442c10e3
Fix typos.
* emacs-lisp/chart.el, emacs-lisp/eieio.el, emacs-lisp/eieio-base.el
* emacs-lisp/eieio-comp.el, emacs-lisp/eieio-custom.el
* emacs-lisp/eieio-datadebug.el, emacs-lisp/eieio-opt.el
* emacs-lisp/eieio-speedbar.el
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 05 Oct 2009 15:32:08 +0000 |
parents | 7f4c7f5c0eba |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
105473:07f6674a0832 | 105474:0a64442c10e3 |
---|---|
88 (defvar eieio-co nil | 88 (defvar eieio-co nil |
89 "Buffer local variable in object customize buffers for the current obj.") | 89 "Buffer local variable in object customize buffers for the current obj.") |
90 (defvar eieio-cog nil | 90 (defvar eieio-cog nil |
91 "Buffer local variable in object customize buffers for the current group.") | 91 "Buffer local variable in object customize buffers for the current group.") |
92 | 92 |
93 (defvar eieio-custom-ignore-eieio-co nil | 93 (defvar eieio-custom-ignore-eieio-co nil |
94 "When true, all customizable slots of the current object are updated. | 94 "When true, all customizable slots of the current object are updated. |
95 Updates occur regardless of the current customization group.") | 95 Updates occur regardless of the current customization group.") |
96 | 96 |
97 (define-widget 'object-slot 'group | 97 (define-widget 'object-slot 'group |
98 "Abstractly modify a single slot in an object." | 98 "Abstractly modify a single slot in an object." |
225 (while slots | 225 (while slots |
226 ;; Output this slot if it has a customize flag associated with it. | 226 ;; Output this slot if it has a customize flag associated with it. |
227 (when (and (car fcust) | 227 (when (and (car fcust) |
228 (or (not master-group) (member master-group (car fgroup))) | 228 (or (not master-group) (member master-group (car fgroup))) |
229 (slot-boundp obj (car slots))) | 229 (slot-boundp obj (car slots))) |
230 ;; In this case, this slot has a custom type. Create it's | 230 ;; In this case, this slot has a custom type. Create its |
231 ;; children widgets. | 231 ;; children widgets. |
232 (let ((type (eieio-filter-slot-type widget (car fcust))) | 232 (let ((type (eieio-filter-slot-type widget (car fcust))) |
233 (stuff nil)) | 233 (stuff nil)) |
234 ;; This next bit is an evil hack to get some EDE functions | 234 ;; This next bit is an evil hack to get some EDE functions |
235 ;; working the way I like. | 235 ;; working the way I like. |
318 (if name (aset obj object-name name)) | 318 (if name (aset obj object-name name)) |
319 ;; This is the same object we had before. | 319 ;; This is the same object we had before. |
320 obj)) | 320 obj)) |
321 | 321 |
322 (defmethod eieio-done-customizing ((obj eieio-default-superclass)) | 322 (defmethod eieio-done-customizing ((obj eieio-default-superclass)) |
323 "When a applying change to a widget, call this method. | 323 "When applying change to a widget, call this method. |
324 This method is called by the default widget-edit commands. User made | 324 This method is called by the default widget-edit commands. |
325 commands should also call this method when applying changes. | 325 User made commands should also call this method when applying changes. |
326 Argument OBJ is the object that has been customized." | 326 Argument OBJ is the object that has been customized." |
327 nil) | 327 nil) |
328 | 328 |
329 (defun customize-object (obj &optional group) | 329 (defun customize-object (obj &optional group) |
330 "Customize OBJ in a custom buffer. | 330 "Customize OBJ in a custom buffer. |
372 (make-local-variable 'eieio-cog) | 372 (make-local-variable 'eieio-cog) |
373 (setq eieio-cog group))) | 373 (setq eieio-cog group))) |
374 | 374 |
375 (defmethod eieio-custom-object-apply-reset ((obj eieio-default-superclass)) | 375 (defmethod eieio-custom-object-apply-reset ((obj eieio-default-superclass)) |
376 "Insert an Apply and Reset button into the object editor. | 376 "Insert an Apply and Reset button into the object editor. |
377 Argument OBJ os the object being customized." | 377 Argument OBJ is the object being customized." |
378 (widget-create 'push-button | 378 (widget-create 'push-button |
379 :notify (lambda (&rest ignore) | 379 :notify (lambda (&rest ignore) |
380 (widget-apply eieio-wo :value-get) | 380 (widget-apply eieio-wo :value-get) |
381 (eieio-done-customizing eieio-co) | 381 (eieio-done-customizing eieio-co) |
382 (bury-buffer)) | 382 (bury-buffer)) |
383 "Accept") | 383 "Accept") |
384 (widget-insert " ") | 384 (widget-insert " ") |
385 (widget-create 'push-button | 385 (widget-create 'push-button |
386 :notify (lambda (&rest ignore) | 386 :notify (lambda (&rest ignore) |
387 ;; I think the act of getting it sets | 387 ;; I think the act of getting it sets |
388 ;; it's value through the get function. | 388 ;; its value through the get function. |
389 (message "Applying Changes...") | 389 (message "Applying Changes...") |
390 (widget-apply eieio-wo :value-get) | 390 (widget-apply eieio-wo :value-get) |
391 (eieio-done-customizing eieio-co) | 391 (eieio-done-customizing eieio-co) |
392 (message "Applying Changes...Done.")) | 392 (message "Applying Changes...Done")) |
393 "Apply") | 393 "Apply") |
394 (widget-insert " ") | 394 (widget-insert " ") |
395 (widget-create 'push-button | 395 (widget-create 'push-button |
396 :notify (lambda (&rest ignore) | 396 :notify (lambda (&rest ignore) |
397 (message "Resetting.") | 397 (message "Resetting") |
398 (eieio-customize-object eieio-co eieio-cog)) | 398 (eieio-customize-object eieio-co eieio-cog)) |
399 "Reset") | 399 "Reset") |
400 (widget-insert " ") | 400 (widget-insert " ") |
401 (widget-create 'push-button | 401 (widget-create 'push-button |
402 :notify (lambda (&rest ignore) | 402 :notify (lambda (&rest ignore) |