Subject: bug#21466: [PATCH] Avoid defining (temporarily) vars and functions

From: Alan Mackenzie <[email-masked]>
Date: Tue, 11 May 2021 20:34:30 +0000

Hello, Lars.

On Mon, May 10, 2021 at 13:45:21 +0200, Lars Ingebrigtsen wrote:
> Stefan Monnier <[email-masked]> writes:

> > CC-mode currently defines various non-CC-mode variables and functions
> > with dummy values, as a way to avoid byte-compiler warnings when using
> > those external vars/functions.

> > Since this is dangerous business, CC-mode has to be extra careful to
> > undo such settings when they're not needed any more.

> This was five years ago, but skimming the code, it seems like it's
> generally applicable still?

> Alan, do you have any comments on this patch?

I meant to comment on it back then, but the patch is unusually difficult
to follow: most of the context lines are unhelpful in giving the
context, and the git macros identifying the current function in the diff
aren't working here, to a large degree.

There are little things I'm unhappy about with the patch: it explicitly
tests (featurep 'xemacs), which is not done in CC Mode, being regarded
as somewhat vulgar.  Instead specific functionalities are always tested
for.

Also, in place of cc-bytecomp-defun is proposed declare-function.
However this is in an inconsistent state, with the documentation
requiring a FILE argument, but Stefan's patch supplying nil.

It seems that cc-bytecomp-defvar has long (?always) been unnecessary,
given that (defvar foo) has ?always had the desired effect, even in
XEmacs.  So I don't have anything against clearing out the
cc-bytecomp-defvar's.

So, I don't object on principle to the principle of the patch, just
there are these little irritations about it, and it will need me to
study it more closely to check nothing subtle would get lost (I doubt it
would).

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).