diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-01-28 12:31:28 -0500 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-01-29 11:16:06 -0500 |
commit | 9bf94639b8f674d2c7894df35f26f09d0ecc67f5 (patch) | |
tree | 0346fd2985fa8d78161a4840ff0eb56087328d79 /lisp/emacs-lisp/cl-generic.el | |
parent | 0073223c23749ffd6bd3f882bc30a82cc37efd2a (diff) | |
download | emacs-9bf94639b8f674d2c7894df35f26f09d0ecc67f5.tar.gz |
Don't warn about obsolete defgenerics when defining them
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): The declaration code
should run after the definition code (Bug#25556).
Diffstat (limited to 'lisp/emacs-lisp/cl-generic.el')
-rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 8d141d7a646..6cc70c4c2f5 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -226,7 +226,13 @@ DEFAULT-BODY, if present, is used as the body of a default method. (when (eq 'setf (car-safe name)) (require 'gv) (setq name (gv-setter (cadr name)))) - `(progn + `(prog1 + (progn + (defalias ',name + (cl-generic-define ',name ',args ',(nreverse options)) + ,(help-add-fundoc-usage doc args)) + ,@(mapcar (lambda (method) `(cl-defmethod ,name ,@method)) + (nreverse methods))) ,@(mapcar (lambda (declaration) (let ((f (cdr (assq (car declaration) defun-declarations-alist)))) @@ -235,12 +241,7 @@ DEFAULT-BODY, if present, is used as the body of a default method. (t (message "Warning: Unknown defun property `%S' in %S" (car declaration) name) nil)))) - (cdr declarations)) - (defalias ',name - (cl-generic-define ',name ',args ',(nreverse options)) - ,(help-add-fundoc-usage doc args)) - ,@(mapcar (lambda (method) `(cl-defmethod ,name ,@method)) - (nreverse methods))))) + (cdr declarations))))) ;;;###autoload (defun cl-generic-define (name args options) |