### class-option example Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Predicates.html Fetches the documentation string for the `eieio-default-superclass` class using the `class-option` function. ```emacs-lisp (class-option eieio-default-superclass :documentation) ``` -------------------------------- ### with-slots usage example Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Accessing-Slots.html Defines a class with an x slot, creates an instance, and demonstrates using with-slots to access and bind slot values. Shows that with-slots can be used with setf and setq. ```emacs-lisp (defclass myclass () ((x :initform 1))) (setq mc (make-instance 'myclass)) (with-slots (x) mc x) => 1 (with-slots ((something x)) mc something) => 1 ``` -------------------------------- ### Unquoted :initform example Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Slot-Options.html Illustrates an :initform value that is not quoted, which is currently accepted but incompatible with CLOS and likely to change. ```lisp :initform (1 2 3) ``` -------------------------------- ### Example output of object-print Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Basic-Methods.html Shows the expected output when calling object-print on a test object, resulting in a string that includes the class name and the value slot. ```emacs-lisp (object-print test-object) => # ``` -------------------------------- ### Define a base class with defclass Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Inheritance.html Defines a base class `my-baseclass` with two slots, `slot-A` and `slot-B`, each with an initarg. This is the starting point for inheritance examples. ```emacs-lisp (defclass my-baseclass () ((slot-A :initarg :slot-A) (slot-B :initarg :slot-B)) "My Baseclass.") ``` -------------------------------- ### Create an object using the class constructor Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Creates a new object of my-class using the constructor function, setting the value slot to 3 and the reference slot to nil. Slots set this way do not get their default values, and side effects from :initform functions will not occur. ```emacs-lisp (my-class :value 3 :reference nil) ``` -------------------------------- ### class-option Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Predicates.html Returns the value of a given option for a class. For example, (class-option eieio-default-superclass :documentation) fetches the documentation string. ```APIDOC ## class-option ### Description Return the value in CLASS of a given OPTION. For example: ``` (class-option eieio-default-superclass :documentation) ``` Will fetch the documentation string for `eieio-default-superclass`. ### Function Signature `class-option` class option ### Parameters - **class** (class) - Required - The class to query. - **option** (symbol) - Required - The option name (e.g., :documentation). ### Return Value - The value of the option for the class. ``` -------------------------------- ### Converted widget definition with constants Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Customizing.html Shows the result of converting the previous example when the slot morestuff contains (sym1 sym2 sym3). The :slotofchoices is replaced with a series of const elements. ```emacs-lisp (choice (const :tag "None" nil) (const sym1) (const sym2) (const sym3)) ``` -------------------------------- ### Create an instance with initargs using make-instance Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Creates a new instance of the class symbol foo using make-instance with initargs as a property list with keywords based on the :initarg for each slot. ```emacs-lisp (make-instance 'foo :slot1 value1 :slotN valueN) ``` -------------------------------- ### initialize-instance method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dinstance_002dtracker.html This method is defined as an :after method. It adds new instances to the master list. ```APIDOC ## initialize-instance method ### Description This method is defined as an `:after` method. It adds new instances to the master list. ### Method `initialize-instance` on `eieio-instance-tracker` ### Parameters - **obj** - The instance to add to the master list. ``` -------------------------------- ### Create an instance with make-instance Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Creates a new instance of the class symbol foo using make-instance with no initargs. ```emacs-lisp (make-instance 'foo) ``` -------------------------------- ### Initializing a slot with :initarg Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Slot-Options.html Shows how to initialize the myslot slot to the number 1 when creating a new object. ```lisp (myobject :myslot 1) ``` -------------------------------- ### eieio-speedbar-description method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Return a string description of OBJ, shown in the minibuffer or tooltip when the mouse hovers over the instance in Speedbar. ```APIDOC ## eieio-speedbar-description ### Description Return a string description of OBJ. This is shown in the minibuffer or tooltip when the mouse hovers over this instance in Speedbar. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. ### Returns - A string description. ``` -------------------------------- ### eieio-speedbar-derive-line-path method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Return a string representing a directory associated with an instance of obj. ```APIDOC ## eieio-speedbar-derive-line-path ### Description Return a string representing a directory associated with an instance of obj. `depth` can be used to index how many levels of indentation have been opened by the user where obj is shown. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. - **depth** - The depth level of indentation. ### Returns - A string representing a directory. ``` -------------------------------- ### make-instance Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Creates a new instance of a class based on initargs. The class is specified as a symbol. ```APIDOC ## make-instance ### Description Make a new instance of class based on initargs. class is a class symbol. ### Function Signature `make-instance class &rest initargs` ### Parameters - **class** (symbol) - Required - The class symbol for which to create an instance. - **initargs** (rest arguments) - Optional - A property list with keywords based on the `:initarg` for each slot. ### Example ```lisp (make-instance 'foo) (make-instance 'foo :slot1 value1 :slotN valueN) ``` ``` -------------------------------- ### my-class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Constructor function automatically generated by defclass. Creates and returns a new object with a given name and preset slot values. ```APIDOC ## my-class ### Description Creates and returns a new object of the class type. The object is not assigned to anything and will be garbage collected if not saved. The object is given the string name object-name. Multiple objects can have the same name, but the name slot helps keep track of objects. ### Function Signature `my-class object-name &rest slots` ### Parameters - **object-name** (string) - Required - The name to assign to the new object. - **slots** (rest arguments) - Optional - Slot values to preset. Each slot is specified as a keyword-value pair, e.g., `:value 1`. Any slot set this way will not get its default value, and side effects from the slot's `:initform` (if a function) will not occur. ### Example ```lisp (my-class :value 3 :reference nil) ``` ``` -------------------------------- ### eieio-speedbar-create function Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Register your object display mode with Speedbar. ```APIDOC ## eieio-speedbar-create ### Description Register your object display mode with Speedbar. ### Parameters - **make-map** - A function which initializes your keymap. - **key-map** - A symbol your keymap is installed into. - **menu** - An easy menu vector representing menu items specific to your object display. - **name** - A short string to use as a name identifying your mode. - **toplevelfn** - A function called which must return a list of objects representing those in the instance system you wish to browse in Speedbar. ### Notes - Read the Extending chapter in the Speedbar manual for more information on how Speedbar modes work. ``` -------------------------------- ### eieio-class-parents-fast Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Predicates.html Just like eieio-class-parents except it is a macro and no type checking is performed. ```APIDOC ## eieio-class-parents-fast ### Description Just like `eieio-class-parents` except it is a macro and no type checking is performed. ### Function Signature `eieio-class-parents-fast` class ### Parameters - **class** (class) - Required - The class whose parents are returned. ### Return Value - A list of direct parent classes (no type checking). ``` -------------------------------- ### clone Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Basic-Methods.html Makes a copy of an object and optionally applies initialization parameters to the copy. When overloading, call cl-call-next-method first and modify the returned object. ```APIDOC ## Function: clone obj &rest params ### Description Make a copy of obj, and then apply params. params is a parameter list of the same form as initialize-instance which are applied to change the object. When overloading _clone_, be sure to call _cl-call-next-method_ first and modify the returned object. ### Method Function ### Signature `clone obj &rest params` ### Parameters - **obj** - The object to copy. - **params** (&rest) - Parameter list of the same form as initialize-instance, applied to change the object. ### Usage Notes - When overloading, call `cl-call-next-method` first and modify the returned object. ``` -------------------------------- ### eieio-instance-tracker class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dinstance_002dtracker.html The eieio-instance-tracker class enables instance tracking. The tracking-symbol slot should be initialized to a symbol created with defvar, which serves as the master list of all objects of the class. ```APIDOC ## eieio-instance-tracker class ### Description Enable instance tracking for this class. The slot tracking-symbol should be initialized in inheritors of this class to a symbol created with `defvar`. This symbol will serve as the variable used as a master list of all objects of the given class. ### Class `eieio-instance-tracker` ### Slots - **tracking-symbol** (symbol) - Required - The symbol used as the master list of all instances. ``` -------------------------------- ### eieio-class-children-fast Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Predicates.html Just like eieio-class-children, but with no checks. ```APIDOC ## eieio-class-children-fast ### Description Just like `eieio-class-children`, but with no checks. ### Function Signature `eieio-class-children-fast` class ### Parameters - **class** (class) - Required - The class whose children are returned. ### Return Value - A list of classes inheriting from the given class (no checks). ``` -------------------------------- ### Create an instance of the person class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Quick-Start.html Creates a new object of type 'person' by calling the constructor function with the same name as the class. The constructor returns a new instance. ```emacs-lisp (setq pers (person :name "Eric" :birthday "June" :phone "555-5555")) ``` -------------------------------- ### eieio-speedbar-object-children method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Return a list of children of obj. ```APIDOC ## eieio-speedbar-object-children ### Description Return a list of children of obj. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. ### Returns - A list of children. ``` -------------------------------- ### eieio-speedbar-object-buttonname method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Return a string which is the text displayed in Speedbar for obj. ```APIDOC ## eieio-speedbar-object-buttonname ### Description Return a string which is the text displayed in Speedbar for obj. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. ### Returns - A string for display. ``` -------------------------------- ### eieio-speedbar-directory-button class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Subclass of eieio-speedbar that initializes buttontype and buttonface to appear as directory level lines. ```APIDOC ## eieio-speedbar-directory-button class ### Description Inherits from `eieio-speedbar` and initializes `buttontype` and `buttonface` to appear as directory level lines. ### Inherits From - `eieio-speedbar` ``` -------------------------------- ### eieio-speedbar-file-button class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Subclass of eieio-speedbar that initializes buttontype and buttonface to appear as file level lines. ```APIDOC ## eieio-speedbar-file-button class ### Description Inherits from `eieio-speedbar` and initializes `buttontype` and `buttonface` to appear as file level lines. ### Inherits From - `eieio-speedbar` ``` -------------------------------- ### Static method with subclass specializer Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Writing-Methods.html Defines a static method for make-instance that dispatches on the class mychild. The method calls the next method, pushes the new instance to all-my-children, and returns it. The argument is a class, not an object, so use oref-default or oset-default to access class slots. ```Emacs Lisp (cl-defmethod make-instance ((class (subclass mychild)) &rest args) (let ((new (cl-call-next-method))) (push new all-my-children) new)) ``` -------------------------------- ### eieio-speedbar-child-make-tag-lines method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Inserts a list of Speedbar tag lines for obj to represent its children. Implement this method if your children are not objects themselves. ```APIDOC ## eieio-speedbar-child-make-tag-lines ### Description This method inserts a list of Speedbar tag lines for obj to represent its children. Implement this method for your class if your children are not objects themselves. You still need to implement `eieio-speedbar-object-children`. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. - **depth** - The depth level. ### Notes - Use techniques specified in the Speedbar manual (see (speedbar)Extending). ``` -------------------------------- ### eieio-build-class-alist Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Association-Lists.html Returns an alist of all currently defined classes, suitable for completion lists. The optional base-class argument restricts the list to that class and its subclasses. ```APIDOC ## eieio-build-class-alist ### Description Returns an alist of all currently defined classes. This alist is suitable for completion lists used by interactive functions to select a class. The optional argument base-class allows the programmer to select only a subset of classes which includes base-class and all its subclasses. ### Function Signature `eieio-build-class-alist &optional base-class` ### Parameters - **base-class** (optional) - If provided, only classes that are subclasses of this class (including itself) are included. ### Return Value An alist of class names suitable for completion. ``` -------------------------------- ### with-slots spec-list format Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Accessing-Slots.html Shows the format of spec-list for with-slots, similar to let. Each element can be a list (VAR SLOT) or just a slot name, which uses the same name as the variable. ```emacs-lisp ((VAR1 SLOT1) SLOT2 SLOTN (VARN+1 SLOTN+1)) ``` -------------------------------- ### eieio-instance-tracker-find function Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dinstance_002dtracker.html This convenience function lets you find instances by searching for a key value in a specified slot of the objects in the list. ```APIDOC ## eieio-instance-tracker-find function ### Description This convenience function lets you find instances. key is the value to search for. slot is the slot to compare KEY against. The function `equal` is used for comparison. The parameter list-symbol is the variable symbol which contains the list of objects to be searched. ### Function `eieio-instance-tracker-find` ### Parameters - **key** - The value to search for. - **slot** - The slot to compare KEY against. - **list-symbol** - The variable symbol which contains the list of objects to be searched. ``` -------------------------------- ### eieio-speedbar class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Base class for enabling Speedbar display. Inherit from this class to make your class instances displayable in Speedbar. ```APIDOC ## eieio-speedbar class ### Description Base class for enabling Speedbar display for a class. Inherit from this class to make your class instances displayable in Speedbar. ### Class Slots - **buttontype** - The type of button, any symbol allowed by `speedbar-make-tag-line` for the exp-button-type argument. - **buttonface** - The face to use for the text of the string displayed in Speedbar. ### Notes - The slots `buttontype` and `buttonface` are class allocated slots and do not take up space in instances. - Inherit from this class (or its subclasses) and override default values to customize display. ``` -------------------------------- ### eieio-speedbar-child-description method Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dspeedbar.html Return a string representing a description of a child node of obj when that child is not an object. ```APIDOC ## eieio-speedbar-child-description ### Description Return a string representing a description of a child node of obj when that child is not an object. It is often useful to just use item info helper functions such as `speedbar-item-info-file-helper`. ### Method On - `eieio-speedbar` ### Parameters - **obj** - The object instance. ### Returns - A string description of a child node. ``` -------------------------------- ### Slot with :initarg option Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Slot-Options.html Defines a slot named myslot with an :initarg of :myslot, allowing the constructor to set its value. ```lisp (myslot :initarg :myslot) ``` -------------------------------- ### eieio-object-name Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Predicates.html Returns a string of the form '#' for the object. This is shorter and cleaner than printing the object's record. ```APIDOC ## eieio-object-name ### Description Return a string of the form ‘#’ for obj. This should look like Lisp symbols from other parts of Emacs such as buffers and processes, and is shorter and cleaner than printing the object’s record. It is more useful to use `object-print` to get an object’s print form, as this allows the object to add extra display information into the symbol. ### Function Signature `eieio-object-name` obj ### Parameters - **obj** (object) - Required - The object whose name is returned. ### Return Value - A string of the form '#'. ``` -------------------------------- ### object-print Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Basic-Methods.html Pretty printer for an object. The default method uses eieio-object-name to produce the printed representation. It can be overridden to include additional summary information in the default # string. ```APIDOC ## Function: object-print this &rest strings ### Description Pretty printer for object this. Call function _eieio-object-name_ with strings. The default method for printing object this is to use the function _eieio-object-name_. It is sometimes useful to put a summary of the object into the default # string when using eieio browsing tools. Implement this function and specify strings in a call to _cl-call-next-method_ to provide additional summary information. When passing in extra strings from child classes, always remember to prepend a space. ### Method Function ### Signature `object-print this &rest strings` ### Parameters - **this** - The object to print. - **strings** (&rest) - Additional strings to include in the printed representation. ### Example ```lisp (defclass data-object () (value) "Object containing one data slot.") (cl-defmethod object-print ((this data-object) &optional strings) "Return a string with a summary of the data object as part of the name." (apply #'cl-call-next-method this (format " value: %s" (render this)) strings)) ``` ### Example Output ```lisp (object-print test-object) => # ``` ``` -------------------------------- ### Slot definition syntax in defclass Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Slot-Options.html Shows the general form of a slot definition in the slot-list argument to defclass. Each slot is a list with a slot name and tag-value pairs. ```lisp (SLOT-NAME :TAG1 ATTRIB-VALUE1 :TAG2 ATTRIB-VALUE2 :TAGN ATTRIB-VALUEN) ``` -------------------------------- ### defclass Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Building-Classes.html Macro to create a new class named class-name. It defines the class structure, handles inheritance from superclass-list, and sets up slot definitions. The class is represented by a symbol with the given name. ```APIDOC ## defclass ### Description Create a new class named class-name. The class is represented by a symbol with the name class-name. EIEIO stores the structure of the class as a symbol property of class-name. When defining a class, EIEIO overwrites any preexisting variable or function bindings for the symbol class-name. The parent classes for class-name is superclass-list. Every slot that appears in each parent class is replicated in the new class. If two parents share the same slot name, the parent which appears in the superclass-list first sets the tags for that slot. If the new class has a slot with the same name as the parent, the new slot overrides the parent's slot. When overriding a slot, some slot attributes cannot be overridden because they break basic OO rules. You cannot override :type or :protection. Whenever defclass is used to create a new class, a predicate is created for it, named CLASS-NAME-p. ### Syntax (defclass class-name superclass-list slot-list &rest options-and-doc) ### Parameters - **class-name** (symbol) - Required - The name of the new class. - **superclass-list** (list) - Required - A list of parent classes. Each element must be a class. - **slot-list** (list) - Required - A list of slot definitions for the new class. - **options-and-doc** (rest) - Optional - Additional options and documentation string. ### Notes - The class-name symbol's variable documentation string is a modified version of the doc string found in options-and-doc. Each time a method is defined, the symbol's documentation string is updated to include the method's documentation as well. - Before naming a new class, check for name conflicts. Choose a name with the same prefix as the rest of your package's functions and variables. - When overriding a slot, you cannot override :type or :protection. - A predicate function named CLASS-NAME-p is automatically created. ``` -------------------------------- ### oset-default Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Accessing-Slots.html Macro that sets the value for a class-allocated slot in a class. ```APIDOC ## Macro: oset-default ### Description Sets the value for the class-allocated slot in class to value. ### Syntax (oset-default class slot value) ### Parameters - **class** - The class whose class-allocated slot is set. - **slot** - The slot name (unquoted symbol). - **value** - The new value to assign to the slot. ### Example (oset-default data-object reference (list my-special-object)) ``` -------------------------------- ### object-write Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dpersistent.html Writes the object to a file, deriving a header line comment from the class allocated slot if one is not provided. ```APIDOC ## object-write ### Description Like `object-write` for `standard-object`, but will derive a header line comment from the class allocated slot if one is not provided. ### Method `object-write` ### Parameters - **obj** - Required - The object to write. - **comment** (optional) - Optional - A header comment to use; if not provided, derived from the class allocated slot. ``` -------------------------------- ### with-slots Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Accessing-Slots.html Binds slot values lexically to variables and executes a body. Allows referring to slots as if they were local variables, and supports setf and setq to modify slot values. ```APIDOC ## Function: with-slots ### Description Bind spec-list lexically to slot values in object, and execute body. This establishes a lexical environment for referring to the slots in the instance named by the given slot-names as though they were variables. Within such a context the value of the slot can be specified by using its slot name, as if it were a lexically bound variable. Both `setf` and `setq` can be used to set the value of the slot. ### Syntax (with-slots spec-list object &rest body) ### Parameters - **spec-list** - A list of slot specifications, similar to _let_. Each element can be a slot name (symbol) or a list (VAR SLOT). - **object** - The object whose slots are accessed. - **body** - The body of code to execute with the bindings. ### Example (defclass myclass () ((x :initform 1))) (setq mc (make-instance 'myclass)) (with-slots (x) mc x) => 1 (with-slots ((something x)) mc something) => 1 ``` -------------------------------- ### oset Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Accessing-Slots.html Macro that sets the value behind a slot in an object. Returns the value. ```APIDOC ## Macro: oset ### Description Sets the value behind slot to value in object. It returns value. ### Syntax (oset object slot value) ### Parameters - **object** - The object whose slot is set. - **slot** - The slot name (unquoted symbol). - **value** - The new value to assign to the slot. ### Returns The value assigned. ``` -------------------------------- ### Define a method call-person for the person class Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Quick-Start.html Defines a method 'call-person' for the 'person' class. The first argument is a list (varname classname). It uses slot-value to access slots and executes a shell command to dial the phone. ```emacs-lisp (cl-defmethod call-person ((pers person) &optional scriptname) "Dial the phone for the person PERS. Execute the program SCRIPTNAME to dial the phone." (message "Dialing the phone for %s" (slot-value pers 'name)) (shell-command (concat (or scriptname "dialphone.sh") " " (slot-value pers 'phone)))) ``` -------------------------------- ### Define a simple class with defclass Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Making-New-Objects.html Defines a class named my-class with no slots and a doc string. Calling defclass also defines a constructor function my-class and a predicate function my-class-p. ```emacs-lisp (defclass my-class () ( ) "Doc String") ``` -------------------------------- ### eieio-customize-object Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Customizing.html Creates a custom buffer with a widget for editing the given object in place. Provides Apply and Reset buttons. Modifies the object directly, affecting all references. ```APIDOC ## eieio-customize-object ### Description Creates a custom buffer and inserts a widget for editing the object. At the end, an `Apply` and `Reset` button are available. This edits the object "in place" so references to it are also changed. ### Function Signature `eieio-customize-object object` ### Parameters - **object** - The object to be edited. ### Usage Call this function to open a customization buffer for the given object. The object will be edited in place. ### Notes - There is no effort to prevent multiple edits of a singular object, so care must be taken by the user. - To add additional actions when the user clicks `Apply`, overload the method `eieio-done-customizing`. ``` -------------------------------- ### eieio-persistent-save Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/eieio_002dpersistent.html Writes the object to its file, optionally using a specified file name. ```APIDOC ## eieio-persistent-save ### Description Write the object obj to its file. If optional argument file is specified, use that file name instead. ### Method `eieio-persistent-save` ### Parameters - **obj** - Required - The object to save. - **file** (optional) - Optional - The file name to use instead of the object's stored file. ``` -------------------------------- ### Using :slotofchoices in a widget definition Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Customizing.html Shows a widget definition using the :slotofchoices extension. All elements after :slotofchoices are removed, and the specified slot is queried and converted into a series of constants. ```emacs-lisp (choice (const :tag "None" nil) :slotofchoices morestuff) ``` -------------------------------- ### object-write Source: https://www.gnu.org/software/emacs/manual/html_node/eieio/Basic-Methods.html Writes an object onto a stream in a readable fashion. The output is Lisp code that can be used with read and eval to recover the object. Only slots with :initargs are written. ```APIDOC ## Function: object-write obj &optional comment ### Description Write obj onto a stream in a readable fashion. The resulting output will be Lisp code which can be used with `read` and `eval` to recover the object. Only slots with `:initarg`s are written to the stream. ### Method Function ### Signature `object-write obj &optional comment` ### Parameters - **obj** - The object to write. - **comment** (optional) - An optional comment to include. ### Notes - Only slots with `:initarg`s are written to the stream. ```