diff options
author | Glenn Morris <rgm@gnu.org> | 2019-06-01 12:04:42 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2019-06-01 12:04:42 -0700 |
commit | 7e911d007d25df9a483eaad54956a4273405574e (patch) | |
tree | ce1e4b0eda6c940634922e71a726b5c8aa5270b4 /lisp/emacs-lisp | |
parent | f17e0e93bd8dbe3b069029585dc5d2dda57c1e1e (diff) | |
parent | 134edc10367a8434167656e631865c85b5f10c42 (diff) | |
download | emacs-7e911d007d25df9a483eaad54956a4273405574e.tar.gz emacs-7e911d007d25df9a483eaad54956a4273405574e.tar.bz2 emacs-7e911d007d25df9a483eaad54956a4273405574e.zip |
Merge from origin/emacs-26
134edc1 Warn about wrong number of args for subrs (Bug#35767)
5f01af6 Use plain symbols for eieio type descriptors (Bug#29220)
4b24b01 Pacify GCC 9 -Wredundant-decls
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 11 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio.el | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ce348ed3131..dfbda8d43e3 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1401,7 +1401,7 @@ when printing the error message." (defun byte-compile-callargs-warn (form) (let* ((def (or (byte-compile-fdefinition (car form) nil) (byte-compile-fdefinition (car form) t))) - (sig (byte-compile--function-signature def)) + (sig (byte-compile--function-signature (or def (car form)))) (ncall (length (cdr form)))) ;; Check many or unevalled from subr-arity. (if (and (cdr-safe sig) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 31ee6c5bfd4..30445f9e645 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -117,9 +117,6 @@ Currently under control of this var: (defsubst eieio--object-class-tag (obj) (aref obj 0)) -(defsubst eieio--object-class (obj) - (eieio--object-class-tag obj)) - ;;; Important macros used internally in eieio. @@ -132,6 +129,12 @@ Currently under control of this var: (or (cl--find-class class) class) class)) +(defsubst eieio--object-class (obj) + (let ((tag (eieio--object-class-tag obj))) + (if eieio-backward-compatibility + (eieio--class-object tag) + tag))) + (defun class-p (x) "Return non-nil if X is a valid class vector. X can also be is a symbol." @@ -163,7 +166,7 @@ Return nil if that option doesn't exist." (defun eieio-object-p (obj) "Return non-nil if OBJ is an EIEIO object." (and (recordp obj) - (eieio--class-p (eieio--object-class-tag obj)))) + (eieio--class-p (eieio--object-class obj)))) (define-obsolete-function-alias 'object-p 'eieio-object-p "25.1") diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index b6ec191e2ba..7ad44b6d26c 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -710,6 +710,9 @@ calls `initialize-instance' on that object." ;; Call the initialize method on the new object with the slots ;; that were passed down to us. (initialize-instance new-object slots) + (when eieio-backward-compatibility + ;; Use symbol as type descriptor, for backwards compatibility. + (aset new-object 0 class)) ;; Return the created object. new-object)) |