From: Eli Zaretskii <eliz@gnu.org>
To: npostavs@users.sourceforge.net
Cc: 25088@debbugs.gnu.org
Subject: bug#25088: 25.1; feature-unload and reload of cl-defstruct fails
Date: Fri, 02 Dec 2016 10:13:44 +0200 [thread overview]
Message-ID: <83eg1qoiiv.fsf@gnu.org> (raw)
In-Reply-To: <87eg1qhpjf.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net)
> 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.
next prev parent reply other threads:[~2016-12-02 8:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 5:24 bug#25088: 25.1; feature-unload and reload of cl-defstruct fails npostavs
2016-12-02 8:13 ` Eli Zaretskii [this message]
2016-12-03 22:38 ` npostavs
2016-12-04 3:35 ` Eli Zaretskii
2016-12-09 5:08 ` npostavs
2016-12-09 8:22 ` Eli Zaretskii
2016-12-09 23:33 ` Dmitry Gutov
2016-12-10 7:18 ` Eli Zaretskii
2016-12-10 9:49 ` Dmitry Gutov
2016-12-10 21:05 ` npostavs
2016-12-09 16:27 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83eg1qoiiv.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=25088@debbugs.gnu.org \
--cc=npostavs@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.