GNU bug report logs - #21466
[PATCH] Avoid defining (temporarily) vars and functions

Previous Next

Packages: cc-mode, emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sat, 12 Sep 2015 03:41:01 UTC

Severity: normal

Tags: patch, wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 21466 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 21466 <at> debbugs.gnu.org
Subject: Re: bug#21466: [PATCH] Avoid defining (temporarily) vars and functions
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 <monnier <at> iro.umontreal.ca> 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).




This bug report was last modified 3 years and 110 days ago.

Previous Next


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