]> git.eshelyaron.com Git - emacs.git/commit
Improve handling of doc-strings and describe-function for cl-generic
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Jan 2015 03:52:15 +0000 (22:52 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Jan 2015 03:52:15 +0000 (22:52 -0500)
commit24b7f77581c7eefe484db6cbbd661c04460c66aa
tree59bf6bdfba55d0f5aeb73a755e2420ce19ac7c3a
parenta2cd6d90d20408a6265c8615697dbff94df3f098
Improve handling of doc-strings and describe-function for cl-generic

* lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long
as it's a symbol.
(help-fns-short-filename): New function.
(describe-function-1): Use it.  Use autoload-do-load.

* lisp/help-mode.el (help-function-def): Add optional arg `type'.

* lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to
override an autoload.
(cl-generic-current-method-specializers): Replace dyn-bind variable
with a lexically-scoped macro.
(cl--generic-lambda): Update accordingly.
(cl-generic-define-method): Record manually in the load-history with
type `cl-defmethod'.
(cl--generic-get-dispatcher): Minor optimization.
(cl--generic-search-method): New function.
(find-function-regexp-alist): Add entry for `cl-defmethod' type.
(cl--generic-search-method): Add hyperlinks for methods.  Merge the
specializers and the function's arguments.

* lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el.
(eieio-defclass-autoload): Don't record the superclasses any more.
(eieio-defclass-internal): Reuse the old class object if it was just an
autoload stub.
(eieio--class-precedence-list): Load the class if it's autoloaded.

* lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core.
(eieio--defgeneric-init-form): Don't throw away a previous docstring.
(eieio--method-optimize-primary): Don't mess with the docstring.
(defgeneric): Keep the `args' in the docstring.
(defmethod): Don't use the method's docstring for the generic
function's docstring.

* lisp/emacs-lisp/find-func.el: Use lexical-binding.
(find-function-regexp): Don't rule out `defgeneric'.
(find-function-regexp-alist): Document new possibility of including
a function instead of a regexp.
(find-function-search-for-symbol): Implement that new possibility.
(find-function-library): Don't assume that `function' is a symbol.
(find-function-do-it): Remove unused var `orig-buf'.

* test/automated/cl-generic-tests.el (cl-generic-test-8-after/before):
Rename from cl-generic-test-7-after/before.
(cl--generic-test-advice): New function.
(cl-generic-test-9-advice): New test.

* test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset
eieio-test--1.
lisp/ChangeLog
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/eieio-core.el
lisp/emacs-lisp/eieio-generic.el
lisp/emacs-lisp/find-func.el
lisp/help-fns.el
lisp/help-mode.el
test/ChangeLog
test/automated/cl-generic-tests.el
test/automated/eieio-test-methodinvoke.el