GNU bug report logs - #75521
scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 12 Jan 2025 17:56:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 75521 <at> debbugs.gnu.org, pipcet <at> protonmail.com
Subject: bug#75521: scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX
Date: Wed, 15 Jan 2025 22:45:21 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Wed, 15 Jan 2025 19:45:55 +0000
> Cc: pipcet <at> protonmail.com, 75521 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Are you okay with removing this on the scratch/igc branch only?
> >
> > I have no problems with doing that on the branch conditioned by
> > "#ifdef HAVE_MPS", if indeed DEFVAR_LISP_NOPRO is equivalent to
> > DEFVAR_LISP there.
> 
> Thanks, done in commit de864e4f3b2.

Too bad you did that while we are still discussing the issue.  Why the
haste?  The result is that we now have confusing code, see below.

> > But are they indeed equivalent?  staticpro still
> > exists on the branch, and AFAICT we create a root from staticvec.  So
> > why are they equivalent?
> 
> Yes, they had the same definition:
> 
> #define DEFVAR_LISP(lname, vname, doc)			\
>   do {							\
>     static struct Lisp_Fwd const o_fwd			\
>       = {Lisp_Fwd_Obj, .u.objvar = &globals.f_##vname};	\
>     defvar_lisp (&o_fwd, lname);			\
>   } while (false)
> #ifdef HAVE_MPS
> #define DEFVAR_LISP_NOPRO(lname, vname, doc)		\
>   do {							\
>     static struct Lisp_Fwd const o_fwd			\
>       = {Lisp_Fwd_Obj, .u.objvar = &globals.f_##vname};	\
>     defvar_lisp (&o_fwd, lname);			\
>   } while (false)
> #else

Heh, I was looking at these:

  void
  defvar_lisp_nopro (struct Lisp_Fwd const *o_fwd, char const *namestring)
  {
    eassert (o_fwd->type == Lisp_Fwd_Obj);
    Lisp_Object sym = intern_c_string (namestring);
    XBARE_SYMBOL (sym)->u.s.declared_special = true;
    XBARE_SYMBOL (sym)->u.s.redirect = SYMBOL_FORWARDED;
    SET_SYMBOL_FWD (XBARE_SYMBOL (sym), o_fwd);
  }

  void
  defvar_lisp (struct Lisp_Fwd const *o_fwd, char const *namestring)
  {
    eassert (o_fwd->type == Lisp_Fwd_Obj);
    defvar_lisp_nopro (o_fwd, namestring);
    staticpro (o_fwd->u.objvar);
  }

(which are still different) because I remembered that the macros just
called the functions.  And your changes didn't remove
defvar_lisp_nopro.  Isn't that confusing?




This bug report was last modified 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.