emacs-devel
[Top][All Lists]
Advanced

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

Re: master 60102016e4: Abolish max-specpdl-size (bug#57911)


From: Alan Mackenzie
Subject: Re: master 60102016e4: Abolish max-specpdl-size (bug#57911)
Date: Tue, 20 Sep 2022 14:56:29 +0000

Hello, Mattias.

On Tue, Sep 20, 2022 at 14:49:40 +0200, Mattias Engdegård wrote:
> 20 sep. 2022 kl. 14.15 skrev Michael Albinus <michael.albinus@gmx.de>:

> > Tramp needs this for Emacs 26. I've wrapped it with `with-no-warnings'.

> Thank you, but maybe silencing all warnings in the affected code was a
> cudgel heavier than the situation called for?  Perhaps something like
> this would do:

> > (defmacro tramp--with-max-specpdl-size (new-limit &rest body)
> >   (declare (indent 1))
> >   (if (< emacs-major-version 29)
> >       `(let ((max-specpdl-size ,new-limit)) . ,body)
> >     `(progn . ,body))))

> Or we could postpone the obsoletion for a while. The change was made
> partly for user convenience, but the typically package maintainer may
> not agree that this has been achieved: there is no way to be avoid
> warnings in code that has to work on previous Emacs versions without
> making it uglier.

> Would it be a bad idea to, say, make a note to obsolete
> max-specpdl-size in Emacs 31? 

I suspect it would go the same way as font-lock-reference-face did.  That
face was renamed to font-lock-constant-face in the early 1990s, with an
alias.  People just continued to use the alias.

If you postpone the obsoletion of m-s-s to Emacs 31, the code using it
probably won't change until then.  :-(

I suspect I am going to implement a macro something like:

(defmacro c-maybe-max-specpdl-size-let (varlist &rest body)
  (let ((-varlist- varlist) msp-binding)
    (if (get 'max-specpdl-size 'byte-obsolete-variable)
        (cond
         ((memq 'max-specpdl-size -varlist-)
          (setq -varlist- (delq 'max-spec-pdl-size -varlist-)))
         ((setq msp-binding (assq 'max-spec-pdl-size -varlist-))
          (setq -varlist- (delq msp-binding -varlist-)))))
    `(let ,varlist ,@body)))

..  Which points out a deficit in Emacs, namely the lack of functions
obsolete-variable-p and obsolete-function-p.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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