Subject: bug#31792: 27.0.50; Regression in #'labels, recent versions

From: Aidan Kehoe <[email-masked]>
Date: Tue, 12 Jun 2018 00:11:04 +0100

When I start this binary (see below for the details), do M-x byte-compile-file
/tmp/aidan/u.el RET, and then execute the following in *scratch*:

(progn (load "/tmp/aidan/u.elc")
       (symbol-function 'my-package-accept-process-output))

I get:

=> my-package-accept-process-output-1

When I do the same in the emacs 22.1.1 that Apple built and shipped with
my OS, I get a compiled function object, as is much closer to being the
correct behaviour.

Contents of /tmp/aidan/u.el (a narrowed-down test case of some code I had
planned to write): 

---- Begin:

(require 'cl)

(labels
    ((my-package-accept-process-output-1 (process-object &optional timeout-secs
                                                     timeout-msecs)
       "Call `my-package-filter' and pass it the output of the last my-package
invocation."
       (if (null process-object)
           (error "No My-Package process to read output from!")
         (let ((buf my-package-output-buffer)
               my-package-output)
           (if (not (bufferp buf))
               (setq my-package-filter nil)
             (with-current-buffer buf
               (setq my-package-output (buffer-substring-no-properties
                                    (point-min) (point-max))))
             (my-package-filter t my-package-output)
             (with-current-buffer buf
               (erase-buffer)))))))
  (defalias 'my-package-accept-process-output
      (if (boundp 'my-package-async-processp)
          #'accept-process-output
        #'my-package-accept-process-output-1)))

---- End:

In GNU Emacs 27.0.50 (build 3, i386-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549))
 of 2018-06-11 built on bonbon
Repository revision: 94d60f59fc654706c3a52ed2c90c355b36be7898
Windowing system distributor 'Apple', version 10.3.1038
System Description:  Mac OS X 10.6.8

Recent messages:
Auto-saving...done
Saving file /tmp/aidan/u.el...
Wrote /tmp/aidan/u.el
Compiling /tmp/aidan/u.el...
‘labels’ is an obsolete macro (as of 24.3); use ‘cl-labels’ instead.
Compiling /tmp/aidan/u.el...done
Wrote /tmp/aidan/u.elc
Loading /tmp/aidan/u.elc...done
Quit
Mark set [3 times]

Configured using:
 'configure --with-wide-int CC=gcc-4.2
 PKG_CONFIG_PATH=/usr/pkg/lib/pkgconfig:/X11/lib/pkgconfig'

Configured features:
RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
NS THREADS LCMS2

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 rmc puny seq dired
dired-loaddefs format-spec rfc822 mml 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 cl-seq cl-macs
disass cl-extra cl gv help-fns radix-tree help-mode easymenu cl-loaddefs
cl-lib warnings byte-opt compile comint ansi-color ring bytecomp
byte-compile cconv time-date elec-pair 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 lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 225419 15013)
 (symbols 40 21102 1)
 (miscs 36 68 413)
 (strings 16 33618 3363)
 (string-bytes 1 872171)
 (vectors 12 37343)
 (vector-slots 8 742671 16894)
 (floats 8 49 351)
 (intervals 36 910 74)
 (buffers 860 18))

-- 
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)