diff options
author | Alan Mackenzie <acm@muc.de> | 2022-01-15 17:36:12 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-01-15 17:36:12 +0000 |
commit | 3023e7ca3d911d431738551753e4cfb8e3e01ec5 (patch) | |
tree | e4db9b39ca8fc6058f49c91a93161bc55ccb4b7f /lisp/emacs-lisp/eieio.el | |
parent | d87a34597c9f0be967f75ff8cfd0ace4392da63f (diff) | |
download | emacs-3023e7ca3d911d431738551753e4cfb8e3e01ec5.tar.gz emacs-3023e7ca3d911d431738551753e4cfb8e3e01ec5.tar.bz2 emacs-3023e7ca3d911d431738551753e4cfb8e3e01ec5.zip |
Remove the remnants of old position mechanism from scratch/correct-warning-pos
Also correct one or two positions in macroexp-warn-and-return invocations.
* lisp/emacs-lisp/bytecomp.el (byte-compile-read-position)
(byte-compile-last-position, byte-compile-set-symbol-position): Remove.
(byte-compile-warning-prefix, byte-compile-function-warn)
(byte-compile-emit-callargs-warn, byte-compile-arglist-warn)
(byte-compile-warn-about-unresolved-functions, compile-defun)
(byte-compile-from-buffer, byte-compile-from-buffer)
(byte-compile-file-form-defmumble, byte-compile-check-lambda-list)
(byte-compile-lambda, byte-compile-form, byte-compile-normal-call)
(byte-compile-check-variable, byte-compile-push-constant)
(byte-compile-subr-wrong-args, byte-compile-negation-optimizer)
(byte-compile-condition-case, byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form): Remove the remnants of the old warning position
mechanism.
(byte-compile-function-warn): Replace byte-compile-last-position by a
symbol-with-pos-pos call.
(compile-defun): Use local variable start-read-position to fulfil purpose of
old byte-compile-read-position. Push the just read FORM onto
byte-compile-form-stack.
* lisp/emacs-lisp/eieio.el (defclass): New mechanism to get the correct
source warning position to macroexp-warn-and-return.
* lisp/emacs-lisp/macroexp (macroexp--unfold-lambda): Correct the position
argument given to macroexp-warn-and-return.
Diffstat (limited to 'lisp/emacs-lisp/eieio.el')
-rw-r--r-- | lisp/emacs-lisp/eieio.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index e6a5685b5ed..820e8383d86 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -181,9 +181,11 @@ and reference them using the function `class-option'." ;; Is there an initarg, but allocation of class? (when (and initarg (eq alloc :class)) - (push (format "Meaningless :initarg for class allocated slot '%S'" - sname) - warnings)) + (push + (cons sname + (format "Meaningless :initarg for class allocated slot '%S'" + sname)) + warnings)) (let ((init (plist-get soptions :initform))) (unless (or (macroexp-const-p init) @@ -194,8 +196,9 @@ and reference them using the function `class-option'." ;; heuristic says and if it disagrees with normal evaluation ;; then tweak the initform to make it fit and emit ;; a warning accordingly. - (push (format "Ambiguous initform needs quoting: %S" init) - warnings))) + (push + (cons init (format "Ambiguous initform needs quoting: %S" init)) + warnings))) ;; Anyone can have an accessor function. This creates a function ;; of the specified name, and also performs a `defsetf' if applicable @@ -242,8 +245,8 @@ This method is obsolete." `(progn ,@(mapcar (lambda (w) - (macroexp-warn-and-return w ; W is probably a poor choice for a position. - w `(progn ',w) nil 'compile-only)) + (macroexp-warn-and-return + (car w) (cdr w) `(progn ',(cdr w)) nil 'compile-only)) warnings) ;; This test must be created right away so we can have self- ;; referencing classes. ei, a class whose slot can contain only |