-
-(defun eieio-help-mode-augmentation-maybee (&rest unused)
- "For buffers thrown into help mode, augment for EIEIO.
-Arguments UNUSED are not used."
- ;; Scan created buttons so far if we are in help mode.
- (when (eq major-mode 'help-mode)
- (save-excursion
- (goto-char (point-min))
- (let ((pos t) (inhibit-read-only t))
- (while pos
- (if (get-text-property (point) 'help-xref) ; move off reference
- (goto-char
- (or (next-single-property-change (point) 'help-xref)
- (point))))
- (setq pos (next-single-property-change (point) 'help-xref))
- (when pos
- (goto-char pos)
- (let* ((help-data (get-text-property (point) 'help-xref))
- ;(method (car help-data))
- (args (cdr help-data)))
- (when (symbolp (car args))
- (cond ((class-p (car args))
- (setcar help-data 'eieio-describe-class))
- ((generic-p (car args))
- (setcar help-data 'eieio-describe-generic))
- (t nil))
- ))))
- ;; start back at the beginning, and highlight some sections
- (goto-char (point-min))
- (while (re-search-forward "^\\(Documentation\\|Implementations\\):$" nil t)
- (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
- (goto-char (point-min))
- (if (re-search-forward "^Specialized Methods:$" nil t)
- (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
- (goto-char (point-min))
- (while (re-search-forward "^\\(Instance\\|Class\\) Allocated Slots:$" nil t)
- (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
- (goto-char (point-min))
- (while (re-search-forward ":\\(STATIC\\|BEFORE\\|AFTER\\|PRIMARY\\)" nil t)
- (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
- (goto-char (point-min))
- (while (re-search-forward "^\\(Private \\)?Slot:" nil t)
- (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
- (goto-char (point-min))
- (cond
- ((looking-at "\\(.+\\) is a generic function")
- (let ((mname (match-string 1))
- cname)
- (while (re-search-forward "^`\\(.+\\)'[^\0]+?Defined in `\\(.+\\)'" nil t)
- (setq cname (match-string-no-properties 1))
- (help-xref-button 2 'eieio-method-def cname
- mname
- (cadr (assoc (intern cname)
- (get (intern mname)
- 'method-locations)))))))
- ((looking-at "\\(.+\\) is an object constructor function in `\\(.+\\)'")
- (let ((cname (match-string-no-properties 1)))
- (help-xref-button 2 'eieio-class-def cname
- (get (intern cname) 'class-location))))
- ((looking-at "\\(.+\\) is a\\(n abstract\\)? class in `\\(.+\\)'")
- (let ((cname (match-string-no-properties 1)))
- (help-xref-button 3 'eieio-class-def cname
- (get (intern cname) 'class-location)))))
- ))))
-