diff options
author | Alan Mackenzie <acm@muc.de> | 2022-01-22 17:41:03 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-01-22 17:41:03 +0000 |
commit | 88e1f8b02086aaf652e3058b36b7612c073c04b3 (patch) | |
tree | 0a12af666638c4629e2b0c34bcce1cad9945930e /src/print.c | |
parent | 1edde2fc7a1a82b0e65d2b7a4237e7c18d0bc0c1 (diff) | |
parent | 14d64a8adcc866deecd758b898e8ef2d836b354a (diff) | |
download | emacs-88e1f8b02086aaf652e3058b36b7612c073c04b3.tar.gz emacs-88e1f8b02086aaf652e3058b36b7612c073c04b3.tar.bz2 emacs-88e1f8b02086aaf652e3058b36b7612c073c04b3.zip |
Merge branch 'scratch/correct-warning-pos'
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 33 |
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); |