unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Dealing with obsoletion warnings in non-core code
@ 2020-09-28 14:35 Vasilij Schneidermann
  2020-09-28 17:32 ` Stefan Monnier
  2020-09-29  8:21 ` Gregory Heytings via Emacs development discussions.
  0 siblings, 2 replies; 15+ messages in thread
From: Vasilij Schneidermann @ 2020-09-28 14:35 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

Here's something that keeps irking me when maintaining community
packages written back when Emacs 24.3 was a reasonable version to
support: With every new Emacs release I receive more and more
byte-compiler warnings that are tricky to silence.  One pattern that
keeps showing up is that of functions/variables the byte-compiler
doesn't know about (for example because these are only available in a
future Emacs release), for those it's possible to use a conditional
testing for the function/variable existence:

    (if (fboundp 'new-and-exciting-function)
        (new-and-exciting-function)
      (boring-function))

The same trick however cannot be used for functions/variables declared
obsoleted, the only construct I've found to work in this case is the
following:

    (with-suppressed-warnings ((obsolete old-but-useful-function))
      (if (fboundp 'recommended-function)
          (recommended-function)
        (old-but-useful-function)))

Ideally I'd like to be able to write the following instead to avoid the
needless repetition:

    (if (fboundp 'recommended-function)
        (recommended-function)
      (old-but-useful-function))

Is there something I'm overlooking here?  I've looked at core code and
it seems to mostly ignore this kind of compatibility issue and instead
drops all obsolete usage.  This is not always an option as community
package author.  Many authors and users just ignore warnings, especially
if they can't do anything about them.  This leads to fatigue and might
let them overlook actually important warnings.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-29 15:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 14:35 Dealing with obsoletion warnings in non-core code Vasilij Schneidermann
2020-09-28 17:32 ` Stefan Monnier
2020-09-28 18:16   ` Eli Zaretskii
2020-09-28 18:34     ` Vasilij Schneidermann
2020-09-28 19:00       ` Eli Zaretskii
2020-09-28 19:24     ` Stefan Monnier
2020-09-29 14:07       ` Eli Zaretskii
2020-09-29  8:21 ` Gregory Heytings via Emacs development discussions.
2020-09-29  8:28   ` Gregory Heytings via Emacs development discussions.
2020-09-29  9:33     ` Gregory Heytings via Emacs development discussions.
2020-09-29 13:11   ` Stefan Monnier
2020-09-29 14:11     ` Gregory Heytings via Emacs development discussions.
2020-09-29 14:46       ` Stefan Monnier
2020-09-29 15:36         ` Gregory Heytings via Emacs development discussions.
2020-09-29 14:55     ` T.V Raman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).