Subject: bug#27776: 26.0.50; `print-gensym' doesn't work as advertised

From: Philipp <[email-masked]>
Date: Thu, 20 Jul 2017 23:30:46 +0200

The docstring of `print-gensym' says:

   When the uninterned symbol appears within a recursive data structure,
   and the symbol appears more than once, in addition use the #N# and #N=
   constructs as needed, so that multiple references to the same symbol are
   shared once again when the text is read back.

However, that doesn't seem to be the case, e.g.:

   emacs -Q -batch -eval '(let ((print-gensym t)) (print (quote (let ((#1=#:a 1)) #1#))))'

prints

   (let ((#:a 1)) #:a)

In GNU Emacs 26.0.50 (build 73, x86_64-apple-darwin16.6.0, NS appkit-1504.83 Version 10.12.5 (Build 16F73))
 of 2017-07-20 built on p
Repository revision: 644cdd1aa0a10dbfffa3b9b4c7a97f8cddded0b8
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --with-modules --without-xml2 --without-pop --with-mailutils
 --enable-gcc-warnings=yes MAKEINFO=/usr/local/opt/texinfo/bin/makeinfo
 'CFLAGS=-O3 -g0' LDFLAGS=-O3'

Configured features:
DBUS NOTIFY ACL GNUTLS ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils term/xterm xterm
time-date tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 208472 8349)
 (symbols 48 20232 1)
 (miscs 40 33 159)
 (strings 32 29516 1081)
 (string-bytes 1 777795)
 (vectors 16 32977)
 (vector-slots 8 669903 8589)
 (floats 8 52 295)
 (intervals 56 189 0)
 (buffers 992 11))