I think we should improve how compatibility checks are done with ELC files. The current code is hardcoded only for adding a comment header denoting that the bytecode uses dynamic docstrings and multibyte characters. IMO, this should be replaced with a list of (FEATURE-NAME . COMPATIBLE-VERSION) pairs that Emacs checks against while loading bytecode files.

Thoughts?


Vibhav Pant
vibhavp@gmail.com

On 23-Feb-2017 7:09 PM, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:
> I) Compile under master branch.
> II) Load the resultant .elc with Emacs-25

As explained by Richard, this is usually considered acceptable.
We don't really try to provide forward compatibility of byte-code files
between major versions.

This said, occasionally we try to reduce the pain a little: e.g. in
Emacs-25 a similar incompatibility was introduced for the compilation of
catch&condition-case, but the bytecodes were introduced a bit earlier.
IOW the incompatibility was fundamentally introduced in 24.4 (IIRC), but
the use of the this new feature was only enabled in Emacs-25.1, so files
compiled with 25.1 will usually work in 24.5 as well.


        Stefan