summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2021-12-01 20:03:44 +0000
committerAlan Mackenzie <acm@muc.de>2021-12-01 20:03:44 +0000
commit8f1106ddf2a3861e9c1ebb9d8fa3d4087899de81 (patch)
tree51c009f7f727cb93d6cfb681bbb2492bd7536a0e /lisp/emacs-lisp/bytecomp.el
parent368570b3fd09d03ac5b9276d1ca85ae813c3f385 (diff)
downloademacs-8f1106ddf2a3861e9c1ebb9d8fa3d4087899de81.tar.gz
emacs-8f1106ddf2a3861e9c1ebb9d8fa3d4087899de81.tar.bz2
emacs-8f1106ddf2a3861e9c1ebb9d8fa3d4087899de81.zip
Several amendments to scratch/correct-warning-pos.
The position return by read-positioning-symbols is now the position in the buffer, rather than the offset from the start of a form, enabling warning positions in other parts of the buffer to be output. * src/lisp.h (lisp_h_EQ): Add XLI casts so that it compiles cleanly. * src/data.c (Fremove_pos_from_symbol): New DEFUN. * src/lread.c (readchar_count): renamed to readchar_offset. (read_internal_start) Initialize readchar_offset to the buffer's point when STREAM is a buffer. * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Amend to use OFFSET as a buffer position, not an offset from the start of a form. (byte-compile-warn): Remove symbol positions from any shape of ARGS, not just a symbol with position. * lisp/emacs-lisp/cconv.c (cconv-convert): In the :unused case, position the new IGNORE symbol with the VAR it has replaced. * lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap, macroexp-warn-and-return): Add an extra position parameter to each. * lisp/emacs-lisp/bindat.el (bindat-type), lisp/emacs-lisp/byte-run.el (defmacro, defun), lisp/emacs-lisp/cconv.el (cconv--convert-func-body) (cconv-convert), lisp/emacs-lisp/cl-generic.el (cl-defmethod), lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct), lisp/emacs-lisp/easy-mmode.el (define-minor-mode), lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default) (eieio-oset-default), lisp/emacs-lisp/eieio.el (defclass), lisp/emacs-lisp/gv.el (gv-ref), lisp/emacs-lisp/macroexp.el (macroexp-macroexpand, macroexp--unfold-lambda, macroexp--expand-all), lisp/emacs-lisp/pcase.el (pcase-compile-patterns, pcase--u1): Add an extra position argument to each call of macroexp-warn-and-return.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el9
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 869b6c01b8a..2f23fe743ec 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1326,7 +1326,7 @@ Return nil if such is not found."
(goto-char byte-compile-last-position)
(setq old-l (1+ (count-lines (point-min) (point-at-bol)))
old-c (1+ (current-column)))
- (goto-char (+ byte-compile-read-position offset))
+ (goto-char offset)
(setq new-l (1+ (count-lines (point-min) (point-at-bol)))
new-c (1+ (current-column)))
(format "%d:%d:%d:%d:" old-l old-c new-l new-c)))
@@ -1435,12 +1435,7 @@ function directly; use `byte-compile-warn' or
(defun byte-compile-warn (format &rest args)
"Issue a byte compiler warning; use (format-message FORMAT ARGS...) for message."
- (setq args
- (mapcar (lambda (arg)
- (if (symbolp arg)
- (bare-symbol arg)
- arg))
- args))
+ (setq args (mapcar #'byte-compile-strip-symbol-positions args))
(setq format (apply #'format-message format args))
(if byte-compile-error-on-warn
(error "%s" format) ; byte-compile-file catches and logs it