From 65d5946f35e742eec62faed536c2c3571fbe7981 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sun, 25 Nov 2018 21:45:11 +0000 Subject: [PATCH] Replace two DEFVAR_LISPs with DEFVAR_BOOL. Amend lisp.h accordingly. The two variables are symbols-with-pos-enabled and print-symbols-bare. * src/lisp.h (lisp_h_EQ, lisp_h_SYMBOLP, lisp_h_XSYMBOL): Remove XLI operations. * src/data.c (Vsymbols_with_pos_enabled) * src/print.c (Vprint_symbols_bare): Replace DEFVAR_LISP with DEFVAR_BOOL. (print_vectorlike): remove a no longer needed NILP. --- src/data.c | 4 ++-- src/lisp.h | 6 +++--- src/print.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data.c b/src/data.c index 6c656250af9..58c3d4b3b12 100644 --- a/src/data.c +++ b/src/data.c @@ -4154,10 +4154,10 @@ This variable cannot be set; trying to do so will signal an error. */); make_symbol_constant (intern_c_string ("most-negative-fixnum")); DEFSYM (Qsymbols_with_pos_enabled, "symbols-with-pos-enabled"); - DEFVAR_LISP ("symbols-with-pos-enabled", Vsymbols_with_pos_enabled, + DEFVAR_BOOL ("symbols-with-pos-enabled", Vsymbols_with_pos_enabled, doc: /* Non-nil when "symbols with position" can be used as symbols. Bind this to non-nil in applications such as the byte compiler. */); - Vsymbols_with_pos_enabled = Qnil; + Vsymbols_with_pos_enabled = false; DEFSYM (Qwatchers, "watchers"); DEFSYM (Qmakunbound, "makunbound"); diff --git a/src/lisp.h b/src/lisp.h index 802c9e4259f..95acfbba74a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -395,7 +395,7 @@ typedef EMACS_INT Lisp_Word; /* verify (NIL_IS_ZERO) */ #define lisp_h_EQ(x, y) ((XLI ((x)) == XLI ((y))) \ - || (XLI (Vsymbols_with_pos_enabled) \ + || (Vsymbols_with_pos_enabled \ && (SYMBOL_WITH_POS_P ((x)) \ ? BARE_SYMBOL_P ((y)) \ ? (XSYMBOL_WITH_POS((x)))->sym == (y) \ @@ -424,7 +424,7 @@ typedef EMACS_INT Lisp_Word; #define lisp_h_BARE_SYMBOL_P(x) TAGGEDP ((x), Lisp_Symbol) /* verify (NIL_IS_ZERO) */ #define lisp_h_SYMBOLP(x) ((BARE_SYMBOL_P ((x)) || \ - (XLI (Vsymbols_with_pos_enabled) && (SYMBOL_WITH_POS_P ((x)))))) + (Vsymbols_with_pos_enabled && (SYMBOL_WITH_POS_P ((x)))))) #define lisp_h_TAGGEDP(a, tag) \ (! (((unsigned) (XLI (a) >> (USE_LSB_TAG ? 0 : VALBITS)) \ - (unsigned) (tag)) \ @@ -463,7 +463,7 @@ typedef EMACS_INT Lisp_Word; /* verify (NIL_IS_ZERO) */ # define lisp_h_XSYMBOL(a) \ (eassert (SYMBOLP ((a))), \ - (!XLI (Vsymbols_with_pos_enabled) \ + (!Vsymbols_with_pos_enabled \ ? (XBARE_SYMBOL ((a))) \ : (BARE_SYMBOL_P ((a))) \ ? (XBARE_SYMBOL ((a))) \ diff --git a/src/print.c b/src/print.c index fc5d93152dd..c216b7f6031 100644 --- a/src/print.c +++ b/src/print.c @@ -1397,7 +1397,7 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, case PVEC_SYMBOL_WITH_POS: { struct Lisp_Symbol_With_Pos *sp = XSYMBOL_WITH_POS (obj); - if (!NILP (Vprint_symbols_bare)) + if (Vprint_symbols_bare) print_object (sp->sym, printcharfun, escapeflag); else { @@ -2353,11 +2353,11 @@ priorities. Values other than nil or t are also treated as `default'. */); Vprint_charset_text_property = Qdefault; - DEFVAR_LISP ("print-symbols-bare", Vprint_symbols_bare, + DEFVAR_BOOL ("print-symbols-bare", Vprint_symbols_bare, doc: /* A flag to control printing of symbols with position. If the value is nil, print these objects complete with position. Otherwise print just the bare symbol. */); - Vprint_symbols_bare = Qnil; + Vprint_symbols_bare = false; /* prin1_to_string_buffer initialized in init_buffer_once in buffer.c */ staticpro (&Vprin1_to_string_buffer); -- 2.39.5