diff options
| author | Juanma Barranquero | 2009-10-05 15:32:08 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2009-10-05 15:32:08 +0000 |
| commit | a8f316cab06c8d72c0e6d7159cf80ae0bb4da2ca (patch) | |
| tree | 47e4d9a036353adfb1aeb183a45bc4835b2d1388 | |
| parent | 4a827e0af1fd28cdaafb0b718fd679b76e249e01 (diff) | |
| download | emacs-a8f316cab06c8d72c0e6d7159cf80ae0bb4da2ca.tar.gz emacs-a8f316cab06c8d72c0e6d7159cf80ae0bb4da2ca.zip | |
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
| -rw-r--r-- | lisp/ChangeLog | 62 | ||||
| -rw-r--r-- | lisp/emacs-lisp/chart.el | 34 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-base.el | 14 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-comp.el | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-custom.el | 18 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-datadebug.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-opt.el | 15 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-speedbar.el | 20 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio.el | 194 |
9 files changed, 211 insertions, 156 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29f947eb140..6f85dba1bff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,56 @@ | |||
| 1 | 2009-10-05 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * emacs-lisp/chart.el (chart-face-pixmap-list, chart-new-buffer, chart) | ||
| 4 | (chart-axis-range, chart-axis-names, chart-sequece, chart-bar) | ||
| 5 | (chart-draw, chart-axis-draw, chart-sort, chart-sort-matchlist) | ||
| 6 | (chart-draw-line, chart-bar-quickie): Fix typos in docstrings. | ||
| 7 | |||
| 8 | * emacs-lisp/eieio.el (generic-p, eieiomt-next, eieio-generic-form) | ||
| 9 | (eieio-default-superclass): Reflow docstrings. | ||
| 10 | (this, class-option-assoc, defclass, eieio-class-un-autoload) | ||
| 11 | (eieio-unbind-method-implementations, defmethod) | ||
| 12 | (eieio-validate-slot-value, eieio-validate-class-slot-value) | ||
| 13 | (oref-default, eieio-oref-default, eieio-oset, eieio-oset-default) | ||
| 14 | (with-slots, eieio-add-new-slot, object-assoc, object-remove-from-list) | ||
| 15 | (eieio-slot-originating-class-p, eieio-slot-name-index) | ||
| 16 | (eieio-pre-method-execution-hooks, eieio-initarg-to-attribute) | ||
| 17 | (constructor, initialize-instance, no-next-method, object-print) | ||
| 18 | (object-write, eieio-override-prin1, eieio-edebug-prin1-to-string): | ||
| 19 | Fix typos in docstrings. | ||
| 20 | (eieio-defclass, eieio-perform-slot-validation-for-default, defgeneric) | ||
| 21 | (child-of-class-p, object-slots, slot-boundp, slot-exists-p) | ||
| 22 | (next-method-p): Doc fixes. | ||
| 23 | (eieio-add-new-slot, call-next-method, eieiomt-add, change-class): | ||
| 24 | Fix typos in error messages. | ||
| 25 | (eieio-defmethod): Fix typo in description of generic method. | ||
| 26 | |||
| 27 | * emacs-lisp/eieio-base.el (eieio-instance-inheritor, slot-unbound) | ||
| 28 | (eieio-persistent-save-interactive, slot-missing): | ||
| 29 | Fix typos in docstrings. | ||
| 30 | (eieio-instance-inheritor-slot-boundp): Doc fix. | ||
| 31 | |||
| 32 | * emacs-lisp/eieio-comp.el (byte-compile-file-form-defmethod) | ||
| 33 | (byte-compile-defmethod-param-convert): Fix typos in docstrings. | ||
| 34 | |||
| 35 | * emacs-lisp/eieio-custom.el (eieio-done-customizing) | ||
| 36 | (eieio-custom-object-apply-reset): | ||
| 37 | Fix typos in docstrings and error messages. | ||
| 38 | |||
| 39 | * emacs-lisp/eieio-datadebug.el (data-debug-show): | ||
| 40 | Fix typo in docstring. | ||
| 41 | |||
| 42 | * emacs-lisp/eieio-opt.el (top): Fix typo in error message. | ||
| 43 | (eieio-browse-tree): Doc fix. | ||
| 44 | (eieio-all-generic-functions, eieio-class-speedbar): Reflow docstrings. | ||
| 45 | (eieio-help-mode-augmentation-maybee, eieio-class-speedbar-make-map): | ||
| 46 | Fix typos in docstrings. | ||
| 47 | |||
| 48 | * emacs-lisp/eieio-speedbar.el (eieio-speedbar-file-button): Doc fix. | ||
| 49 | (eieio-speedbar-key-map, eieio-speedbar-create-engine) | ||
| 50 | (eieio-speedbar-buttons, eieio-speedbar, eieio-speedbar-object-children) | ||
| 51 | (eieio-speedbar-make-tag-line, eieio-speedbar-object-expand): | ||
| 52 | Reflow docstrings. | ||
| 53 | |||
| 1 | 2009-10-05 Dan Nicolaescu <dann@ics.uci.edu> | 54 | 2009-10-05 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 55 | ||
| 3 | * vc-hg.el (log-view-vc-backend): Declare for compiler. | 56 | * vc-hg.el (log-view-vc-backend): Declare for compiler. |
| @@ -24,14 +77,13 @@ | |||
| 24 | (tramp-methods): Add recursive option to `tramp-copy-args'. Add | 77 | (tramp-methods): Add recursive option to `tramp-copy-args'. Add |
| 25 | `tramp-copy-recursive'. Valid for "rcp", "scp", "scp1", "scp2", | 78 | `tramp-copy-recursive'. Valid for "rcp", "scp", "scp1", "scp2", |
| 26 | "scp1_old", "scp2_old", "rsync", "rsyncc". | 79 | "scp1_old", "scp2_old", "rsync", "rsyncc". |
| 27 | (tramp-default-method): Check also for | 80 | (tramp-default-method): Check also for `auth-source-user-or-password'. |
| 28 | `auth-source-user-or-password'. | ||
| 29 | (tramp-file-name-handler-alist, tramp-file-name-for-operation): | 81 | (tramp-file-name-handler-alist, tramp-file-name-for-operation): |
| 30 | Add handler for `copy-directory'. | 82 | Add handler for `copy-directory'. |
| 31 | (tramp-handle-copy-directory): New defun. | 83 | (tramp-handle-copy-directory): New defun. |
| 32 | (tramp-do-copy-or-rename-file-out-of-band): Handle directory case. | 84 | (tramp-do-copy-or-rename-file-out-of-band): Handle directory case. |
| 33 | (tramp-handle-start-file-process): Raise an error when PROGRAM is | 85 | (tramp-handle-start-file-process): Raise an error when PROGRAM is nil. |
| 34 | nil. Optimize sent command. | 86 | Optimize sent command. |
| 35 | 87 | ||
| 36 | 2009-10-05 Stefan Monnier <monnier@iro.umontreal.ca> | 88 | 2009-10-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 37 | 89 | ||
| @@ -4741,7 +4793,7 @@ | |||
| 4741 | blocks. | 4793 | blocks. |
| 4742 | (verilog-init-font) Remove definition & use of verilog-init-font, | 4794 | (verilog-init-font) Remove definition & use of verilog-init-font, |
| 4743 | as it is redundant with font-lock-defaults. | 4795 | as it is redundant with font-lock-defaults. |
| 4744 | (verilog-mode): Alter the definition of verilog-font-lock-defualts | 4796 | (verilog-mode): Alter the definition of verilog-font-lock-defaults |
| 4745 | to avoid circular calls if syntax-ppss is a function (as is the | 4797 | to avoid circular calls if syntax-ppss is a function (as is the |
| 4746 | case now in 22.x GNU Emacs) as that function would sometimes call | 4798 | case now in 22.x GNU Emacs) as that function would sometimes call |
| 4747 | itself, leading to (nearly) infinite recursion. | 4799 | itself, leading to (nearly) infinite recursion. |
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 6723d0e6911..1ec7fda4014 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el | |||
| @@ -87,7 +87,7 @@ Colors will be the background color.") | |||
| 87 | (display-graphic-p)) | 87 | (display-graphic-p)) |
| 88 | '("dimple1" "scales" "dot" "cross_weave" "boxes" "dimple3")) | 88 | '("dimple1" "scales" "dot" "cross_weave" "boxes" "dimple3")) |
| 89 | "If pixmaps are allowed, display these background pixmaps. | 89 | "If pixmaps are allowed, display these background pixmaps. |
| 90 | Useful if new Emacs is used on B&W display") | 90 | Useful if new Emacs is used on B&W display.") |
| 91 | 91 | ||
| 92 | (defcustom chart-face-use-pixmaps nil | 92 | (defcustom chart-face-use-pixmaps nil |
| 93 | "*Non-nil to use fancy pixmaps in the background of chart face colors." | 93 | "*Non-nil to use fancy pixmaps in the background of chart face colors." |
| @@ -133,7 +133,7 @@ Useful if new Emacs is used on B&W display") | |||
| 133 | 133 | ||
| 134 | (defun chart-new-buffer (obj) | 134 | (defun chart-new-buffer (obj) |
| 135 | "Create a new buffer NAME in which the chart OBJ is displayed. | 135 | "Create a new buffer NAME in which the chart OBJ is displayed. |
| 136 | Returns the newly created buffer" | 136 | Returns the newly created buffer." |
| 137 | (save-excursion | 137 | (save-excursion |
| 138 | (set-buffer (get-buffer-create (format "*%s*" (oref obj title)))) | 138 | (set-buffer (get-buffer-create (format "*%s*" (oref obj title)))) |
| 139 | (chart-mode) | 139 | (chart-mode) |
| @@ -162,7 +162,7 @@ Returns the newly created buffer" | |||
| 162 | (sequences :initarg :sequences | 162 | (sequences :initarg :sequences |
| 163 | :initform nil) | 163 | :initform nil) |
| 164 | ) | 164 | ) |
| 165 | "Superclass for all charts to be displayed in an emacs buffer") | 165 | "Superclass for all charts to be displayed in an Emacs buffer.") |
| 166 | 166 | ||
| 167 | (defmethod initialize-instance :AFTER ((obj chart) &rest fields) | 167 | (defmethod initialize-instance :AFTER ((obj chart) &rest fields) |
| 168 | "Initialize the chart OBJ being created with FIELDS. | 168 | "Initialize the chart OBJ being created with FIELDS. |
| @@ -188,13 +188,13 @@ Make sure the width/height is correct." | |||
| 188 | ((bounds :initarg :bounds | 188 | ((bounds :initarg :bounds |
| 189 | :initform '(0.0 . 50.0)) | 189 | :initform '(0.0 . 50.0)) |
| 190 | ) | 190 | ) |
| 191 | "Class used to display an axis defined by a range of values") | 191 | "Class used to display an axis defined by a range of values.") |
| 192 | 192 | ||
| 193 | (defclass chart-axis-names (chart-axis) | 193 | (defclass chart-axis-names (chart-axis) |
| 194 | ((items :initarg :items | 194 | ((items :initarg :items |
| 195 | :initform nil) | 195 | :initform nil) |
| 196 | ) | 196 | ) |
| 197 | "Class used to display an axis which represents different named items") | 197 | "Class used to display an axis which represents different named items.") |
| 198 | 198 | ||
| 199 | (defclass chart-sequece () | 199 | (defclass chart-sequece () |
| 200 | ((data :initarg :data | 200 | ((data :initarg :data |
| @@ -202,16 +202,16 @@ Make sure the width/height is correct." | |||
| 202 | (name :initarg :name | 202 | (name :initarg :name |
| 203 | :initform "Data") | 203 | :initform "Data") |
| 204 | ) | 204 | ) |
| 205 | "Class used for all data in different charts") | 205 | "Class used for all data in different charts.") |
| 206 | 206 | ||
| 207 | (defclass chart-bar (chart) | 207 | (defclass chart-bar (chart) |
| 208 | ((direction :initarg :direction | 208 | ((direction :initarg :direction |
| 209 | :initform vertical)) | 209 | :initform vertical)) |
| 210 | "Subclass for bar charts. (Vertical or horizontal)") | 210 | "Subclass for bar charts (vertical or horizontal).") |
| 211 | 211 | ||
| 212 | (defmethod chart-draw ((c chart) &optional buff) | 212 | (defmethod chart-draw ((c chart) &optional buff) |
| 213 | "Start drawing a chart object C in optional BUFF. | 213 | "Start drawing a chart object C in optional BUFF. |
| 214 | Erases current contents of buffer" | 214 | Erases current contents of buffer." |
| 215 | (save-excursion | 215 | (save-excursion |
| 216 | (if buff (set-buffer buff)) | 216 | (if buff (set-buffer buff)) |
| 217 | (erase-buffer) | 217 | (erase-buffer) |
| @@ -256,7 +256,7 @@ Argument C is the chart object." | |||
| 256 | ) | 256 | ) |
| 257 | 257 | ||
| 258 | (defmethod chart-axis-draw ((a chart-axis) &optional dir margin zone start end) | 258 | (defmethod chart-axis-draw ((a chart-axis) &optional dir margin zone start end) |
| 259 | "Draw some axis for A in direction DIR at with MARGIN in boundry. | 259 | "Draw some axis for A in direction DIR with MARGIN in boundary. |
| 260 | ZONE is a zone specification. | 260 | ZONE is a zone specification. |
| 261 | START and END represent the boundary." | 261 | START and END represent the boundary." |
| 262 | (chart-draw-line dir (+ margin (if zone zone 0)) start end) | 262 | (chart-draw-line dir (+ margin (if zone zone 0)) start end) |
| @@ -339,8 +339,8 @@ Automatically compensates for for direction." | |||
| 339 | 339 | ||
| 340 | (defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone start end) | 340 | (defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone start end) |
| 341 | "Draw axis information based upon A range to be spread along the edge. | 341 | "Draw axis information based upon A range to be spread along the edge. |
| 342 | Optional argument DIR the direction of the chart. | 342 | Optional argument DIR is the direction of the chart. |
| 343 | Optional argument MARGIN , ZONE, START and END specify boundaries of the drawing." | 343 | Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." |
| 344 | (call-next-method) | 344 | (call-next-method) |
| 345 | ;; We prefer about 5 spaces between each value | 345 | ;; We prefer about 5 spaces between each value |
| 346 | (let* ((i 0) | 346 | (let* ((i 0) |
| @@ -465,7 +465,7 @@ or is created with the bounds of SEQ." | |||
| 465 | 465 | ||
| 466 | (defmethod chart-sort ((c chart) pred) | 466 | (defmethod chart-sort ((c chart) pred) |
| 467 | "Sort the data in chart C using predicate PRED. | 467 | "Sort the data in chart C using predicate PRED. |
| 468 | See `chart-sort-matchlist' for more details" | 468 | See `chart-sort-matchlist' for more details." |
| 469 | (let* ((sl (oref c sequences)) | 469 | (let* ((sl (oref c sequences)) |
| 470 | (s1 (car sl)) | 470 | (s1 (car sl)) |
| 471 | (s2 (car (cdr sl))) | 471 | (s2 (car (cdr sl))) |
| @@ -486,9 +486,9 @@ See `chart-sort-matchlist' for more details" | |||
| 486 | ) | 486 | ) |
| 487 | 487 | ||
| 488 | (defun chart-sort-matchlist (namelst numlst pred) | 488 | (defun chart-sort-matchlist (namelst numlst pred) |
| 489 | "Sort NAMELST and NUMLST (both SEQUENCE objects) based on predicate PRED. | 489 | "Sort NAMELST and NUMLST (both sequence objects) based on predicate PRED. |
| 490 | PRED should be the equivalent of '<, except it must expect two | 490 | PRED should be the equivalent of '<, except it must expect two |
| 491 | cons cells of the form (NAME . NUM). See SORT for more details." | 491 | cons cells of the form (NAME . NUM). See `sort' for more details." |
| 492 | ;; 1 - create 1 list of cons cells | 492 | ;; 1 - create 1 list of cons cells |
| 493 | (let ((newlist nil) | 493 | (let ((newlist nil) |
| 494 | (alst (oref namelst data)) | 494 | (alst (oref namelst data)) |
| @@ -557,7 +557,7 @@ Optional argument FACE is the property we wish to place on this text." | |||
| 557 | 557 | ||
| 558 | (defun chart-draw-line (dir zone start end) | 558 | (defun chart-draw-line (dir zone start end) |
| 559 | "Draw a line using line-drawing characters in direction DIR. | 559 | "Draw a line using line-drawing characters in direction DIR. |
| 560 | Use column or row ZONE between START and END" | 560 | Use column or row ZONE between START and END." |
| 561 | (chart-display-label | 561 | (chart-display-label |
| 562 | (make-string (- end start) (if (eq dir 'vertical) ?| ?\-)) | 562 | (make-string (- end start) (if (eq dir 'vertical) ?| ?\-)) |
| 563 | dir zone start end)) | 563 | dir zone start end)) |
| @@ -578,12 +578,12 @@ R1 and R2 are dotted pairs. Colorize it with FACE." | |||
| 578 | 578 | ||
| 579 | (defun chart-bar-quickie (dir title namelst nametitle numlst numtitle | 579 | (defun chart-bar-quickie (dir title namelst nametitle numlst numtitle |
| 580 | &optional max sort-pred) | 580 | &optional max sort-pred) |
| 581 | "Wash over the complex eieio stuff and create a nice bar chart. | 581 | "Wash over the complex EIEIO stuff and create a nice bar chart. |
| 582 | Create it going in direction DIR ['horizontal 'vertical] with TITLE | 582 | Create it going in direction DIR ['horizontal 'vertical] with TITLE |
| 583 | using a name sequence NAMELST labeled NAMETITLE with values NUMLST | 583 | using a name sequence NAMELST labeled NAMETITLE with values NUMLST |
| 584 | labeled NUMTITLE. | 584 | labeled NUMTITLE. |
| 585 | Optional arguments: | 585 | Optional arguments: |
| 586 | Set the charts' max element display to MAX, and sort lists with | 586 | Set the chart's max element display to MAX, and sort lists with |
| 587 | SORT-PRED if desired." | 587 | SORT-PRED if desired." |
| 588 | (let ((nc (make-instance chart-bar | 588 | (let ((nc (make-instance chart-bar |
| 589 | :title title | 589 | :title title |
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index ff897070cf4..b530131e72b 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | :type eieio-instance-inheritor-child | 42 | :type eieio-instance-inheritor-child |
| 43 | :documentation | 43 | :documentation |
| 44 | "The parent of this instance. | 44 | "The parent of this instance. |
| 45 | If a slot of this class is reference, and is unbound, then the parent | 45 | If a slot of this class is referenced, and is unbound, then the parent |
| 46 | is checked for a value.") | 46 | is checked for a value.") |
| 47 | ) | 47 | ) |
| 48 | "This special class can enable instance inheritance. | 48 | "This special class can enable instance inheritance. |
| @@ -53,7 +53,7 @@ not been set, use values from the parent." | |||
| 53 | 53 | ||
| 54 | (defmethod slot-unbound ((object eieio-instance-inheritor) class slot-name fn) | 54 | (defmethod slot-unbound ((object eieio-instance-inheritor) class slot-name fn) |
| 55 | "If a slot OBJECT in this CLASS is unbound, try to inherit, or throw a signal. | 55 | "If a slot OBJECT in this CLASS is unbound, try to inherit, or throw a signal. |
| 56 | SLOT-NAME, is the offending slot. FN is the function signalling the error." | 56 | SLOT-NAME is the offending slot. FN is the function signalling the error." |
| 57 | (if (slot-boundp object 'parent-instance) | 57 | (if (slot-boundp object 'parent-instance) |
| 58 | ;; It may not look like it, but this line recurses back into this | 58 | ;; It may not look like it, but this line recurses back into this |
| 59 | ;; method if the parent instance's slot is unbound. | 59 | ;; method if the parent instance's slot is unbound. |
| @@ -85,9 +85,9 @@ All slots are unbound, except those initialized with PARAMS." | |||
| 85 | 85 | ||
| 86 | (defmethod eieio-instance-inheritor-slot-boundp ((object eieio-instance-inheritor) | 86 | (defmethod eieio-instance-inheritor-slot-boundp ((object eieio-instance-inheritor) |
| 87 | slot) | 87 | slot) |
| 88 | "Non-nil if the instance inheritor OBJECT's SLOT is bound. | 88 | "Return non-nil if the instance inheritor OBJECT's SLOT is bound. |
| 89 | See `slot-boundp' for for details on binding slots. | 89 | See `slot-boundp' for details on binding slots. |
| 90 | The instance inheritor uses unbound slots as a way cascading cloned | 90 | The instance inheritor uses unbound slots as a way of cascading cloned |
| 91 | slot values, so testing for a slot being bound requires extra steps | 91 | slot values, so testing for a slot being bound requires extra steps |
| 92 | for this kind of object." | 92 | for this kind of object." |
| 93 | (if (slot-boundp object slot) | 93 | (if (slot-boundp object slot) |
| @@ -213,7 +213,7 @@ specified will not be saved." | |||
| 213 | 213 | ||
| 214 | (defmethod eieio-persistent-save-interactive ((this eieio-persistent) prompt | 214 | (defmethod eieio-persistent-save-interactive ((this eieio-persistent) prompt |
| 215 | &optional name) | 215 | &optional name) |
| 216 | "Perpare to save THIS. Use in an `interactive' statement. | 216 | "Prepare to save THIS. Use in an `interactive' statement. |
| 217 | Query user for file name with PROMPT if THIS does not yet specify | 217 | Query user for file name with PROMPT if THIS does not yet specify |
| 218 | a file. Optional argument NAME specifies a default file name." | 218 | a file. Optional argument NAME specifies a default file name." |
| 219 | (unless (slot-boundp this 'file) | 219 | (unless (slot-boundp this 'file) |
| @@ -308,7 +308,7 @@ access to it." | |||
| 308 | slot-name operation &optional new-value) | 308 | slot-name operation &optional new-value) |
| 309 | "Called when a on-existant slot is accessed. | 309 | "Called when a on-existant slot is accessed. |
| 310 | For variable `eieio-named', provide an imaginary `object-name' slot. | 310 | For variable `eieio-named', provide an imaginary `object-name' slot. |
| 311 | Argument OBJ is the Named object. | 311 | Argument OBJ is the named object. |
| 312 | Argument SLOT-NAME is the slot that was attempted to be accessed. | 312 | Argument SLOT-NAME is the slot that was attempted to be accessed. |
| 313 | OPERATION is the type of access, such as `oref' or `oset'. | 313 | OPERATION is the type of access, such as `oref' or `oset'. |
| 314 | NEW-VALUE is the value that was being set into SLOT if OPERATION were | 314 | NEW-VALUE is the value that was being set into SLOT if OPERATION were |
diff --git a/lisp/emacs-lisp/eieio-comp.el b/lisp/emacs-lisp/eieio-comp.el index 319d236c37b..9dbec16831b 100644 --- a/lisp/emacs-lisp/eieio-comp.el +++ b/lisp/emacs-lisp/eieio-comp.el | |||
| @@ -52,9 +52,9 @@ | |||
| 52 | 52 | ||
| 53 | (defun byte-compile-file-form-defmethod (form) | 53 | (defun byte-compile-file-form-defmethod (form) |
| 54 | "Mumble about the method we are compiling. | 54 | "Mumble about the method we are compiling. |
| 55 | This function is mostly ripped from `byte-compile-file-form-defun', but | 55 | This function is mostly ripped from `byte-compile-file-form-defun', |
| 56 | it's been modified to handle the special syntax of the defmethod | 56 | but it's been modified to handle the special syntax of the `defmethod' |
| 57 | command. There should probably be one for defgeneric as well, but | 57 | command. There should probably be one for `defgeneric' as well, but |
| 58 | that is called but rarely. Argument FORM is the body of the method." | 58 | that is called but rarely. Argument FORM is the body of the method." |
| 59 | (setq form (cdr form)) | 59 | (setq form (cdr form)) |
| 60 | (let* ((meth (car form)) | 60 | (let* ((meth (car form)) |
| @@ -125,7 +125,7 @@ that is called but rarely. Argument FORM is the body of the method." | |||
| 125 | nil)) | 125 | nil)) |
| 126 | 126 | ||
| 127 | (defun byte-compile-defmethod-param-convert (paramlist) | 127 | (defun byte-compile-defmethod-param-convert (paramlist) |
| 128 | "Convert method params into the params used by the defmethod thingy. | 128 | "Convert method params into the params used by the `defmethod' thingy. |
| 129 | Argument PARAMLIST is the parameter list to convert." | 129 | Argument PARAMLIST is the parameter list to convert." |
| 130 | (let ((argfix nil)) | 130 | (let ((argfix nil)) |
| 131 | (while paramlist | 131 | (while paramlist |
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el index bd281f9d07e..7fa4e7cd4dc 100644 --- a/lisp/emacs-lisp/eieio-custom.el +++ b/lisp/emacs-lisp/eieio-custom.el | |||
| @@ -90,7 +90,7 @@ of these.") | |||
| 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 | ||
| @@ -227,7 +227,7 @@ Optional argument IGNORE is an extraneous parameter." | |||
| 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)) |
| @@ -320,9 +320,9 @@ Optional argument IGNORE is an extraneous parameter." | |||
| 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 | ||
| @@ -374,7 +374,7 @@ These groups are specified with the `:group' slot flag." | |||
| 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) |
| @@ -385,16 +385,16 @@ Argument OBJ os the object being customized." | |||
| 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 " ") |
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el index 0cc779b163b..8fa404143c2 100644 --- a/lisp/emacs-lisp/eieio-datadebug.el +++ b/lisp/emacs-lisp/eieio-datadebug.el | |||
| @@ -122,7 +122,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button." | |||
| 122 | ;; A generic function to run DDEBUG on an object and popup a new buffer. | 122 | ;; A generic function to run DDEBUG on an object and popup a new buffer. |
| 123 | ;; | 123 | ;; |
| 124 | (defmethod data-debug-show ((obj eieio-default-superclass)) | 124 | (defmethod data-debug-show ((obj eieio-default-superclass)) |
| 125 | "Run ddebug against any EIEIO object OBJ" | 125 | "Run ddebug against any EIEIO object OBJ." |
| 126 | (data-debug-new-buffer (format "*%s DDEBUG*" (object-name obj))) | 126 | (data-debug-new-buffer (format "*%s DDEBUG*" (object-name obj))) |
| 127 | (data-debug-insert-object-slots obj "]")) | 127 | (data-debug-insert-object-slots obj "]")) |
| 128 | 128 | ||
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 9fe37a6206a..499f5ebf45a 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el | |||
| @@ -51,7 +51,7 @@ variable `eieio-default-superclass'." | |||
| 51 | )) | 51 | )) |
| 52 | 52 | ||
| 53 | (defun eieio-browse-tree (this-root prefix ch-prefix) | 53 | (defun eieio-browse-tree (this-root prefix ch-prefix) |
| 54 | "Recursively, draws the children of the given class on the screen. | 54 | "Recursively draw the children of the given class on the screen. |
| 55 | Argument THIS-ROOT is the local root of the tree. | 55 | Argument THIS-ROOT is the local root of the tree. |
| 56 | Argument PREFIX is the character prefix to use. | 56 | Argument PREFIX is the character prefix to use. |
| 57 | Argument CH-PREFIX is another character prefix to display." | 57 | Argument CH-PREFIX is another character prefix to display." |
| @@ -389,7 +389,8 @@ Also extracts information about all methods specific to this generic." | |||
| 389 | 389 | ||
| 390 | (defun eieio-all-generic-functions (&optional class) | 390 | (defun eieio-all-generic-functions (&optional class) |
| 391 | "Return a list of all generic functions. | 391 | "Return a list of all generic functions. |
| 392 | Optional CLASS argument returns only those functions that contain methods for CLASS." | 392 | Optional CLASS argument returns only those functions that contain |
| 393 | methods for CLASS." | ||
| 393 | (let ((l nil) tree (cn (if class (symbol-name class) nil))) | 394 | (let ((l nil) tree (cn (if class (symbol-name class) nil))) |
| 394 | (mapatoms | 395 | (mapatoms |
| 395 | (lambda (symbol) | 396 | (lambda (symbol) |
| @@ -552,7 +553,7 @@ Optional argument HISTORYVAR is the variable to use as history." | |||
| 552 | ;;; HELP AUGMENTATION | 553 | ;;; HELP AUGMENTATION |
| 553 | ;; | 554 | ;; |
| 554 | (defun eieio-help-mode-augmentation-maybee (&rest unused) | 555 | (defun eieio-help-mode-augmentation-maybee (&rest unused) |
| 555 | "For buffers thrown into help mode, augment for eieio. | 556 | "For buffers thrown into help mode, augment for EIEIO. |
| 556 | Arguments UNUSED are not used." | 557 | Arguments UNUSED are not used." |
| 557 | ;; Scan created buttons so far if we are in help mode. | 558 | ;; Scan created buttons so far if we are in help mode. |
| 558 | (when (eq major-mode 'help-mode) | 559 | (when (eq major-mode 'help-mode) |
| @@ -600,13 +601,13 @@ Arguments UNUSED are not used." | |||
| 600 | (eval-when-compile | 601 | (eval-when-compile |
| 601 | (condition-case nil | 602 | (condition-case nil |
| 602 | (require 'speedbar) | 603 | (require 'speedbar) |
| 603 | (error (message "Error loading speedbar... ignored.")))) | 604 | (error (message "Error loading speedbar... ignored")))) |
| 604 | 605 | ||
| 605 | (defvar eieio-class-speedbar-key-map nil | 606 | (defvar eieio-class-speedbar-key-map nil |
| 606 | "Keymap used when working with a project in speedbar.") | 607 | "Keymap used when working with a project in speedbar.") |
| 607 | 608 | ||
| 608 | (defun eieio-class-speedbar-make-map () | 609 | (defun eieio-class-speedbar-make-map () |
| 609 | "Make a keymap for eieio under speedbar." | 610 | "Make a keymap for EIEIO under speedbar." |
| 610 | (setq eieio-class-speedbar-key-map (speedbar-make-specialized-keymap)) | 611 | (setq eieio-class-speedbar-key-map (speedbar-make-specialized-keymap)) |
| 611 | 612 | ||
| 612 | ;; General viewing stuff | 613 | ;; General viewing stuff |
| @@ -637,8 +638,8 @@ Arguments UNUSED are not used." | |||
| 637 | 638 | ||
| 638 | (defun eieio-class-speedbar (dir-or-object depth) | 639 | (defun eieio-class-speedbar (dir-or-object depth) |
| 639 | "Create buttons in speedbar that represents the current project. | 640 | "Create buttons in speedbar that represents the current project. |
| 640 | DIR-OR-OBJECT is the object to expand, or nil, and DEPTH is the current | 641 | DIR-OR-OBJECT is the object to expand, or nil, and DEPTH is the |
| 641 | expansion depth." | 642 | current expansion depth." |
| 642 | (when (eq (point-min) (point-max)) | 643 | (when (eq (point-min) (point-max)) |
| 643 | ;; This function is only called once, to start the whole deal. | 644 | ;; This function is only called once, to start the whole deal. |
| 644 | ;; Ceate, and expand the default object. | 645 | ;; Ceate, and expand the default object. |
diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el index 79057c2e6be..ca499472afa 100644 --- a/lisp/emacs-lisp/eieio-speedbar.el +++ b/lisp/emacs-lisp/eieio-speedbar.el | |||
| @@ -113,7 +113,7 @@ | |||
| 113 | map)) | 113 | map)) |
| 114 | 114 | ||
| 115 | (defvar eieio-speedbar-key-map (eieio-speedbar-make-map) | 115 | (defvar eieio-speedbar-key-map (eieio-speedbar-make-map) |
| 116 | "A Generic object based speedbar display keymap.") | 116 | "A generic object based speedbar display keymap.") |
| 117 | 117 | ||
| 118 | (defvar eieio-speedbar-menu | 118 | (defvar eieio-speedbar-menu |
| 119 | '([ "Edit Object/Field" speedbar-edit-line t] | 119 | '([ "Edit Object/Field" speedbar-edit-line t] |
| @@ -150,7 +150,7 @@ creating the speedbar display." | |||
| 150 | (defun eieio-speedbar-create-engine (map-fn map-var menu-var modename fetcher) | 150 | (defun eieio-speedbar-create-engine (map-fn map-var menu-var modename fetcher) |
| 151 | "Create a speedbar mode for displaying an object hierarchy. | 151 | "Create a speedbar mode for displaying an object hierarchy. |
| 152 | Called from `eieio-speedbar-create', or the speedbar load-hook. | 152 | Called from `eieio-speedbar-create', or the speedbar load-hook. |
| 153 | MAP-FN, MAP-VAR, MENU-VAR, MODENAME, and FETCHER are the same as | 153 | MAP-FN, MAP-VAR, MENU-VAR, MODENAME, and FETCHER are the same as in |
| 154 | `eieio-speedbar-create'." | 154 | `eieio-speedbar-create'." |
| 155 | ;; make sure the keymap exists | 155 | ;; make sure the keymap exists |
| 156 | (funcall map-fn) | 156 | (funcall map-fn) |
| @@ -171,7 +171,7 @@ MAP-FN, MAP-VAR, MENU-VAR, MODENAME, and FETCHER are the same as | |||
| 171 | (defun eieio-speedbar-buttons (dir-or-object depth fetcher) | 171 | (defun eieio-speedbar-buttons (dir-or-object depth fetcher) |
| 172 | "Create buttons for the speedbar display. | 172 | "Create buttons for the speedbar display. |
| 173 | Start in directory DIR-OR-OBJECT. If it is an object, just display that | 173 | Start in directory DIR-OR-OBJECT. If it is an object, just display that |
| 174 | objects subelements. | 174 | object's subelements. |
| 175 | Argument DEPTH specifies how far down we have already been displayed. | 175 | Argument DEPTH specifies how far down we have already been displayed. |
| 176 | If it is a directory, use FETCHER to fetch all objects associated with | 176 | If it is a directory, use FETCHER to fetch all objects associated with |
| 177 | that path." | 177 | that path." |
| @@ -263,7 +263,7 @@ See `speedbar-make-tag-line' for details." | |||
| 263 | "State of an object being expanded in speedbar.") | 263 | "State of an object being expanded in speedbar.") |
| 264 | ) | 264 | ) |
| 265 | "Class which provides basic speedbar support for child classes. | 265 | "Class which provides basic speedbar support for child classes. |
| 266 | Add one of thie child classes to this class to the parent list of a class." | 266 | Add one of the child classes to this class to the parent list of a class." |
| 267 | :method-invocation-order :depth-first | 267 | :method-invocation-order :depth-first |
| 268 | :abstract t) | 268 | :abstract t) |
| 269 | 269 | ||
| @@ -277,7 +277,7 @@ Add one of thie child classes to this class to the parent list of a class." | |||
| 277 | (defclass eieio-speedbar-file-button (eieio-speedbar) | 277 | (defclass eieio-speedbar-file-button (eieio-speedbar) |
| 278 | ((buttontype :initform bracket) | 278 | ((buttontype :initform bracket) |
| 279 | (buttonface :initform speedbar-file-face)) | 279 | (buttonface :initform speedbar-file-face)) |
| 280 | "Class providing support for objects which behave like a directory." | 280 | "Class providing support for objects which behave like a file." |
| 281 | :method-invocation-order :depth-first | 281 | :method-invocation-order :depth-first |
| 282 | :abstract t) | 282 | :abstract t) |
| 283 | 283 | ||
| @@ -287,8 +287,8 @@ Add one of thie child classes to this class to the parent list of a class." | |||
| 287 | (defmethod eieio-speedbar-make-tag-line ((object eieio-speedbar) | 287 | (defmethod eieio-speedbar-make-tag-line ((object eieio-speedbar) |
| 288 | depth) | 288 | depth) |
| 289 | "Insert a tag line into speedbar at point for OBJECT. | 289 | "Insert a tag line into speedbar at point for OBJECT. |
| 290 | All objects a child of symbol `eieio-speedbar' can be created from this | 290 | All objects a child of symbol `eieio-speedbar' can be created from |
| 291 | method. Override this if you need non-traditional tag lines. | 291 | this method. Override this if you need non-traditional tag lines. |
| 292 | Argument DEPTH is the depth at which the tag line is inserted." | 292 | Argument DEPTH is the depth at which the tag line is inserted." |
| 293 | (let ((children (eieio-speedbar-object-children object)) | 293 | (let ((children (eieio-speedbar-object-children object)) |
| 294 | (exp (oref object expanded))) | 294 | (exp (oref object expanded))) |
| @@ -345,8 +345,8 @@ The object is at indentation level INDENT." | |||
| 345 | (eieio-speedbar-handle-click token)) | 345 | (eieio-speedbar-handle-click token)) |
| 346 | 346 | ||
| 347 | (defun eieio-speedbar-object-expand (text token indent) | 347 | (defun eieio-speedbar-object-expand (text token indent) |
| 348 | "Expand object represented by TEXT. TOKEN is the object. | 348 | "Expand object represented by TEXT. |
| 349 | INDENT is the current indentation level." | 349 | TOKEN is the object. INDENT is the current indentation level." |
| 350 | (cond ((string-match "+" text) ;we have to expand this file | 350 | (cond ((string-match "+" text) ;we have to expand this file |
| 351 | (speedbar-change-expand-button-char ?-) | 351 | (speedbar-change-expand-button-char ?-) |
| 352 | (oset token expanded t) | 352 | (oset token expanded t) |
| @@ -412,7 +412,7 @@ Optional DEPTH is the depth we start at." | |||
| 412 | ;;; Methods to the eieio-speedbar-* classes which need to be overriden. | 412 | ;;; Methods to the eieio-speedbar-* classes which need to be overriden. |
| 413 | ;; | 413 | ;; |
| 414 | (defmethod eieio-speedbar-object-children ((object eieio-speedbar)) | 414 | (defmethod eieio-speedbar-object-children ((object eieio-speedbar)) |
| 415 | "Return a list of children to be displayed in SPEEDBAR. | 415 | "Return a list of children to be displayed in speedbar. |
| 416 | If the return value is a list of OBJECTs, then those objects are | 416 | If the return value is a list of OBJECTs, then those objects are |
| 417 | queried for details. If the return list is made of strings, | 417 | queried for details. If the return list is made of strings, |
| 418 | then this object will be queried for the details needed | 418 | then this object will be queried for the details needed |
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index a80b2b88a4a..d47973e61b9 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | (message eieio-version)) | 52 | (message eieio-version)) |
| 53 | 53 | ||
| 54 | (eval-and-compile | 54 | (eval-and-compile |
| 55 | ;; About the above. EIEIO must process it's own code when it compiles | 55 | ;; About the above. EIEIO must process its own code when it compiles |
| 56 | ;; itself, thus, by eval-and-compiling outselves, we solve the problem. | 56 | ;; itself, thus, by eval-and-compiling outselves, we solve the problem. |
| 57 | 57 | ||
| 58 | ;; Compatibility | 58 | ;; Compatibility |
| @@ -98,7 +98,7 @@ DO NOT SET THIS YOURSELF unless you are trying to simulate friendly slots. | |||
| 98 | 98 | ||
| 99 | Note: Embedded methods are no longer supported. The variable THIS is | 99 | Note: Embedded methods are no longer supported. The variable THIS is |
| 100 | still set for CLOS methods for the sake of routines like | 100 | still set for CLOS methods for the sake of routines like |
| 101 | `call-next-method'") | 101 | `call-next-method'.") |
| 102 | 102 | ||
| 103 | (defvar scoped-class nil | 103 | (defvar scoped-class nil |
| 104 | "This is set to a class when a method is running. | 104 | "This is set to a class when a method is running. |
| @@ -205,8 +205,8 @@ CLASS is a symbol." | |||
| 205 | 205 | ||
| 206 | (defmacro generic-p (method) | 206 | (defmacro generic-p (method) |
| 207 | "Return t if symbol METHOD is a generic function. | 207 | "Return t if symbol METHOD is a generic function. |
| 208 | Only methods have the symbol `eieio-method-obarray' as a property (which | 208 | Only methods have the symbol `eieio-method-obarray' as a property |
| 209 | contains a list of all bindings to that method type.)" | 209 | \(which contains a list of all bindings to that method type.)" |
| 210 | `(and (fboundp ,method) (get ,method 'eieio-method-obarray))) | 210 | `(and (fboundp ,method) (get ,method 'eieio-method-obarray))) |
| 211 | 211 | ||
| 212 | (defun generic-primary-only-p (method) | 212 | (defun generic-primary-only-p (method) |
| @@ -242,7 +242,8 @@ Methods with only primary implementations are executed in an optimized way." | |||
| 242 | )) | 242 | )) |
| 243 | 243 | ||
| 244 | (defmacro class-option-assoc (list option) | 244 | (defmacro class-option-assoc (list option) |
| 245 | "Return from LIST the found OPTION. Nil if it doesn't exist." | 245 | "Return from LIST the found OPTION. |
| 246 | Return nil if it doesn't exist." | ||
| 246 | `(car-safe (cdr (memq ,option ,list)))) | 247 | `(car-safe (cdr (memq ,option ,list)))) |
| 247 | 248 | ||
| 248 | (defmacro class-option (class option) | 249 | (defmacro class-option (class option) |
| @@ -272,20 +273,20 @@ being the slots residing in that class definition. NOTE: Currently | |||
| 272 | only one slot may exist in SUPERCLASS as multiple inheritance is not | 273 | only one slot may exist in SUPERCLASS as multiple inheritance is not |
| 273 | yet supported. Supported tags are: | 274 | yet supported. Supported tags are: |
| 274 | 275 | ||
| 275 | :initform - initializing form | 276 | :initform - Initializing form. |
| 276 | :initarg - tag used during initialization | 277 | :initarg - Tag used during initialization. |
| 277 | :accessor - tag used to create a function to access this slot | 278 | :accessor - Tag used to create a function to access this slot. |
| 278 | :allocation - specify where the value is stored. | 279 | :allocation - Specify where the value is stored. |
| 279 | defaults to `:instance', but could also be `:class' | 280 | Defaults to `:instance', but could also be `:class'. |
| 280 | :writer - a function symbol which will `write' an object's slot | 281 | :writer - A function symbol which will `write' an object's slot. |
| 281 | :reader - a function symbol which will `read' an object | 282 | :reader - A function symbol which will `read' an object. |
| 282 | :type - the type of data allowed in this slot (see `typep') | 283 | :type - The type of data allowed in this slot (see `typep'). |
| 283 | :documentation | 284 | :documentation |
| 284 | - A string documenting use of this slot. | 285 | - A string documenting use of this slot. |
| 285 | 286 | ||
| 286 | The following are extensions on CLOS: | 287 | The following are extensions on CLOS: |
| 287 | :protection - Specify protection for this slot. | 288 | :protection - Specify protection for this slot. |
| 288 | Defaults to `:public'. Also use `:protected', or `:private' | 289 | Defaults to `:public'. Also use `:protected', or `:private'. |
| 289 | :custom - When customizing an object, the custom :type. Public only. | 290 | :custom - When customizing an object, the custom :type. Public only. |
| 290 | :label - A text string label used for a slot when customizing. | 291 | :label - A text string label used for a slot when customizing. |
| 291 | :group - Name of a customization group this slot belongs in. | 292 | :group - Name of a customization group this slot belongs in. |
| @@ -293,14 +294,14 @@ The following are extensions on CLOS: | |||
| 293 | See `eieio-override-prin1' as an example. | 294 | See `eieio-override-prin1' as an example. |
| 294 | 295 | ||
| 295 | A class can also have optional options. These options happen in place | 296 | A class can also have optional options. These options happen in place |
| 296 | of documentation, (including a :documentation tag) in addition to | 297 | of documentation (including a :documentation tag), in addition to |
| 297 | documentation, or not at all. Supported options are: | 298 | documentation, or not at all. Supported options are: |
| 298 | 299 | ||
| 299 | :documentation - The doc-string used for this class. | 300 | :documentation - The doc-string used for this class. |
| 300 | 301 | ||
| 301 | Options added to EIEIO: | 302 | Options added to EIEIO: |
| 302 | 303 | ||
| 303 | :allow-nil-initform - Non-nil to skip typechecking of initforms if nil. | 304 | :allow-nil-initform - Non-nil to skip typechecking of null initforms. |
| 304 | :custom-groups - List of custom group names. Organizes slots into | 305 | :custom-groups - List of custom group names. Organizes slots into |
| 305 | reasonable groups for customizations. | 306 | reasonable groups for customizations. |
| 306 | :abstract - Non-nil to prevent instances of this class. | 307 | :abstract - Non-nil to prevent instances of this class. |
| @@ -318,8 +319,8 @@ Options in CLOS not supported in EIEIO: | |||
| 318 | :default-initargs - Initargs to use when initializing new objects of | 319 | :default-initargs - Initargs to use when initializing new objects of |
| 319 | this class. | 320 | this class. |
| 320 | 321 | ||
| 321 | Due to the way class options are set up, you can add any tags in you | 322 | Due to the way class options are set up, you can add any tags you wish, |
| 322 | wish, and reference them using the function `class-option'." | 323 | and reference them using the function `class-option'." |
| 323 | ;; We must `eval-and-compile' this so that when we byte compile | 324 | ;; We must `eval-and-compile' this so that when we byte compile |
| 324 | ;; an eieio program, there is no need to load it ahead of time. | 325 | ;; an eieio program, there is no need to load it ahead of time. |
| 325 | ;; It also provides lots of nice debugging errors at compile time. | 326 | ;; It also provides lots of nice debugging errors at compile time. |
| @@ -406,15 +407,15 @@ It creates an autoload function for CNAME's constructor." | |||
| 406 | )))) | 407 | )))) |
| 407 | 408 | ||
| 408 | (defsubst eieio-class-un-autoload (cname) | 409 | (defsubst eieio-class-un-autoload (cname) |
| 409 | "If class CNAME is in an autoload state, load it's file." | 410 | "If class CNAME is in an autoload state, load its file." |
| 410 | (when (eq (car-safe (symbol-function cname)) 'autoload) | 411 | (when (eq (car-safe (symbol-function cname)) 'autoload) |
| 411 | (load-library (car (cdr (symbol-function cname)))))) | 412 | (load-library (car (cdr (symbol-function cname)))))) |
| 412 | 413 | ||
| 413 | (defun eieio-defclass (cname superclasses slots options-and-doc) | 414 | (defun eieio-defclass (cname superclasses slots options-and-doc) |
| 414 | "See `defclass' for more information. | 415 | "Define CNAME as a new subclass of SUPERCLASSES. |
| 415 | Define CNAME as a new subclass of SUPERCLASSES, with SLOTS being the | 416 | SLOTS are the slots residing in that class definition, and options or |
| 416 | slots residing in that class definition, and with options or documentation | 417 | documentation OPTIONS-AND-DOC is the toplevel documentation for this class. |
| 417 | OPTIONS-AND-DOC as the toplevel documentation for this class." | 418 | See `defclass' for more information." |
| 418 | ;; Run our eieio-hook each time, and clear it when we are done. | 419 | ;; Run our eieio-hook each time, and clear it when we are done. |
| 419 | ;; This way people can add hooks safely if they want to modify eieio | 420 | ;; This way people can add hooks safely if they want to modify eieio |
| 420 | ;; or add definitions when eieio is loaded or something like that. | 421 | ;; or add definitions when eieio is loaded or something like that. |
| @@ -434,7 +435,7 @@ OPTIONS-AND-DOC as the toplevel documentation for this class." | |||
| 434 | (aset newc 0 'defclass) | 435 | (aset newc 0 'defclass) |
| 435 | (aset newc class-symbol cname) | 436 | (aset newc class-symbol cname) |
| 436 | 437 | ||
| 437 | ;; If this class already existed, and we are updating it's structure, | 438 | ;; If this class already existed, and we are updating its structure, |
| 438 | ;; make sure we keep the old child list. This can cause bugs, but | 439 | ;; make sure we keep the old child list. This can cause bugs, but |
| 439 | ;; if no new slots are created, it also saves time, and prevents | 440 | ;; if no new slots are created, it also saves time, and prevents |
| 440 | ;; method table breakage, particularly when the users is only | 441 | ;; method table breakage, particularly when the users is only |
| @@ -793,7 +794,7 @@ OPTIONS-AND-DOC as the toplevel documentation for this class." | |||
| 793 | 794 | ||
| 794 | (defun eieio-perform-slot-validation-for-default (slot spec value skipnil) | 795 | (defun eieio-perform-slot-validation-for-default (slot spec value skipnil) |
| 795 | "For SLOT, signal if SPEC does not match VALUE. | 796 | "For SLOT, signal if SPEC does not match VALUE. |
| 796 | If SKIPNIL is non-nil, then if VALUE is nil, return t." | 797 | If SKIPNIL is non-nil, then if VALUE is nil return t instead." |
| 797 | (let ((val (eieio-default-eval-maybe value))) | 798 | (let ((val (eieio-default-eval-maybe value))) |
| 798 | (if (and (not eieio-skip-typecheck) | 799 | (if (and (not eieio-skip-typecheck) |
| 799 | (not (and skipnil (null val))) | 800 | (not (and skipnil (null val))) |
| @@ -804,10 +805,10 @@ If SKIPNIL is non-nil, then if VALUE is nil, return t." | |||
| 804 | &optional defaultoverride skipnil) | 805 | &optional defaultoverride skipnil) |
| 805 | "Add into NEWC attribute A. | 806 | "Add into NEWC attribute A. |
| 806 | If A already exists in NEWC, then do nothing. If it doesn't exist, | 807 | If A already exists in NEWC, then do nothing. If it doesn't exist, |
| 807 | then also add in D (defualt), DOC, TYPE, CUST, LABEL, CUSTG, PRINT, PROT, and INIT arg. | 808 | then also add in D (default), DOC, TYPE, CUST, LABEL, CUSTG, PRINT, PROT, and INIT arg. |
| 808 | Argument ALLOC specifies if the slot is allocated per instance, or per class. | 809 | Argument ALLOC specifies if the slot is allocated per instance, or per class. |
| 809 | If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC, | 810 | If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC, |
| 810 | we must override it's value for a default. | 811 | we must override its value for a default. |
| 811 | Optional argument SKIPNIL indicates if type checking should be skipped | 812 | Optional argument SKIPNIL indicates if type checking should be skipped |
| 812 | if default value is nil." | 813 | if default value is nil." |
| 813 | ;; Make sure we duplicate those items that are sequences. | 814 | ;; Make sure we duplicate those items that are sequences. |
| @@ -856,7 +857,7 @@ if default value is nil." | |||
| 856 | (tp (if np (nth num (aref newc class-public-type)))) | 857 | (tp (if np (nth num (aref newc class-public-type)))) |
| 857 | ) | 858 | ) |
| 858 | (if (not np) | 859 | (if (not np) |
| 859 | (error "Eieio internal error overriding default value for %s" | 860 | (error "EIEIO internal error overriding default value for %s" |
| 860 | a) | 861 | a) |
| 861 | ;; If type is passed in, is it the same? | 862 | ;; If type is passed in, is it the same? |
| 862 | (if (not (eq type t)) | 863 | (if (not (eq type t)) |
| @@ -964,7 +965,7 @@ if default value is nil." | |||
| 964 | (tp (if np (nth num (aref newc class-class-allocation-type)) | 965 | (tp (if np (nth num (aref newc class-class-allocation-type)) |
| 965 | nil))) | 966 | nil))) |
| 966 | (if (not np) | 967 | (if (not np) |
| 967 | (error "Eieio internal error overriding default value for %s" | 968 | (error "EIEIO internal error overriding default value for %s" |
| 968 | a) | 969 | a) |
| 969 | ;; If type is passed in, is it the same? | 970 | ;; If type is passed in, is it the same? |
| 970 | (if (not (eq type t)) | 971 | (if (not (eq type t)) |
| @@ -1121,11 +1122,11 @@ a string." | |||
| 1121 | ;;; CLOS methods and generics | 1122 | ;;; CLOS methods and generics |
| 1122 | ;; | 1123 | ;; |
| 1123 | (defmacro defgeneric (method args &optional doc-string) | 1124 | (defmacro defgeneric (method args &optional doc-string) |
| 1124 | "Create a generic function METHOD. ARGS is ignored. | 1125 | "Create a generic function METHOD. |
| 1125 | DOC-STRING is the base documentation for this class. A generic | 1126 | DOC-STRING is the base documentation for this class. A generic |
| 1126 | function has no body, as it's purpose is to decide which method body | 1127 | function has no body, as its purpose is to decide which method body |
| 1127 | is appropriate to use. Use `defmethod' to create methods, and it | 1128 | is appropriate to use. Uses `defmethod' to create methods, and calls |
| 1128 | calls defgeneric for you. With this implementation the arguments are | 1129 | `defgeneric' for you. With this implementation the ARGS are |
| 1129 | currently ignored. You can use `defgeneric' to apply specialized | 1130 | currently ignored. You can use `defgeneric' to apply specialized |
| 1130 | top level documentation to a method." | 1131 | top level documentation to a method." |
| 1131 | `(eieio-defgeneric (quote ,method) ,doc-string)) | 1132 | `(eieio-defgeneric (quote ,method) ,doc-string)) |
| @@ -1242,21 +1243,21 @@ IMPL is the symbol holding the method implementation." | |||
| 1242 | 'method)) | 1243 | 'method)) |
| 1243 | 1244 | ||
| 1244 | (defun eieio-unbind-method-implementations (method) | 1245 | (defun eieio-unbind-method-implementations (method) |
| 1245 | "Make the generic method METHOD have no implementations.. | 1246 | "Make the generic method METHOD have no implementations. |
| 1246 | It will leave the original generic function in place, but remove | 1247 | It will leave the original generic function in place, |
| 1247 | reference to all implementations of METHOD." | 1248 | but remove reference to all implementations of METHOD." |
| 1248 | (put method 'eieio-method-tree nil) | 1249 | (put method 'eieio-method-tree nil) |
| 1249 | (put method 'eieio-method-obarray nil)) | 1250 | (put method 'eieio-method-obarray nil)) |
| 1250 | 1251 | ||
| 1251 | (defmacro defmethod (method &rest args) | 1252 | (defmacro defmethod (method &rest args) |
| 1252 | "Create a new METHOD through `defgeneric' with ARGS. | 1253 | "Create a new METHOD through `defgeneric' with ARGS. |
| 1253 | 1254 | ||
| 1254 | The second optional argument KEY is a specifier that | 1255 | The optional second argument KEY is a specifier that |
| 1255 | modifies how the method is called, including: | 1256 | modifies how the method is called, including: |
| 1256 | :before - Method will be called before the :primary | 1257 | :before - Method will be called before the :primary |
| 1257 | :primary - The default if not specified. | 1258 | :primary - The default if not specified |
| 1258 | :after - Method will be called after the :primary | 1259 | :after - Method will be called after the :primary |
| 1259 | :static - First arg could be an object or class | 1260 | :static - First arg could be an object or class |
| 1260 | The next argument is the ARGLIST. The ARGLIST specifies the arguments | 1261 | The next argument is the ARGLIST. The ARGLIST specifies the arguments |
| 1261 | to the method as with `defun'. The first argument can have a type | 1262 | to the method as with `defun'. The first argument can have a type |
| 1262 | specifier, such as: | 1263 | specifier, such as: |
| @@ -1311,7 +1312,7 @@ Summary: | |||
| 1311 | (eieio-defgeneric | 1312 | (eieio-defgeneric |
| 1312 | method | 1313 | method |
| 1313 | (if (stringp (car body)) | 1314 | (if (stringp (car body)) |
| 1314 | (car body) (format "Generically created method `%s'" method))) | 1315 | (car body) (format "Generically created method `%s'." method))) |
| 1315 | ;; create symbol for property to bind to. If the first arg is of | 1316 | ;; create symbol for property to bind to. If the first arg is of |
| 1316 | ;; the form (varname vartype) and `vartype' is a class, then | 1317 | ;; the form (varname vartype) and `vartype' is a class, then |
| 1317 | ;; that class will be the type symbol. If not, then it will fall | 1318 | ;; that class will be the type symbol. If not, then it will fall |
| @@ -1360,10 +1361,10 @@ Summary: | |||
| 1360 | (typep value spec))) | 1361 | (typep value spec))) |
| 1361 | 1362 | ||
| 1362 | (defun eieio-validate-slot-value (class slot-idx value slot) | 1363 | (defun eieio-validate-slot-value (class slot-idx value slot) |
| 1363 | "Make sure that for CLASS referencing SLOT-IDX, that VALUE is valid. | 1364 | "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid. |
| 1364 | Checks the :type specifier. | 1365 | Checks the :type specifier. |
| 1365 | SLOT is the slot that is being checked, and is only used when throwing | 1366 | SLOT is the slot that is being checked, and is only used when throwing |
| 1366 | and error." | 1367 | an error." |
| 1367 | (if eieio-skip-typecheck | 1368 | (if eieio-skip-typecheck |
| 1368 | nil | 1369 | nil |
| 1369 | ;; Trim off object IDX junk added in for the object index. | 1370 | ;; Trim off object IDX junk added in for the object index. |
| @@ -1373,10 +1374,10 @@ and error." | |||
| 1373 | (signal 'invalid-slot-type (list class slot st value)))))) | 1374 | (signal 'invalid-slot-type (list class slot st value)))))) |
| 1374 | 1375 | ||
| 1375 | (defun eieio-validate-class-slot-value (class slot-idx value slot) | 1376 | (defun eieio-validate-class-slot-value (class slot-idx value slot) |
| 1376 | "Make sure that for CLASS referencing SLOT-IDX, that VALUE is valid. | 1377 | "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid. |
| 1377 | Checks the :type specifier. | 1378 | Checks the :type specifier. |
| 1378 | SLOT is the slot that is being checked, and is only used when throwing | 1379 | SLOT is the slot that is being checked, and is only used when throwing |
| 1379 | and error." | 1380 | an error." |
| 1380 | (if eieio-skip-typecheck | 1381 | (if eieio-skip-typecheck |
| 1381 | nil | 1382 | nil |
| 1382 | (let ((st (aref (aref (class-v class) class-class-allocation-type) | 1383 | (let ((st (aref (aref (class-v class) class-class-allocation-type) |
| @@ -1418,7 +1419,7 @@ created by the :initarg tag." | |||
| 1418 | (aref (aref (class-v class) class-class-allocation-values) c) | 1419 | (aref (aref (class-v class) class-class-allocation-values) c) |
| 1419 | ;; The slot-missing method is a cool way of allowing an object author | 1420 | ;; The slot-missing method is a cool way of allowing an object author |
| 1420 | ;; to intercept missing slot definitions. Since it is also the LAST | 1421 | ;; to intercept missing slot definitions. Since it is also the LAST |
| 1421 | ;; thing called in this fn, it's return value would be retrieved. | 1422 | ;; thing called in this fn, its return value would be retrieved. |
| 1422 | (slot-missing obj slot 'oref) | 1423 | (slot-missing obj slot 'oref) |
| 1423 | ;;(signal 'invalid-slot-name (list (object-name obj) slot)) | 1424 | ;;(signal 'invalid-slot-name (list (object-name obj) slot)) |
| 1424 | ) | 1425 | ) |
| @@ -1430,15 +1431,15 @@ created by the :initarg tag." | |||
| 1430 | (defalias 'set-slot-value 'eieio-oset) | 1431 | (defalias 'set-slot-value 'eieio-oset) |
| 1431 | 1432 | ||
| 1432 | (defmacro oref-default (obj slot) | 1433 | (defmacro oref-default (obj slot) |
| 1433 | "Gets the default value of OBJ (maybe a class) for SLOT. | 1434 | "Get the default value of OBJ (maybe a class) for SLOT. |
| 1434 | The default value is the value installed in a class with the :initform | 1435 | The default value is the value installed in a class with the :initform |
| 1435 | tag. SLOT can be the slot name, or the tag specified by the :initarg | 1436 | tag. SLOT can be the slot name, or the tag specified by the :initarg |
| 1436 | tag in the `defclass' call." | 1437 | tag in the `defclass' call." |
| 1437 | `(eieio-oref-default ,obj (quote ,slot))) | 1438 | `(eieio-oref-default ,obj (quote ,slot))) |
| 1438 | 1439 | ||
| 1439 | (defun eieio-oref-default (obj slot) | 1440 | (defun eieio-oref-default (obj slot) |
| 1440 | "Does the work for the macro `oref-default' with similar parameters. | 1441 | "Do the work for the macro `oref-default' with similar parameters. |
| 1441 | Fills in OBJ's SLOT with it's default value." | 1442 | Fills in OBJ's SLOT with its default value." |
| 1442 | (if (not (or (eieio-object-p obj) (class-p obj))) (signal 'wrong-type-argument (list 'eieio-object-p obj))) | 1443 | (if (not (or (eieio-object-p obj) (class-p obj))) (signal 'wrong-type-argument (list 'eieio-object-p obj))) |
| 1443 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) | 1444 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) |
| 1444 | (let* ((cl (if (eieio-object-p obj) (aref obj object-class) obj)) | 1445 | (let* ((cl (if (eieio-object-p obj) (aref obj object-class) obj)) |
| @@ -1476,7 +1477,7 @@ with in the :initarg slot. VALUE can be any Lisp object." | |||
| 1476 | `(eieio-oset ,obj (quote ,slot) ,value)) | 1477 | `(eieio-oset ,obj (quote ,slot) ,value)) |
| 1477 | 1478 | ||
| 1478 | (defun eieio-oset (obj slot value) | 1479 | (defun eieio-oset (obj slot value) |
| 1479 | "Does the work for the macro `oset'. | 1480 | "Do the work for the macro `oset'. |
| 1480 | Fills in OBJ's SLOT with VALUE." | 1481 | Fills in OBJ's SLOT with VALUE." |
| 1481 | (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) | 1482 | (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) |
| 1482 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) | 1483 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) |
| @@ -1507,7 +1508,7 @@ after they are created." | |||
| 1507 | `(eieio-oset-default ,class (quote ,slot) ,value)) | 1508 | `(eieio-oset-default ,class (quote ,slot) ,value)) |
| 1508 | 1509 | ||
| 1509 | (defun eieio-oset-default (class slot value) | 1510 | (defun eieio-oset-default (class slot value) |
| 1510 | "Does the work for the macro `oset-default'. | 1511 | "Do the work for the macro `oset-default'. |
| 1511 | Fills in the default value in CLASS' in SLOT with VALUE." | 1512 | Fills in the default value in CLASS' in SLOT with VALUE." |
| 1512 | (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) | 1513 | (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) |
| 1513 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) | 1514 | (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) |
| @@ -1551,7 +1552,7 @@ SPEC-LIST is of a form similar to `let'. For example: | |||
| 1551 | (VARN+1 SLOTN+1)) | 1552 | (VARN+1 SLOTN+1)) |
| 1552 | 1553 | ||
| 1553 | Where each VAR is the local variable given to the associated | 1554 | Where each VAR is the local variable given to the associated |
| 1554 | SLOT. A Slot specified without a variable name is given a | 1555 | SLOT. A slot specified without a variable name is given a |
| 1555 | variable name of the same name as the slot." | 1556 | variable name of the same name as the slot." |
| 1556 | ;; Transform the spec-list into a symbol-macrolet spec-list. | 1557 | ;; Transform the spec-list into a symbol-macrolet spec-list. |
| 1557 | (let ((mappings (mapcar (lambda (entry) | 1558 | (let ((mappings (mapcar (lambda (entry) |
| @@ -1648,7 +1649,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function." | |||
| 1648 | (defalias 'obj-of-class-p 'object-of-class-p) | 1649 | (defalias 'obj-of-class-p 'object-of-class-p) |
| 1649 | 1650 | ||
| 1650 | (defun child-of-class-p (child class) | 1651 | (defun child-of-class-p (child class) |
| 1651 | "If CHILD class is a subclass of CLASS." | 1652 | "Return non-nil if CHILD class is a subclass of CLASS." |
| 1652 | (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) | 1653 | (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) |
| 1653 | (if (not (class-p child)) (signal 'wrong-type-argument (list 'class-p child))) | 1654 | (if (not (class-p child)) (signal 'wrong-type-argument (list 'class-p child))) |
| 1654 | (let ((p nil)) | 1655 | (let ((p nil)) |
| @@ -1658,7 +1659,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function." | |||
| 1658 | p (cdr p))) | 1659 | p (cdr p))) |
| 1659 | (if child t))) | 1660 | (if child t))) |
| 1660 | 1661 | ||
| 1661 | (defun object-slots (obj) "List of slots available in OBJ." | 1662 | (defun object-slots (obj) "Return list of slots available in OBJ." |
| 1662 | (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) | 1663 | (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) |
| 1663 | (aref (class-v (object-class-fast obj)) class-public-a)) | 1664 | (aref (class-v (object-class-fast obj)) class-public-a)) |
| 1664 | 1665 | ||
| @@ -1675,7 +1676,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function." | |||
| 1675 | ;;; CLOS queries into classes and slots | 1676 | ;;; CLOS queries into classes and slots |
| 1676 | ;; | 1677 | ;; |
| 1677 | (defun slot-boundp (object slot) | 1678 | (defun slot-boundp (object slot) |
| 1678 | "Non-nil if OBJECT's SLOT is bound. | 1679 | "Return non-nil if OBJECT's SLOT is bound. |
| 1679 | Setting a slot's value makes it bound. Calling `slot-makeunbound' will | 1680 | Setting a slot's value makes it bound. Calling `slot-makeunbound' will |
| 1680 | make a slot unbound. | 1681 | make a slot unbound. |
| 1681 | OBJECT can be an instance or a class." | 1682 | OBJECT can be an instance or a class." |
| @@ -1693,7 +1694,7 @@ OBJECT can be an instance or a class." | |||
| 1693 | (eieio-oset object slot eieio-unbound)) | 1694 | (eieio-oset object slot eieio-unbound)) |
| 1694 | 1695 | ||
| 1695 | (defun slot-exists-p (object-or-class slot) | 1696 | (defun slot-exists-p (object-or-class slot) |
| 1696 | "Non-nil if OBJECT-OR-CLASS has SLOT." | 1697 | "Return non-nil if OBJECT-OR-CLASS has SLOT." |
| 1697 | (let ((cv (class-v (cond ((eieio-object-p object-or-class) | 1698 | (let ((cv (class-v (cond ((eieio-object-p object-or-class) |
| 1698 | (object-class object-or-class)) | 1699 | (object-class object-or-class)) |
| 1699 | ((class-p object-or-class) | 1700 | ((class-p object-or-class) |
| @@ -1716,7 +1717,7 @@ If ERRORP is non-nil, `wrong-argument-type' is signaled." | |||
| 1716 | ;; | 1717 | ;; |
| 1717 | (defun object-assoc (key slot list) | 1718 | (defun object-assoc (key slot list) |
| 1718 | "Return an object if KEY is `equal' to SLOT's value of an object in LIST. | 1719 | "Return an object if KEY is `equal' to SLOT's value of an object in LIST. |
| 1719 | LIST is a list of objects who's slots are searched. | 1720 | LIST is a list of objects whose slots are searched. |
| 1720 | Objects in LIST do not need to have a slot named SLOT, nor does | 1721 | Objects in LIST do not need to have a slot named SLOT, nor does |
| 1721 | SLOT need to be bound. If these errors occur, those objects will | 1722 | SLOT need to be bound. If these errors occur, those objects will |
| 1722 | be ignored." | 1723 | be ignored." |
| @@ -1781,7 +1782,7 @@ If SLOT is unbound, bind it to the list containing ITEM." | |||
| 1781 | 1782 | ||
| 1782 | (defun object-remove-from-list (object slot item) | 1783 | (defun object-remove-from-list (object slot item) |
| 1783 | "In OBJECT's SLOT, remove occurrences of ITEM. | 1784 | "In OBJECT's SLOT, remove occurrences of ITEM. |
| 1784 | Deletion is done with `delete', which deletes by side effect | 1785 | Deletion is done with `delete', which deletes by side effect, |
| 1785 | and comparisons are done with `equal'. | 1786 | and comparisons are done with `equal'. |
| 1786 | If SLOT is unbound, do nothing." | 1787 | If SLOT is unbound, do nothing." |
| 1787 | (if (not (slot-boundp object slot)) | 1788 | (if (not (slot-boundp object slot)) |
| @@ -1791,7 +1792,7 @@ If SLOT is unbound, do nothing." | |||
| 1791 | ;;; EIEIO internal search functions | 1792 | ;;; EIEIO internal search functions |
| 1792 | ;; | 1793 | ;; |
| 1793 | (defun eieio-slot-originating-class-p (start-class slot) | 1794 | (defun eieio-slot-originating-class-p (start-class slot) |
| 1794 | "Return Non-nil if START-CLASS is the first class to define SLOT. | 1795 | "Return non-nil if START-CLASS is the first class to define SLOT. |
| 1795 | This is for testing if `scoped-class' is the class that defines SLOT | 1796 | This is for testing if `scoped-class' is the class that defines SLOT |
| 1796 | so that we can protect private slots." | 1797 | so that we can protect private slots." |
| 1797 | (let ((par (class-parents start-class)) | 1798 | (let ((par (class-parents start-class)) |
| @@ -1810,7 +1811,7 @@ so that we can protect private slots." | |||
| 1810 | "In CLASS for OBJ find the index of the named SLOT. | 1811 | "In CLASS for OBJ find the index of the named SLOT. |
| 1811 | The slot is a symbol which is installed in CLASS by the `defclass' | 1812 | The slot is a symbol which is installed in CLASS by the `defclass' |
| 1812 | call. OBJ can be nil, but if it is an object, and the slot in question | 1813 | call. OBJ can be nil, but if it is an object, and the slot in question |
| 1813 | is protected, access will be allowed if obj is a child of the currently | 1814 | is protected, access will be allowed if OBJ is a child of the currently |
| 1814 | `scoped-class'. | 1815 | `scoped-class'. |
| 1815 | If SLOT is the value created with :initarg instead, | 1816 | If SLOT is the value created with :initarg instead, |
| 1816 | reverse-lookup that name, and recurse with the associated slot value." | 1817 | reverse-lookup that name, and recurse with the associated slot value." |
| @@ -1869,7 +1870,7 @@ is called, the next method is popped off the stack.") | |||
| 1869 | 1870 | ||
| 1870 | (defvar eieio-pre-method-execution-hooks nil | 1871 | (defvar eieio-pre-method-execution-hooks nil |
| 1871 | "*Hooks run just before a method is executed. | 1872 | "*Hooks run just before a method is executed. |
| 1872 | The hook function must accept on argument, this list of forms | 1873 | The hook function must accept one argument, the list of forms |
| 1873 | about to be executed.") | 1874 | about to be executed.") |
| 1874 | 1875 | ||
| 1875 | (defun eieio-generic-call (method args) | 1876 | (defun eieio-generic-call (method args) |
| @@ -2122,7 +2123,7 @@ If CLASS is nil, then an empty list of methods should be returned." | |||
| 2122 | (nreverse lambdas)))) | 2123 | (nreverse lambdas)))) |
| 2123 | 2124 | ||
| 2124 | (defun next-method-p () | 2125 | (defun next-method-p () |
| 2125 | "Non-nil if there is a next method. | 2126 | "Return non-nil if there is a next method. |
| 2126 | Returns a list of lambda expressions which is the `next-method' | 2127 | Returns a list of lambda expressions which is the `next-method' |
| 2127 | order." | 2128 | order." |
| 2128 | eieio-generic-call-next-method-list) | 2129 | eieio-generic-call-next-method-list) |
| @@ -2138,7 +2139,7 @@ arguments passed in at the top level. | |||
| 2138 | 2139 | ||
| 2139 | Use `next-method-p' to find out if there is a next method to call." | 2140 | Use `next-method-p' to find out if there is a next method to call." |
| 2140 | (if (not scoped-class) | 2141 | (if (not scoped-class) |
| 2141 | (error "Call-next-method not called within a class specific method")) | 2142 | (error "`call-next-method' not called within a class specific method")) |
| 2142 | (if (and (/= eieio-generic-call-key method-primary) | 2143 | (if (and (/= eieio-generic-call-key method-primary) |
| 2143 | (/= eieio-generic-call-key method-static)) | 2144 | (/= eieio-generic-call-key method-static)) |
| 2144 | (error "Cannot `call-next-method' except in :primary or :static methods") | 2145 | (error "Cannot `call-next-method' except in :primary or :static methods") |
| @@ -2204,7 +2205,7 @@ is associated with the :static :before :primary and :after tags. | |||
| 2204 | It also indicates if CLASS is defined or not. | 2205 | It also indicates if CLASS is defined or not. |
| 2205 | CLASS is the class this method is associated with." | 2206 | CLASS is the class this method is associated with." |
| 2206 | (if (or (> key method-num-slots) (< key 0)) | 2207 | (if (or (> key method-num-slots) (< key 0)) |
| 2207 | (error "Eieiomt-add: method key error!")) | 2208 | (error "eieiomt-add: method key error!")) |
| 2208 | (let ((emtv (get method-name 'eieio-method-tree)) | 2209 | (let ((emtv (get method-name 'eieio-method-tree)) |
| 2209 | (emto (get method-name 'eieio-method-obarray))) | 2210 | (emto (get method-name 'eieio-method-obarray))) |
| 2210 | ;; Make sure the method tables are available. | 2211 | ;; Make sure the method tables are available. |
| @@ -2229,10 +2230,10 @@ CLASS is the class this method is associated with." | |||
| 2229 | 2230 | ||
| 2230 | (defun eieiomt-next (class) | 2231 | (defun eieiomt-next (class) |
| 2231 | "Return the next parent class for CLASS. | 2232 | "Return the next parent class for CLASS. |
| 2232 | If CLASS is a superclass, return variable `eieio-default-superclass'. If CLASS | 2233 | If CLASS is a superclass, return variable `eieio-default-superclass'. |
| 2233 | is variable `eieio-default-superclass' then return nil. This is different from | 2234 | If CLASS is variable `eieio-default-superclass' then return nil. |
| 2234 | function `class-parent' as class parent returns nil for superclasses. This | 2235 | This is different from function `class-parent' as class parent returns |
| 2235 | function performs no type checking!" | 2236 | nil for superclasses. This function performs no type checking!" |
| 2236 | ;; No type-checking because all calls are made from functions which | 2237 | ;; No type-checking because all calls are made from functions which |
| 2237 | ;; are safe and do checking for us. | 2238 | ;; are safe and do checking for us. |
| 2238 | (or (class-parents-fast class) | 2239 | (or (class-parents-fast class) |
| @@ -2249,7 +2250,7 @@ function performs no type checking!" | |||
| 2249 | (cont t)) | 2250 | (cont t)) |
| 2250 | ;; This converts ES from a single symbol to a list of parent classes. | 2251 | ;; This converts ES from a single symbol to a list of parent classes. |
| 2251 | (setq es (eieiomt-next es)) | 2252 | (setq es (eieiomt-next es)) |
| 2252 | ;; Loop over ES, then it's children individually. | 2253 | ;; Loop over ES, then its children individually. |
| 2253 | ;; We can have multiple hits only at one level of the parent tree. | 2254 | ;; We can have multiple hits only at one level of the parent tree. |
| 2254 | (while (and es cont) | 2255 | (while (and es cont) |
| 2255 | (setq ov (intern-soft (symbol-name (car es)) eieiomt-optimizing-obarray)) | 2256 | (setq ov (intern-soft (symbol-name (car es)) eieiomt-optimizing-obarray)) |
| @@ -2271,10 +2272,10 @@ function performs no type checking!" | |||
| 2271 | 2272 | ||
| 2272 | (defun eieio-generic-form (method key class) | 2273 | (defun eieio-generic-form (method key class) |
| 2273 | "Return the lambda form belonging to METHOD using KEY based upon CLASS. | 2274 | "Return the lambda form belonging to METHOD using KEY based upon CLASS. |
| 2274 | If CLASS is not a class then use `generic' instead. If class has no | 2275 | If CLASS is not a class then use `generic' instead. If class has |
| 2275 | form, but has a parent class, then trace to that parent class. The | 2276 | no form, but has a parent class, then trace to that parent class. |
| 2276 | first time a form is requested from a symbol, an optimized path is | 2277 | The first time a form is requested from a symbol, an optimized path |
| 2277 | memorized for future faster use." | 2278 | is memorized for future faster use." |
| 2278 | (let ((emto (aref (get method 'eieio-method-obarray) | 2279 | (let ((emto (aref (get method 'eieio-method-obarray) |
| 2279 | (if class key (+ key 3))))) | 2280 | (if class key (+ key 3))))) |
| 2280 | (if (class-p class) | 2281 | (if (class-p class) |
| @@ -2285,7 +2286,7 @@ memorized for future faster use." | |||
| 2285 | ;; This can be slow since it only occurs once | 2286 | ;; This can be slow since it only occurs once |
| 2286 | (progn | 2287 | (progn |
| 2287 | (setq cs (intern (symbol-name class) emto)) | 2288 | (setq cs (intern (symbol-name class) emto)) |
| 2288 | ;; 2.1) Cache it's nearest neighbor with a quick optimize | 2289 | ;; 2.1) Cache its nearest neighbor with a quick optimize |
| 2289 | ;; which should only occur once for this call ever | 2290 | ;; which should only occur once for this call ever |
| 2290 | (let ((eieiomt-optimizing-obarray emto)) | 2291 | (let ((eieiomt-optimizing-obarray emto)) |
| 2291 | (eieiomt-sym-optimize cs)))) | 2292 | (eieiomt-sym-optimize cs)))) |
| @@ -2295,7 +2296,7 @@ memorized for future faster use." | |||
| 2295 | ;; 4) If it's not bound then this variable knows something | 2296 | ;; 4) If it's not bound then this variable knows something |
| 2296 | (if (symbol-value cs) | 2297 | (if (symbol-value cs) |
| 2297 | (progn | 2298 | (progn |
| 2298 | ;; 4.1) This symbol holds the next class in it's value | 2299 | ;; 4.1) This symbol holds the next class in its value |
| 2299 | (setq class (symbol-value cs) | 2300 | (setq class (symbol-value cs) |
| 2300 | cs (intern-soft (symbol-name class) emto)) | 2301 | cs (intern-soft (symbol-name class) emto)) |
| 2301 | ;; 4.2) The optimizer should always have chosen a | 2302 | ;; 4.2) The optimizer should always have chosen a |
| @@ -2337,7 +2338,7 @@ not nil." | |||
| 2337 | (defun eieio-initarg-to-attribute (class initarg) | 2338 | (defun eieio-initarg-to-attribute (class initarg) |
| 2338 | "For CLASS, convert INITARG to the actual attribute name. | 2339 | "For CLASS, convert INITARG to the actual attribute name. |
| 2339 | If there is no translation, pass it in directly (so we can cheat if | 2340 | If there is no translation, pass it in directly (so we can cheat if |
| 2340 | need be.. May remove that later...)" | 2341 | need be... May remove that later...)" |
| 2341 | (let ((tuple (assoc initarg (aref (class-v class) class-initarg-tuples)))) | 2342 | (let ((tuple (assoc initarg (aref (class-v class) class-initarg-tuples)))) |
| 2342 | (if tuple | 2343 | (if tuple |
| 2343 | (cdr tuple) | 2344 | (cdr tuple) |
| @@ -2405,18 +2406,18 @@ This is usually a symbol that starts with `:'." | |||
| 2405 | (defclass eieio-default-superclass nil | 2406 | (defclass eieio-default-superclass nil |
| 2406 | nil | 2407 | nil |
| 2407 | "Default parent class for classes with no specified parent class. | 2408 | "Default parent class for classes with no specified parent class. |
| 2408 | Its slots are automatically adopted by classes with no specified | 2409 | Its slots are automatically adopted by classes with no specified parents. |
| 2409 | parents. This class is not stored in the `parent' slot of a class vector." | 2410 | This class is not stored in the `parent' slot of a class vector." |
| 2410 | :abstract t) | 2411 | :abstract t) |
| 2411 | 2412 | ||
| 2412 | (defalias 'standard-class 'eieio-default-superclass) | 2413 | (defalias 'standard-class 'eieio-default-superclass) |
| 2413 | 2414 | ||
| 2414 | (defgeneric constructor (class newname &rest slots) | 2415 | (defgeneric constructor (class newname &rest slots) |
| 2415 | "Default constructor for CLASS `eieio-defualt-superclass'.") | 2416 | "Default constructor for CLASS `eieio-default-superclass'.") |
| 2416 | 2417 | ||
| 2417 | (defmethod constructor :static | 2418 | (defmethod constructor :static |
| 2418 | ((class eieio-default-superclass) newname &rest slots) | 2419 | ((class eieio-default-superclass) newname &rest slots) |
| 2419 | "Default constructor for CLASS `eieio-defualt-superclass'. | 2420 | "Default constructor for CLASS `eieio-default-superclass'. |
| 2420 | NEWNAME is the name to be given to the constructed object. | 2421 | NEWNAME is the name to be given to the constructed object. |
| 2421 | SLOTS are the initialization slots used by `shared-initialize'. | 2422 | SLOTS are the initialization slots used by `shared-initialize'. |
| 2422 | This static method is called when an object is constructed. | 2423 | This static method is called when an object is constructed. |
| @@ -2449,17 +2450,17 @@ Called from the constructor routine." | |||
| 2449 | (setq slots (cdr (cdr slots)))))) | 2450 | (setq slots (cdr (cdr slots)))))) |
| 2450 | 2451 | ||
| 2451 | (defgeneric initialize-instance (this &optional slots) | 2452 | (defgeneric initialize-instance (this &optional slots) |
| 2452 | "Constructs the new object THIS based on SLOTS.") | 2453 | "Construct the new object THIS based on SLOTS.") |
| 2453 | 2454 | ||
| 2454 | (defmethod initialize-instance ((this eieio-default-superclass) | 2455 | (defmethod initialize-instance ((this eieio-default-superclass) |
| 2455 | &optional slots) | 2456 | &optional slots) |
| 2456 | "Constructs the new object THIS based on SLOTS. | 2457 | "Construct the new object THIS based on SLOTS. |
| 2457 | SLOTS is a tagged list where odd numbered elements are tags, and | 2458 | SLOTS is a tagged list where odd numbered elements are tags, and |
| 2458 | even numbered elements are the values to store in the tagged slot. If | 2459 | even numbered elements are the values to store in the tagged slot. |
| 2459 | you overload the `initialize-instance', there you will need to call | 2460 | If you overload the `initialize-instance', there you will need to |
| 2460 | `shared-initialize' yourself, or you can call `call-next-method' to | 2461 | call `shared-initialize' yourself, or you can call `call-next-method' |
| 2461 | have this constructor called automatically. If these steps are not | 2462 | to have this constructor called automatically. If these steps are |
| 2462 | taken, then new objects of your class will not have their values | 2463 | not taken, then new objects of your class will not have their values |
| 2463 | dynamically set from SLOTS." | 2464 | dynamically set from SLOTS." |
| 2464 | ;; First, see if any of our defaults are `lambda', and | 2465 | ;; First, see if any of our defaults are `lambda', and |
| 2465 | ;; re-evaluate them and apply the value to our slots. | 2466 | ;; re-evaluate them and apply the value to our slots. |
| @@ -2526,9 +2527,9 @@ value becomes the return value of the original method call." | |||
| 2526 | &rest args) | 2527 | &rest args) |
| 2527 | "Called from `call-next-method' when no additional methods are available. | 2528 | "Called from `call-next-method' when no additional methods are available. |
| 2528 | OBJECT is othe object being called on `call-next-method'. | 2529 | OBJECT is othe object being called on `call-next-method'. |
| 2529 | ARGS are the arguments it is called by. | 2530 | ARGS are the arguments it is called by. |
| 2530 | This method signals `no-next-method' by default. Override this | 2531 | This method signals `no-next-method' by default. Override this |
| 2531 | method to not throw an error, and it's return value becomes the | 2532 | method to not throw an error, and its return value becomes the |
| 2532 | return value of `call-next-method'." | 2533 | return value of `call-next-method'." |
| 2533 | (signal 'no-next-method (list (object-name object) args)) | 2534 | (signal 'no-next-method (list (object-name object) args)) |
| 2534 | ) | 2535 | ) |
| @@ -2570,7 +2571,7 @@ ignored parameters." | |||
| 2570 | "Pretty printer for object THIS. Call function `object-name' with STRINGS. | 2571 | "Pretty printer for object THIS. Call function `object-name' with STRINGS. |
| 2571 | 2572 | ||
| 2572 | It is sometimes useful to put a summary of the object into the | 2573 | It is sometimes useful to put a summary of the object into the |
| 2573 | default #<notation> string when using eieio browsing tools. | 2574 | default #<notation> string when using EIEIO browsing tools. |
| 2574 | Implement this method to customize the summary.") | 2575 | Implement this method to customize the summary.") |
| 2575 | 2576 | ||
| 2576 | (defmethod object-print ((this eieio-default-superclass) &rest strings) | 2577 | (defmethod object-print ((this eieio-default-superclass) &rest strings) |
| @@ -2579,7 +2580,7 @@ The default method for printing object THIS is to use the | |||
| 2579 | function `object-name'. | 2580 | function `object-name'. |
| 2580 | 2581 | ||
| 2581 | It is sometimes useful to put a summary of the object into the | 2582 | It is sometimes useful to put a summary of the object into the |
| 2582 | default #<notation> string when using eieio browsing tools. | 2583 | default #<notation> string when using EIEIO browsing tools. |
| 2583 | 2584 | ||
| 2584 | Implement this function and specify STRINGS in a call to | 2585 | Implement this function and specify STRINGS in a call to |
| 2585 | `call-next-method' to provide additional summary information. | 2586 | `call-next-method' to provide additional summary information. |
| @@ -2592,7 +2593,7 @@ to prepend a space." | |||
| 2592 | 2593 | ||
| 2593 | (defgeneric object-write (this &optional comment) | 2594 | (defgeneric object-write (this &optional comment) |
| 2594 | "Write out object THIS to the current stream. | 2595 | "Write out object THIS to the current stream. |
| 2595 | Optional COMMENDS will add comments to the beginning of the output.") | 2596 | Optional COMMENT will add comments to the beginning of the output.") |
| 2596 | 2597 | ||
| 2597 | (defmethod object-write ((this eieio-default-superclass) &optional comment) | 2598 | (defmethod object-write ((this eieio-default-superclass) &optional comment) |
| 2598 | "Write object THIS out to the current stream. | 2599 | "Write object THIS out to the current stream. |
| @@ -2644,7 +2645,7 @@ this object." | |||
| 2644 | (princ ")\n"))) | 2645 | (princ ")\n"))) |
| 2645 | 2646 | ||
| 2646 | (defun eieio-override-prin1 (thing) | 2647 | (defun eieio-override-prin1 (thing) |
| 2647 | "Perform a prin1 on THING taking advantage of object knowledge." | 2648 | "Perform a `prin1' on THING taking advantage of object knowledge." |
| 2648 | (cond ((eieio-object-p thing) | 2649 | (cond ((eieio-object-p thing) |
| 2649 | (object-write thing)) | 2650 | (object-write thing)) |
| 2650 | ((listp thing) | 2651 | ((listp thing) |
| @@ -2680,7 +2681,7 @@ this object." | |||
| 2680 | "Change the class of OBJ to type CLASS. | 2681 | "Change the class of OBJ to type CLASS. |
| 2681 | This may create or delete slots, but does not affect the return value | 2682 | This may create or delete slots, but does not affect the return value |
| 2682 | of `eq'." | 2683 | of `eq'." |
| 2683 | (error "Eieio: `change-class' is unimplemented")) | 2684 | (error "EIEIO: `change-class' is unimplemented")) |
| 2684 | 2685 | ||
| 2685 | ) | 2686 | ) |
| 2686 | 2687 | ||
| @@ -2688,7 +2689,8 @@ of `eq'." | |||
| 2688 | ;;; Interfacing with edebug | 2689 | ;;; Interfacing with edebug |
| 2689 | ;; | 2690 | ;; |
| 2690 | (defun eieio-edebug-prin1-to-string (object &optional noescape) | 2691 | (defun eieio-edebug-prin1-to-string (object &optional noescape) |
| 2691 | "Display eieio OBJECT in fancy format. Overrides the edebug default. | 2692 | "Display EIEIO OBJECT in fancy format. |
| 2693 | Overrides the edebug default. | ||
| 2692 | Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate." | 2694 | Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate." |
| 2693 | (cond ((class-p object) (class-name object)) | 2695 | (cond ((class-p object) (class-name object)) |
| 2694 | ((eieio-object-p object) (object-print object)) | 2696 | ((eieio-object-p object) (object-print object)) |