Re: Adding 'compat' from ELPA as an optional dependency to ERC

Philip Kaludercic <[email protected]>
Newsgroups gmane.emacs.devel,gmane.emacs.erc.general
Message-ID <[email protected]>
Stefan Monnier <[email protected]> writes:

>>    ;;; Code:
>>   +(require 'compat nil 'noerror)
>
> I thought the idea for `compat` is that the packages using it would
> require a specific (minimum) version, as in
>
>     (require 'compat-28 nil 'noerror)

No, requiring 'compat will load all missing definitions up until the
currently version the library supports.  By explicitly loading
compat-28, one would additionally load "prefixed" definitions for
functions that add new features to existing functions.

E.g. consider how assoc acquired a new optional argument "TESTFN" in
version 26.  One would either have to advise the existing function,
which was regarded to be too invasive and dangerous, or to define a
separate function underneath the `compat-' prefix -- `compat-assoc'.

This function is not made visible by loading `compat', and explicitly
ought not to be in this case, as someone using the in-tree version of
ERC would not have no such function defined.  In this sense the support
compat can provide for core packages is limited, but as it seems for
ERC's requirements sufficient.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.