comparison lisp/eieio/eieio-doc.el @ 104404:7602fd69cd93

eieio-doc.el (eieiodoc--class-indexstring, defvar eieiodoc--class-root): New vars. (eieiodoc-class, eieiodoc-one-node) Use them to silence compiler. (eieiodoc-one-node): Use `class' instead of `rclass'. This avoids a compiler warning for free use of `rclass', which IIUC is always equal to `class'.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 22 Aug 2009 14:37:23 +0000
parents 2efe3dc24373
children
comparison
equal deleted inserted replaced
104403:43a04bf4b4a8 104404:7602fd69cd93
49 "Call `eieiodoc-class' after nuking everything from POINT on. 49 "Call `eieiodoc-class' after nuking everything from POINT on.
50 ROOT-CLASS, INDEXSTRING, and SKIPLIST are the same as `eieiodoc-class'." 50 ROOT-CLASS, INDEXSTRING, and SKIPLIST are the same as `eieiodoc-class'."
51 (delete-region (point) (point-max)) 51 (delete-region (point) (point-max))
52 (sit-for 0) 52 (sit-for 0)
53 (eieiodoc-class root-class indexstring skiplist)) 53 (eieiodoc-class root-class indexstring skiplist))
54
55 (defvar eieiodoc--class-indexstring)
56 (defvar eieiodoc--class-root)
54 57
55 (defun eieiodoc-class (root-class indexstring &optional skiplist) 58 (defun eieiodoc-class (root-class indexstring &optional skiplist)
56 "Create documentation starting with ROOT-CLASS. 59 "Create documentation starting with ROOT-CLASS.
57 The first job is to create an indented menu of all the classes 60 The first job is to create an indented menu of all the classes
58 starting with `root-class' and including all it's children. Once this 61 starting with `root-class' and including all it's children. Once this
87 (t "subsubsection"))) 90 (t "subsubsection")))
88 "subsubsection"))) 91 "subsubsection")))
89 (save-excursion 92 (save-excursion
90 (eieiodoc-main-menu root-class skiplist) 93 (eieiodoc-main-menu root-class skiplist)
91 (insert "\n") 94 (insert "\n")
92 (eieiodoc-recurse root-class 'eieiodoc-one-node nil skiplist))) 95 (let ((eieiodoc--class-indexstring indexstring)
96 (eieiodoc--class-root root-class))
97 (eieiodoc-recurse root-class 'eieiodoc-one-node nil skiplist))))
93 98
94 (defun eieiodoc-main-menu (class skiplist) 99 (defun eieiodoc-main-menu (class skiplist)
95 "Create a menu of all classes under CLASS indented the correct amount. 100 "Create a menu of all classes under CLASS indented the correct amount.
96 SKIPLIST is a list of objects to skip" 101 SKIPLIST is a list of objects to skip"
97 (end-of-line) 102 (end-of-line)
111 (if eieiodoc-next-class (symbol-name eieiodoc-next-class) " ") ", " 116 (if eieiodoc-next-class (symbol-name eieiodoc-next-class) " ") ", "
112 (if eieiodoc-prev-class (symbol-name eieiodoc-prev-class) " ") ", " 117 (if eieiodoc-prev-class (symbol-name eieiodoc-prev-class) " ") ", "
113 eieiodoc-currently-in-node "\n" 118 eieiodoc-currently-in-node "\n"
114 "@comment node-name, next, previous, up\n" 119 "@comment node-name, next, previous, up\n"
115 "@" eieiodoc-current-section-level " " (symbol-name class) "\n" 120 "@" eieiodoc-current-section-level " " (symbol-name class) "\n"
116 ;; indexstring is grabbed from parent calling function 121 "@" eieiodoc--class-indexstring
117 "@" indexstring "index " (symbol-name class) "\n\n") 122 "index " (symbol-name class) "\n\n")
118 ;; Now lets create a nifty little inheritance tree 123 ;; Now lets create a nifty little inheritance tree
119 (let ((cl class) 124 (let ((cl class)
120 (revlist nil) 125 (revlist nil)
121 (depth 0)) 126 (depth 0))
122 (while cl 127 (while cl
123 (setq revlist (cons cl revlist) 128 (setq revlist (cons cl revlist)
124 cl (class-parent cl))) 129 cl (class-parent cl)))
125 (insert "@table @asis\n@item Inheritance Tree:\n") 130 (insert "@table @asis\n@item Inheritance Tree:\n")
126 (while revlist 131 (while revlist
127 ;; root-class is dragged in from the top-level function
128 (insert "@table @code\n@item " 132 (insert "@table @code\n@item "
129 (if (and (child-of-class-p (car revlist) root-class) 133 (if (and (child-of-class-p (car revlist) eieiodoc--class-root)
130 (not (eq class (car revlist)))) 134 (not (eq class (car revlist))))
131 (concat "@w{@xref{" (symbol-name (car revlist)) "}.}") 135 (concat "@w{@xref{" (symbol-name (car revlist)) "}.}")
132 (symbol-name (car revlist))) 136 (symbol-name (car revlist)))
133 "\n") 137 "\n")
134 (setq revlist (cdr revlist) 138 (setq revlist (cdr revlist)
135 depth (1+ depth))) 139 depth (1+ depth)))
136 ;; the value of rclass is brought in from caller 140 (let ((clist (reverse (aref (class-v class) class-children))))
137 (let ((clist (reverse (aref (class-v rclass) class-children))))
138 (if (not clist) 141 (if (not clist)
139 (insert "No children") 142 (insert "No children")
140 (insert "@table @asis\n@item Children:\n") 143 (insert "@table @asis\n@item Children:\n")
141 (while clist 144 (while clist
142 (insert "@w{@xref{" (symbol-name (car clist)) "}") 145 (insert "@w{@xref{" (symbol-name (car clist)) "}")