;;; eieio-custom.el -- eieio object customization
-;;; Copyright (C) 1999, 2000, 2001, 2005, 2007, 2008, 2009
-;;; Free Software Foundation, Inc.
+;; Copyright (C) 1999-2001, 2005, 2007-2012 Free Software Foundation, Inc.
-;; Author: Eric M. Ludlam <zappo@gnu.org>
+;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Version: 0.2
;; Keywords: OO, lisp
+;; Package: eieio
;; This file is part of GNU Emacs.
;;; Commentary:
;;
;; This contains support customization of eieio objects. Enabling
-;; your object to be customizable requires use of the slot attirbute
+;; your object to be customizable requires use of the slot attribute
;; `:custom'.
(require 'eieio)
(require 'custom)
;;; Compatibility
-;;
-(eval-and-compile
- (if (featurep 'xemacs)
- (defalias 'eieio-overlay-lists (lambda () (list (extent-list))))
- (defalias 'eieio-overlay-lists 'overlay-lists)
- )
- )
+
+;; (eval-and-compile
+;; (if (featurep 'xemacs)
+;; (defalias 'eieio-overlay-lists (lambda () (list (extent-list))))
+;; (defalias 'eieio-overlay-lists 'overlay-lists)))
+
;;; Code:
(defclass eieio-widget-test-class nil
((a-string :initarg :a-string
(defvar eieio-cog nil
"Buffer local variable in object customize buffers for the current group.")
- (defvar eieio-custom-ignore-eieio-co nil
+ (defvar eieio-custom-ignore-eieio-co nil
"When true, all customizable slots of the current object are updated.
Updates occur regardless of the current customization group.")
(defun eieio-slot-value-create (widget)
"Create the value of WIDGET."
- (let ((chil nil)
- )
-; (setq chil (cons (widget-create-child-and-convert
-; widget 'visibility
-; :help-echo "Hide the value of this option."
-; :action 'eieio-custom-toggle-parent
-; t)
-; chil))
+ (let ((chil nil))
(setq chil (cons
(widget-create-child-and-convert
widget (widget-get widget :childtype)
(when (and (car fcust)
(or (not master-group) (member master-group (car fgroup)))
(slot-boundp obj (car slots)))
- ;; In this case, this slot has a custom type. Create it's
+ ;; In this case, this slot has a custom type. Create its
;; children widgets.
(let ((type (eieio-filter-slot-type widget (car fcust)))
(stuff nil))
obj))
(defmethod eieio-done-customizing ((obj eieio-default-superclass))
- "When a applying change to a widget, call this method.
-This method is called by the default widget-edit commands. User made
-commands should also call this method when applying changes.
+ "When applying change to a widget, call this method.
+This method is called by the default widget-edit commands.
+User made commands should also call this method when applying changes.
Argument OBJ is the object that has been customized."
nil)
+;;;###autoload
(defun customize-object (obj &optional group)
"Customize OBJ in a custom buffer.
Optional argument GROUP is the sub-group of slots to display."
(toggle-read-only -1)
(kill-all-local-variables)
(erase-buffer)
- (let ((all (eieio-overlay-lists)))
+ (let ((all (overlay-lists)))
;; Delete all the overlays.
(mapc 'delete-overlay (car all))
(mapc 'delete-overlay (cdr all)))
(defmethod eieio-custom-object-apply-reset ((obj eieio-default-superclass))
"Insert an Apply and Reset button into the object editor.
-Argument OBJ os the object being customized."
+Argument OBJ is the object being customized."
(widget-create 'push-button
:notify (lambda (&rest ignore)
(widget-apply eieio-wo :value-get)
(widget-create 'push-button
:notify (lambda (&rest ignore)
;; I think the act of getting it sets
- ;; it's value through the get function.
+ ;; its value through the get function.
(message "Applying Changes...")
(widget-apply eieio-wo :value-get)
(eieio-done-customizing eieio-co)
- (message "Applying Changes...Done."))
+ (message "Applying Changes...Done"))
"Apply")
(widget-insert " ")
(widget-create 'push-button
:notify (lambda (&rest ignore)
- (message "Resetting.")
+ (message "Resetting")
(eieio-customize-object eieio-co eieio-cog))
"Reset")
(widget-insert " ")
(provide 'eieio-custom)
+;; Local variables:
+;; generated-autoload-file: "eieio.el"
+;; End:
+
;;; eieio-custom.el ends here