emacs-erc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Philip Kaludercic
Subject: Re: Adding 'compat' from ELPA as an optional dependency to ERC
Date: Tue, 19 Jul 2022 16:25:51 +0000

Stefan Monnier <monnier@iro.umontreal.ca> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]