summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-02-24 13:52:45 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-02-24 13:52:45 -0500
commit2766f9fdb95a1a4418020d32ce3f0cbd262f7cee (patch)
tree3475e2132b01dbeaa02852e17fb35e930404c8dd /lisp/emacs-lisp/eieio.el
parent654cb8e6b7fbdca32f07609cafe906e2470cc73d (diff)
downloademacs-2766f9fdb95a1a4418020d32ce3f0cbd262f7cee.tar.gz
* lisp/emacs-lisp/macroexp.el (macroexp-file-name): New function.
Yes, finally: a function that tells you the name of the file where the code is located. Finding this name is non-trivial in practice, as evidenced by the "4 shift/reduce conflicts" warning when compiling CEDET's python.el, because its `wisent-source` got it wrong in that case, thinking the grammar came from `python.el` instead of `python-wy.el`. While at it, also made `macroexp-compiling-p` public, since it's useful at various places. (macroexp-compiling-p): Rename from `macroexp--compiling-p`. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Bind `load-file-name` to nil so we can distinguish a load that calls the byte compiler from a byte compilation which causes a load. * lisp/cedet/semantic/wisent/python.el (wisent-python--expected-conflicts): Remove; it was just a workaround. * lisp/subr.el (do-after-load-evaluation): Avoid `byte-compile--` vars. * lisp/cedet/semantic/fw.el (semantic-alias-obsolete): Use `macroexp-compiling-p` and `macroexp-file-name`. * lisp/cedet/semantic/wisent/comp.el (wisent-source): Use `macroexp-file-name` (wisent-total-conflicts): Tighten regexp. * lisp/emacs-lisp/cl-lib.el (cl--compiling-file): Delete function and variable. Use `macroexp-compiling-p` instead. * lisp/progmodes/flymake.el (flymake-log): * lisp/emacs-lisp/package.el (package-get-version): * lisp/emacs-lisp/ert-x.el (ert-resource-directory): Use `macroexp-file-name`.
Diffstat (limited to 'lisp/emacs-lisp/eieio.el')
-rw-r--r--lisp/emacs-lisp/eieio.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index a095ad0f6db..d3e5d03edb5 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -233,7 +233,7 @@ This method is obsolete."
,@(when eieio-backward-compatibility
(let ((f (intern (format "%s-child-p" name))))
- `((defalias ',f ',testsym2)
+ `((defalias ',f #',testsym2)
(make-obsolete
',f ,(format "use (cl-typep ... \\='%s) instead" name)
"25.1"))))
@@ -288,8 +288,8 @@ created by the :initarg tag."
(declare (debug (form symbolp)))
`(eieio-oref ,obj (quote ,slot)))
-(defalias 'slot-value 'eieio-oref)
-(defalias 'set-slot-value 'eieio-oset)
+(defalias 'slot-value #'eieio-oref)
+(defalias 'set-slot-value #'eieio-oset)
(make-obsolete 'set-slot-value "use (setf (slot-value ..) ..) instead" "25.1")
(defmacro oref-default (obj slot)
@@ -418,7 +418,7 @@ If EXTRA, include that in the string returned to represent the symbol."
(cl-check-type obj eieio-object)
(eieio-class-name (eieio--object-class obj)))
(define-obsolete-function-alias
- 'object-class-name 'eieio-object-class-name "24.4")
+ 'object-class-name #'eieio-object-class-name "24.4")
(defun eieio-class-parents (class)
;; FIXME: What does "(overload of variable)" mean here?
@@ -446,7 +446,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function."
(defmacro eieio-class-parent (class)
"Return first parent class to CLASS. (overload of variable)."
`(car (eieio-class-parents ,class)))
-(define-obsolete-function-alias 'class-parent 'eieio-class-parent "24.4")
+(define-obsolete-function-alias 'class-parent #'eieio-class-parent "24.4")
(defun same-class-p (obj class)
"Return t if OBJ is of class-type CLASS."
@@ -461,7 +461,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function."
;; class will be checked one layer down
(child-of-class-p (eieio--object-class obj) class))
;; Backwards compatibility
-(defalias 'obj-of-class-p 'object-of-class-p)
+(defalias 'obj-of-class-p #'object-of-class-p)
(defun child-of-class-p (child class)
"Return non-nil if CHILD class is a subclass of CLASS."
@@ -665,7 +665,7 @@ This class is not stored in the `parent' slot of a class vector."
(setq eieio-default-superclass (cl--find-class 'eieio-default-superclass))
(define-obsolete-function-alias 'standard-class
- 'eieio-default-superclass "26.1")
+ #'eieio-default-superclass "26.1")
(cl-defgeneric make-instance (class &rest initargs)
"Make a new instance of CLASS based on INITARGS.
@@ -972,12 +972,12 @@ this object."
This may create or delete slots, but does not affect the return value
of `eq'."
(error "EIEIO: `change-class' is unimplemented"))
-(define-obsolete-function-alias 'change-class 'eieio-change-class "26.1")
+(define-obsolete-function-alias 'change-class #'eieio-change-class "26.1")
;; Hook ourselves into help system for describing classes and methods.
;; FIXME: This is not actually needed any more since we can click on the
;; hyperlink from the constructor's docstring to see the type definition.
-(add-hook 'help-fns-describe-function-functions 'eieio-help-constructor)
+(add-hook 'help-fns-describe-function-functions #'eieio-help-constructor)
(provide 'eieio)