From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25088: 25.1; feature-unload and reload of cl-defstruct fails Date: Fri, 02 Dec 2016 10:13:44 +0200 Message-ID: <83eg1qoiiv.fsf@gnu.org> References: <87eg1qhpjf.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1480666459 5331 195.159.176.226 (2 Dec 2016 08:14:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 08:14:19 +0000 (UTC) Cc: 25088@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 02 09:14:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCiyw-0008Dj-0L for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 09:14:10 +0100 Original-Received: from localhost ([::1]:33123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCiyz-0000Fs-TU for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 03:14:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCiyt-0000FY-Is for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 03:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCiyo-0006wN-K8 for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 03:14:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCiyo-0006wA-G8 for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 03:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cCiyo-0004SI-BB for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 03:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25088 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25088-submit@debbugs.gnu.org id=B25088.148066642617096 (code B ref 25088); Fri, 02 Dec 2016 08:14:02 +0000 Original-Received: (at 25088) by debbugs.gnu.org; 2 Dec 2016 08:13:46 +0000 Original-Received: from localhost ([127.0.0.1]:49451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCiyY-0004Rg-9p for submit@debbugs.gnu.org; Fri, 02 Dec 2016 03:13:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCiyX-0004RT-4H for 25088@debbugs.gnu.org; Fri, 02 Dec 2016 03:13:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCiyN-0006g9-5F for 25088@debbugs.gnu.org; Fri, 02 Dec 2016 03:13:40 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCiyN-0006g5-1O; Fri, 02 Dec 2016 03:13:35 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1208 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cCiyM-0001Mh-9I; Fri, 02 Dec 2016 03:13:34 -0500 In-reply-to: <87eg1qhpjf.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126393 Archived-At: > From: npostavs@users.sourceforge.net > Date: Fri, 02 Dec 2016 00:24:04 -0500 > > Running > > emacs -Q -l bug-struct-reload.el --eval "(unload-feature 'bug-struct-reload)" -l bug-struct-reload.el > > Where bug-struct-reload.el contains > > (eval-when-compile (require 'cl-lib)) > (cl-defstruct foo f1) > (provide 'bug-struct-reload) > > Shows in *Messages* the following error > > Unexpected element (define-type . foo) in load-history > Compiler-macro error for foo-p: (void-function foo-p--cmacro) [2 times] > > This is because cl-defstruct defines the field accessors before the > predicate. After calling `feature-unload', the `macro-compiler' symbol > property remains on the predicate even though the function itself is > undefined. Then when reloading, the compiler tries to call the > predicate's compiler-macro to inline it in the accessor function, and > fails to find the definition. > > Since this is a regression in 25.1, I'd like to apply the following > patch to emacs-25, which simply puts the predicate definition before the > accessor functions. How risky is this change? cl-defstruct is a very widely used macro, whereas unload-feature is a relatively obscure feature. Is it really worth fixing the (IMO minor) error and risking to break Emacs 25.2? I don't have an intuition I can trust in these matters, so I need you and others who do to offer their opinions, after carefully considering the pros and cons. Thanks.