]> git.eshelyaron.com Git - emacs.git/commit
Bring the scratch/accurate-warning-pos branch to full functionality.
authorAlan Mackenzie <acm@muc.de>
Fri, 23 Nov 2018 12:32:31 +0000 (12:32 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 23 Nov 2018 12:32:31 +0000 (12:32 +0000)
commit75b18e07e57da7ee4362db800352d6650f5f7290
treef7b0be5a0595ccfc3353fc2f97f2d4862d4e9b6a
parenta227850095be26642756e4319458b2689fb3d4c6
Bring the scratch/accurate-warning-pos branch to full functionality.

The branch will now make bootstrap.

* src/lisp.h (lisp_h_EQ, etc.): Replace use of lisp_h_FOO by plain FOO.  To
enable this, some definitions have been moved in the file.
(XBARE_SYMBOL): Renamed from XSYMBOL.  Create a new XSYMBOL.
(BASE_EQ): New function.

* src/alloc.c (Fgarbage_collect): Bind symbols-with-pos-enabled to nil.

* src/data.c (Fbare_symbol): Renamed from Fsymbol_with_pos_sym.  It now
accepts a bare symbol as argument.
(syms_of_data): Declare Qsymbols_with_pos_enabled as a symbol.

* src/fns.c (hash_lookup): If the key is a symbol with position, replace it by
its bare symbol before proceding.

* src/lread.c (read1): In recursive calls to read1, and calls to other reading
function, use an argument of false for locate_syms when symbols with positions
are decidedly unwanted.

* src/print.c (Vprint_symbols_bare): New variable.
(print_vectorlike): Strip the position from a symbol with position before
printing it when Vprint_symbols_bare is non-nil.

* lisp/emacs-lisp/bytecomp.el (byte-compile-strip-s-p-1)
(byte-compile-strip-symbol-positions): New functions.
(byte-compile-recurse-toplevel, byte-compile-initial-macro-environment)
(byte-compile-preprocess, byte-compile-macroexpand-declare-function): Bind
print-symbols-bare to non-nil around macro
expansion.
(byte-compile-warning-prefix): Temporarily output source positions in both old
and new methods in warning messages.
(byte-compile-warn, ...): Use symbolp in place of symbol-with-pos-p.  Replace
symbol-with-pos-sym by bare-symbol.
(byte-compile--warn-x, byte-compile-form): Replace the erroneous push by cons
when binding
byte-compile--form-stack.
(byte-compile-file): Bind symbols-with-pos-enabled to non-nil to use the new
mechanism.
(byte-compile-toplevel-file-form): Bind and push a form onto
byte-compile--form-stack.
(byte-compile-file-form-autoload, byte-compile-file-form-defvar)
(byte-compile-file-form-eval, byte-compile-file-form-defmumble)
(byte-compile-lambda, byte-compile-form, byte-compile-dynamic-variable-op)
(byte-compile-constant, byte-compile-cond-jump-table): Strip positions from
symbols before compiling.

* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv--analyze-function, cconv-analyze-form): Replace calls to
byte-compile-warn with byte-compile--warn-x.

* lisp/emacs-lisp/macroexp.el (macroexp--warn-and-return): Add an extra
parameter, using it to call byte-compile--warn-x in place of
byte-compile-warn.
(macroexp-macroexpand, macroexp--expand-all): Add extra argument to call of
macroexp--warn-and-return.

* lisp/emacs-lisp/cl-macs.el (cl-macs--strip-s-p-1)
(cl-macs--strip-symbol-positions): New functions.  These are duplicates of
new functions in bytecomp.el, written to facilitate bootstrap, but this
duplication must be resolved somehow.
(cl-defstruct): Strip positions from symbols.

* lisp/emacs-lisp/cl-generic.el (cl-defmethod)
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct)
* lisp/emacs-lisp/eieio-core.el (eieio-oref)
* lisp/emacs-lisp/eieio.el (defclass)
* lisp/emacs-lisp/gv.el (gv-ref)
* lisp/emacs-lisp/pcase.el (pcase--u1): Add extra position arguments to the
calls of macroexp--warn-and-return.
15 files changed:
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cconv.el
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/eieio-core.el
lisp/emacs-lisp/eieio.el
lisp/emacs-lisp/gv.el
lisp/emacs-lisp/macroexp.el
lisp/emacs-lisp/pcase.el
src/alloc.c
src/data.c
src/fns.c
src/lisp.h
src/lread.c
src/print.c