unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Changes to `make-obsolete` and similar functions make upgrades nearly impossible.
@ 2023-04-23 13:56 Lloyd Zusman
  2023-04-24  6:24 ` Platon Pronko
  2023-04-25 15:34 ` Ruijie Yu via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 5+ messages in thread
From: Lloyd Zusman @ 2023-04-23 13:56 UTC (permalink / raw)
  To: help-gnu-emacs

I'm a very long-term GNU emacs user: since the 1980's.

I have been using numerous elisp packages, lots of which date
back many years, and a few of my own elisp modules go all the
way back to the 1980's.

I have been using emacs-27.2 for a few years, and now I decided
to upgrade again. However, when going to emacs-28.2, I hit an
issue with the following emacs enhancement (this comes from the
emacs change log):

> 2021-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>
>
>        * lisp/emacs-lisp/byte-run.el (make-obsolete): Make `when` mandatory
>
>        (define-obsolete-function-alias, make-obsolete-variable)
>        (define-obsolete-variable-alias): Adjust similarly.

Because of `when` becoming mandatory, I now get literally hundreds
of messages which look like this when starting up emacs-28.2 ...

> Warning (comp): /path/to/some-elisp-module.el: Error: Wrong number of arguments make-obsolete-variable

I know that I can get rid of these messages by upgrading each and
every one of my installed emacs packages. However, I have several
dozens of these packages, and some are old, no-longer-maintained
modules. It would take me a huge amount of time to replace the
packages that are upgradable and to manually go into all of the
no-longer-maintained packages and change the calling sequence of
`make-obsolete` and the others.

If the `when` parameter was not made mandatory in `make-obsolete`
and its cousins, I would not have to do this huge amount of work
to upgrade emacs.

The `make-obsolete` family of functions are meant to help during
upgrading. However, changing the mandatory/non-mandatory parameter
semantics of those functions is actually an *impediment* to
upgrading.

Is there any existing fix for this problem short of the massive
amount of work needed for me to upgrade and fix all my existing
emacs packages?

I'm thinking of doing something like the following. Put code like
this at the top of my $HOME/.emacs file:

> (if (not (fboundp 'orig-make-obsolete))
>     (fset 'orig-make-obsolete
>           (symbol-function 'make-obsolete)))
> (fmakunbound 'make-obsolete)
> (unintern 'make-obsolete)
> (defun make-obsolete (obsolete-name current-name &optional when-var)
>   (when when-var
>       (orig-make-obsolete obsolete-name current-name when-var)))

... or something like that.

Is this kind of workaround my only hope for avoiding the huge amount
of work necessary to upgrade and fix the code in all of my existing
emacs packages?

... and what do you folks think about the possibility of making the
`when` parameter optional again?

Thank you in advance for any thoughts and suggestions.

-- 
  Lloyd Zusman
  hippoman@potamuses.net
  God bless you.

     .---------, 0__0
    /           (  oo'---,
   /                    oo\
  ,\                      |
  | \                ,=__/
     \              /
     /  /------|  /|
     |__|-'    |__|'



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

end of thread, other threads:[~2023-04-25 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23 13:56 Changes to `make-obsolete` and similar functions make upgrades nearly impossible Lloyd Zusman
2023-04-24  6:24 ` Platon Pronko
2023-04-24  6:59   ` Po Lu
2023-04-24  7:37     ` Platon Pronko
2023-04-25 15:34 ` Ruijie Yu via Users list for the GNU Emacs text editor

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).