summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/fw.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/cedet/semantic/fw.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/cedet/semantic/fw.el')
-rw-r--r--lisp/cedet/semantic/fw.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index 91944c44f5e..3c36c6cb9f8 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -189,14 +189,13 @@ will throw a warning when it encounters this symbol."
(when (and (mode-local--function-overload-p newfn)
(not (mode-local--overload-obsoleted-by newfn))
;; Only throw this warning when byte compiling things.
- (boundp 'byte-compile-current-file)
- byte-compile-current-file
- (not (string-match "cedet" byte-compile-current-file))
+ (macroexp-compiling-p)
+ (not (string-match "cedet" (macroexp-file-name)))
)
(make-obsolete-overload oldfnalias newfn when)
(byte-compile-warn
"%s: `%s' obsoletes overload `%s'"
- byte-compile-current-file
+ (macroexp-file-name)
newfn
(with-suppressed-warnings ((obsolete semantic-overload-symbol-from-function))
(semantic-overload-symbol-from-function oldfnalias)))))
@@ -211,8 +210,7 @@ will throw a warning when it encounters this symbol."
(defvaralias oldvaralias newvar)
(error
;; Only throw this warning when byte compiling things.
- (when (and (boundp 'byte-compile-current-file)
- byte-compile-current-file)
+ (when (macroexp-compiling-p)
(byte-compile-warn
"variable `%s' obsoletes, but isn't alias of `%s'"
newvar oldvaralias)