help-gnu-emacs
[Top][All Lists]
Advanced

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

Changes to `make-obsolete` and similar functions make upgrades nearly im


From: Lloyd Zusman
Subject: Changes to `make-obsolete` and similar functions make upgrades nearly impossible.
Date: Sun, 23 Apr 2023 13:56:58 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.16

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\
 ,\                      |
 | \                ,=__/
    \              /
    /  /------|  /|
    |__|-'    |__|'



reply via email to

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