Commit 0116ee83 authored by David Engster's avatar David Engster

Proper help support for EIEIO classes and methods.

parents 4b9e6087 0f918d96
2014-01-08 David Engster <>
* help-fns.el (help-fns-describe-function-functions): New
variable to call functions for augmenting help buffers.
(describe-function-1): Remove explicit calls to
`help-fns--compiler-macro', `help-fns--parent-mode' and
`help-fns--obsolete'. Put them in above new variable instead, and
call them through `run-hook-with-args'.
* emacs-lisp/eieio-opt.el (eieio-help-class): Rename from
`eieio-describe-class'. Not meant for interactive use anymore,
but to augment existing help buffers. Remove optional second
argument. Create proper button for file location. Rewrite
function to use `insert' instead of `princ' and `prin1' where
(eieio-help-class-slots): Rename from `eieio-describe-class-slots'.
(eieio-method-def, eieio-class-def): Move further up.
(describe-method, describe-generic, eieio-describe-method): Remove
(eieio-help-constructor, eieio-help-generic): Rename from
`eieio-describe-constructor' and `eieio-describe-generic', resp.
Rewrite to use `insert' in the current buffer and use proper help
(eieio-help-find-class-definition): Also accept symbols as
(eieio-help-mode-augmentation-maybee): Remove.
(eieio-describe-class-sb): Use `describe-function'.
* emacs-lisp/eieio.el (help-fns-describe-function-functions): Add
`eieio-help-generic' and `eieio-help-constructor'.
2014-01-08 Paul Eggert <>
Spelling fixes.
This diff is collapsed.
......@@ -865,6 +865,10 @@ This may create or delete slots, but does not affect the return value
of `eq'."
(error "EIEIO: `change-class' is unimplemented"))
;; Hook ourselves into help system for describing classes and methods.
(add-hook 'help-fns-describe-function-functions 'eieio-help-generic)
(add-hook 'help-fns-describe-function-functions 'eieio-help-constructor)
;;; Interfacing with edebug
(defun eieio-edebug-prin1-to-string (object &optional noescape)
......@@ -32,6 +32,12 @@
;;; Code:
(defvar help-fns-describe-function-functions nil
"List of functions to run in help buffer in `describe-function'.
Those functions will be run after the header line and argument
list was inserted, and before the documentation will be inserted.
The functions will receive the function name as argument.")
;; Functions
......@@ -649,14 +655,15 @@ FILE is the file where FUNCTION was probably defined."
(help-fns--key-bindings function)
(with-current-buffer standard-output
(setq doc (help-fns--signature function doc real-def real-function))
(help-fns--compiler-macro function)
(help-fns--parent-mode function)
(help-fns--obsolete function)
(run-hook-with-args 'help-fns-describe-function-functions function)
(insert "\n"
(or doc "Not documented.")))))))
;; Add defaults to `help-fns-describe-function-functions'.
(add-hook 'help-fns-describe-function-functions 'help-fns--obsolete)
(add-hook 'help-fns-describe-function-functions 'help-fns--parent-mode)
(add-hook 'help-fns-describe-function-functions 'help-fns--compiler-macro)
;; Variables
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment