summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2022-01-22 17:41:03 +0000
committerAlan Mackenzie <acm@muc.de>2022-01-22 17:41:03 +0000
commit88e1f8b02086aaf652e3058b36b7612c073c04b3 (patch)
tree0a12af666638c4629e2b0c34bcce1cad9945930e /src/print.c
parent1edde2fc7a1a82b0e65d2b7a4237e7c18d0bc0c1 (diff)
parent14d64a8adcc866deecd758b898e8ef2d836b354a (diff)
downloademacs-88e1f8b02086aaf652e3058b36b7612c073c04b3.tar.gz
Merge branch 'scratch/correct-warning-pos'
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/print.c b/src/print.c
index 7440a82f6fd..04a271ce456 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1649,6 +1649,30 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag,
printchar ('>', printcharfun);
break;
+ case PVEC_SYMBOL_WITH_POS:
+ {
+ struct Lisp_Symbol_With_Pos *sp = XSYMBOL_WITH_POS (obj);
+ if (print_symbols_bare)
+ print_object (sp->sym, printcharfun, escapeflag);
+ else
+ {
+ print_c_string ("#<symbol ", printcharfun);
+ if (BARE_SYMBOL_P (sp->sym))
+ print_object (sp->sym, printcharfun, escapeflag);
+ else
+ print_c_string ("NOT A SYMBOL!!", printcharfun);
+ if (FIXNUMP (sp->pos))
+ {
+ print_c_string (" at ", printcharfun);
+ print_object (sp->pos, printcharfun, escapeflag);
+ }
+ else
+ print_c_string (" NOT A POSITION!!", printcharfun);
+ printchar ('>', printcharfun);
+ }
+ }
+ break;
+
case PVEC_OVERLAY:
print_c_string ("#<overlay ", printcharfun);
if (! XMARKER (OVERLAY_START (obj))->buffer)
@@ -1974,7 +1998,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
error ("Apparently circular structure being printed");
for (i = 0; i < print_depth; i++)
- if (EQ (obj, being_printed[i]))
+ if (BASE_EQ (obj, being_printed[i]))
{
int len = sprintf (buf, "#%d", i);
strout (buf, len, len, printcharfun);
@@ -2478,6 +2502,13 @@ priorities. Values other than nil or t are also treated as
`default'. */);
Vprint_charset_text_property = Qdefault;
+ DEFVAR_BOOL ("print-symbols-bare", print_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. */);
+ print_symbols_bare = false;
+ DEFSYM (Qprint_symbols_bare, "print-symbols-bare");
+
/* prin1_to_string_buffer initialized in init_buffer_once in buffer.c */
staticpro (&Vprin1_to_string_buffer);