emacs-devel
[Top][All Lists]
Advanced

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

Re: How to warn about obsolete file in ELPA package


From: Basil L. Contovounesios
Subject: Re: How to warn about obsolete file in ELPA package
Date: Sat, 06 Feb 2021 13:17:49 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> We would like to emit an obsoletion warning when dash-functional.el is
> used, similar to the one for lisp/obsolete/* libraries.  Hopefully such
> a warning will be seen as helpful and actionable rather than annoying.
>
> What is the best way to go about this to cover the cases where
> dash-functional.el is byte-compiled, installed, or loaded?
>
> One simple way is a top-level (lwarn 'dash :warning "Foo"), but the
> message printed during byte-compilation is not recognised in
> *compilation* buffers as a warning, so I fear the message may go
> unnoticed.
>
> Another option is a top-level (byte-compile-warn "Foo").  This isn't
> picked up as a warning either, but at least the file name is fontified
> with font-lock-function-name-face, so it sticks out a bit more.

Sorry, I was confused: the above is what happens when loading
dash-functional.el noninteractively, not when byte-compiling it.

What about something like the following at top-level?

(eval-and-compile
  (let ((msg "Package dash-functional is deprecated; use dash 2.18.0 instead"))
    (if (and noninteractive (fboundp 'byte-compile-warn))
        (byte-compile-warn msg)
      (message "%s" msg))))

> Any suggestions along these or any better lines are most welcome.

Note that they should work in Emacs versions 24 and above.

TIA,

-- 
Basil



reply via email to

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