unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Harald Jörg" <haj@posteo.de>
Cc: emacs-devel@gnu.org
Subject: Re: cperl-mode: Eliminating references to obsolete packages
Date: Thu, 24 Sep 2020 18:20:55 -0400	[thread overview]
Message-ID: <jwv8scyn7wy.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <cfed1bf6-fbb0-24dc-d22a-ff64d1ad8ca9@posteo.de> ("Harald Jörg"'s message of "Thu, 24 Sep 2020 20:43:33 +0200")

>> For example that "format-prompt" problem currently also affects the
>> python.el GNU ELPA package.  Luckily, AFAICT we haven't yet released
>> a new python.el package (because the version number has not been
>> bumped), but the problem is real.
>
> I noticed that some of them (but not python.el) contain a comment like
> this:
>
>   ;; This is an Elpa :core package. Don't use functionality that is not
>   ;; compatible with Emacs 24.1.
>
> ...but I don't know whether that actually helps.

It helps in the sense that at least the information is available without
having to ask someone, but for things like format-prompt applied via
searches like `grep` it's all too easy to overlook.

> For me it would be rather cumbersome to find out which functionality
> isn't compatible with Emacs 24.1.

That's yet another difficulty, indeed.

> Some recent doc strings (e.g. time-convert) show it,

It's actually not the docstring, it's a hack in the `C-h o` code which
adds this info by searching for the name in the etc/NEWS* files.

> some (e.g. format-prompt) don't.

Indeed.  Should be fixed now in `master`.

>> [...]
>> Some automated tests that try to build&compile (and treat warnings as
>> errors) those packages on the corresponding oldest Emacs version
>> supported would come in handy.
>
> Wouldn't this rule out the type of fallback patch you suggested?  When
> I byte-compile-file cperl-mode.el in Emacs 26.1 _with_ your fallback
> patch applied, I still get the warning:
>
>     In end of data:
>     cperl-mode.el:8736:1:Warning: the function ‘format-prompt’ is
>     not known to be defined.
>
> Sorta obvious, though: The compilation step doesn't _run_ the fboundp
> safeguard.

Just use `'format-prompt` instead of `#'format-prompt`.
But yes, turning warnings into errors can be tricky on older Emacsen.
There are other solutions, tho (e.g. keep an "expected output" against
which to compare so we get warned when a *new* warning appears).

IOW, the problem for now is to setup those automated tests: finding
a machine on which to run them, figuring out which version of Emacs to
use for each, making sure the corresponding Emacs version is available,
etc...

> Anyway: Are there frameworks for such tests in the Emacs repository?

I'm not very knowledgeable about that, I'm afraid.


        Stefan




      reply	other threads:[~2020-09-24 22:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 18:37 cperl-mode: Eliminating references to obsolete packages Harald Jörg
2020-09-23 19:16 ` Stefan Monnier
2020-09-23 19:38   ` Harald Jörg
2020-09-23 19:50     ` Stefan Monnier
2020-09-24 15:34       ` Harald Jörg
2020-09-24 17:09         ` Stefan Monnier
2020-09-24 18:43           ` Harald Jörg
2020-09-24 22:20             ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8scyn7wy.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=haj@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).