-;;; eieio-custom.el -- eieio object customization
+;;; eieio-custom.el -- eieio object customization -*- lexical-binding:t -*-
-;; Copyright (C) 1999-2001, 2005, 2007-2013 Free Software Foundation,
+;; Copyright (C) 1999-2001, 2005, 2007-2015 Free Software Foundation,
;; Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
-;; Version: 0.2
+;; Old-Version: 0.2 (using "Version:" made Emacs think this is package
+;; eieio-0.2).
;; Keywords: OO, lisp
;; Package: eieio
:documentation "A number of thingies."))
"A class for testing the widget on.")
-(defcustom eieio-widget-test (eieio-widget-test-class "Foo")
+(defcustom eieio-widget-test (eieio-widget-test-class)
"Test variable for editing an object."
:type 'object
:group 'eieio)
))
(widget-value-set vc (widget-value vc))))
-(defun eieio-custom-toggle-parent (widget &rest ignore)
+(defun eieio-custom-toggle-parent (widget &rest _)
"Toggle visibility of parent of WIDGET.
Optional argument IGNORE is an extraneous parameter."
(eieio-custom-toggle-hide (widget-get widget :parent)))
:clone-object-children nil
)
-(defun eieio-object-match (widget value)
+(defun eieio-object-match (_widget _value)
"Match info for WIDGET against VALUE."
;; Write me
t)
(let* ((chil nil)
(obj (widget-get widget :value))
(master-group (widget-get widget :eieio-group))
- (cv (class-v (object-class-fast obj)))
- (slots (aref cv class-public-a))
- (flabel (aref cv class-public-custom-label))
- (fgroup (aref cv class-public-custom-group))
- (fdoc (aref cv class-public-doc))
- (fcust (aref cv class-public-custom)))
+ (cv (eieio--object-class-object obj))
+ (slots (eieio--class-public-a cv))
+ (flabel (eieio--class-public-custom-label cv))
+ (fgroup (eieio--class-public-custom-group cv))
+ (fdoc (eieio--class-public-doc cv))
+ (fcust (eieio--class-public-custom cv)))
;; First line describes the object, but may not editable.
(if (widget-get widget :eieio-show-name)
(setq chil (cons (widget-create-child-and-convert
widget 'string :tag "Object "
:sample-face 'bold
- (object-name-string obj))
+ (eieio-object-name-string obj))
chil)))
;; Display information about the group being shown
(when master-group
- (let ((groups (class-option (object-class-fast obj) :custom-groups)))
+ (let ((groups (eieio--class-option (eieio--object-class-object obj)
+ :custom-groups)))
(widget-insert "Groups:")
(while groups
(widget-insert " ")
(widget-insert "*" (capitalize (symbol-name master-group)) "*")
(widget-create 'push-button
:thing (cons obj (car groups))
- :notify (lambda (widget &rest stuff)
+ :notify (lambda (widget &rest _)
(eieio-customize-object
(car (widget-get widget :thing))
(cdr (widget-get widget :thing))))
(car flabel)
(let ((s (symbol-name
(or
- (class-slot-initarg
- (object-class-fast obj)
+ (eieio--class-slot-initarg
+ (eieio--object-class-object obj)
(car slots))
(car slots)))))
(capitalize
"Get the value of WIDGET."
(let* ((obj (widget-get widget :value))
(master-group eieio-cog)
- (cv (class-v (object-class-fast obj)))
- (fgroup (aref cv class-public-custom-group))
+ (cv (eieio--object-class-object obj))
+ (fgroup (eieio--class-public-custom-group cv))
(wids (widget-get widget :children))
(name (if (widget-get widget :eieio-show-name)
(car (widget-apply (car wids) :value-inline))
nil))
(chil (if (widget-get widget :eieio-show-name)
(nthcdr 1 wids) wids))
- (cv (class-v (object-class-fast obj)))
- (slots (aref cv class-public-a))
- (fcust (aref cv class-public-custom)))
+ (cv (eieio--object-class-object obj))
+ (slots (eieio--class-public-a cv))
+ (fcust (eieio--class-public-custom cv)))
;; If there are any prefix widgets, clear them.
;; -- None yet
;; Create a batch of initargs for each slot.
fgroup (cdr fgroup)
fcust (cdr fcust)))
;; Set any name updates on it.
- (if name (aset obj object-name name))
+ (if name (eieio-object-set-name-string obj name))
;; This is the same object we had before.
obj))
-(defmethod eieio-done-customizing ((obj eieio-default-superclass))
+(defmethod eieio-done-customizing ((_obj eieio-default-superclass))
"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.
(let* ((g (or group 'default)))
(switch-to-buffer (get-buffer-create
(concat "*CUSTOMIZE "
- (object-name obj) " "
+ (eieio-object-name obj) " "
(symbol-name g) "*")))
(setq buffer-read-only nil)
(kill-all-local-variables)
;; Add an apply reset option at the top of the buffer.
(eieio-custom-object-apply-reset obj)
(widget-insert "\n\n")
- (widget-insert "Edit object " (object-name obj) "\n\n")
+ (widget-insert "Edit object " (eieio-object-name obj) "\n\n")
;; Create the widget editing the object.
(make-local-variable 'eieio-wo)
(setq eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
(make-local-variable 'eieio-co)
(setq eieio-co obj)
(make-local-variable 'eieio-cog)
- (setq eieio-cog group)))
+ (setq eieio-cog g)))
-(defmethod eieio-custom-object-apply-reset ((obj eieio-default-superclass))
+(defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass))
"Insert an Apply and Reset button into the object editor.
Argument OBJ is the object being customized."
(widget-create 'push-button
- :notify (lambda (&rest ignore)
+ :notify (lambda (&rest _)
(widget-apply eieio-wo :value-get)
(eieio-done-customizing eieio-co)
(bury-buffer))
"Accept")
(widget-insert " ")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
+ :notify (lambda (&rest _)
;; I think the act of getting it sets
;; its value through the get function.
(message "Applying Changes...")
"Apply")
(widget-insert " ")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
+ :notify (lambda (&rest _)
(message "Resetting")
(eieio-customize-object eieio-co eieio-cog))
"Reset")
(widget-insert " ")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
+ :notify (lambda (&rest _)
(bury-buffer))
"Cancel"))
:clone-object-children t
)
-(defun eieio-object-value-to-abstract (widget value)
+(defun eieio-object-value-to-abstract (_widget value)
"For WIDGET, convert VALUE to an abstract /safe/ representation."
- (if (eieio-object-p value) value
- (if (null value) value
- nil)))
+ (if (eieio-object-p value) value))
-(defun eieio-object-abstract-to-value (widget value)
+(defun eieio-object-abstract-to-value (_widget value)
"For WIDGET, convert VALUE from an abstract /safe/ representation."
value)
(vector (concat "Group " (symbol-name group))
(list 'customize-object obj (list 'quote group))
t))
- (class-option (object-class-fast obj) :custom-groups)))
+ (eieio--class-option (eieio--object-class-object obj) :custom-groups)))
(defvar eieio-read-custom-group-history nil
"History for the custom group reader.")
(defmethod eieio-read-customization-group ((obj eieio-default-superclass))
"Do a completing read on the name of a customization group in OBJ.
Return the symbol for the group, or nil"
- (let ((g (class-option (object-class-fast obj) :custom-groups)))
+ (let ((g (eieio--class-option (eieio--object-class-object obj)
+ :custom-groups)))
(if (= (length g) 1)
(car g)
;; Make the association list
(provide 'eieio-custom)
+;; Local variables:
+;; generated-autoload-file: "eieio.el"
+;; End:
+
;;; eieio-custom.el ends here