GNU bug report logs - #24354
Address some compiler warnings in undo-tree

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Jonas Bernoulli <jonas@HIDDEN>; Keywords: patch; merged with #30235; dated Fri, 2 Sep 2016 13:33:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 24354 30235. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'minor' from 'wishlist' Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Sep 2016 13:32:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 02 09:32:45 2016
Received: from localhost ([127.0.0.1]:47092 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bfoaL-00089H-3P
	for submit <at> debbugs.gnu.org; Fri, 02 Sep 2016 09:32:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48109)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jonas@HIDDEN>) id 1bfoaJ-000894-TH
 for submit <at> debbugs.gnu.org; Fri, 02 Sep 2016 09:32:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jonas@HIDDEN>) id 1bfoaD-00027h-Im
 for submit <at> debbugs.gnu.org; Fri, 02 Sep 2016 09:32:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:57636)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jonas@HIDDEN>) id 1bfoaD-00027d-Fk
 for submit <at> debbugs.gnu.org; Fri, 02 Sep 2016 09:32:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39076)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jonas@HIDDEN>) id 1bfoaB-0007iA-94
 for bug-gnu-emacs@HIDDEN; Fri, 02 Sep 2016 09:32:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jonas@HIDDEN>) id 1bfoa7-00026u-1t
 for bug-gnu-emacs@HIDDEN; Fri, 02 Sep 2016 09:32:34 -0400
Received: from mail.hostpark.net ([212.243.197.30]:45030)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jonas@HIDDEN>) id 1bfoa6-00026X-NL
 for bug-gnu-emacs@HIDDEN; Fri, 02 Sep 2016 09:32:30 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id C7FD316A38;
 Fri,  2 Sep 2016 15:32:27 +0200 (CEST)
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124)
 with ESMTP id rFfWHiYo6pi9; Fri,  2 Sep 2016 15:32:27 +0200 (CEST)
Received: from hal (178-82-62-170.dynamic.hispeed.ch [178.82.62.170])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id 8CAAB16A36;
 Fri,  2 Sep 2016 15:32:26 +0200 (CEST)
User-agent: mu4e 0.9.17; emacs 25.1.1
From: Jonas Bernoulli <jonas@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Toby Cubitt <toby-undo-tree@HIDDEN>
Subject: Address some compiler warnings in undo-tree
Date: Fri, 02 Sep 2016 15:32:26 +0200
Message-ID: <878tva8m1h.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Hello,

The below two commits address some compiler warnings in `undo-tree',
which is available from GNU Elpa.  They should be applied to the
upstream repository, which should then be merged into its Elpa
subtree.

Earlier I have pointed out that `undo-tree' isn't currently being
properly merged into the Elpa repository.  See debbugs#24303.  It
would probably be a good idea to take care of that first.

----------------------------------------------------------------
After applying these two patches the byte-compiler still complains
about some other things:

    In undo-tree-pull-undo-in-region-branch:
    undo-tree.el:2279:36:Warning: =E2=80=98undo-elt-crosses-region=E2=80=99=
 is an obsolete
        function (as of 25.1).

    In undo-tree-pull-redo-in-region-branch:
    undo-tree.el:2476:25:Warning: =E2=80=98undo-elt-crosses-region=E2=80=99=
 is an obsolete
        function (as of 25.1).

    In end of data:
    undo-tree.el:4381:1:Warning: the function =E2=80=98gv--defsetter=E2=80=
=99 might not be
        defined at runtime.

Maybe `undo-elt-crosses-region' should not be declared to be obsolete
since `undo-tree' still uses it, or maybe `undo-tree' should stop using
it.  I don't know.

`undo-tree.el' requires `cl' and uses `defsetf' which is defined there.
The `defsetf' macro uses some functions from `gv.el', without requiring
`gv'.  Simply requiring `gv' in `undo-tree' should be avoided because
that would break compatibility with older Emacsen.  Also it does not
actually make that warning go away.  However it might be the case that
without explicitly requiring `gv' when using Emacsen that come with that
library might mean that `gv' might end up not being loaded at run-time,
and should therefore be explicitly loaded for such Emacsen.  I don't
know.

----------------------------------------------------------------
The following changes since commit a3e81b682053a81e082139300ef0a913a7a610=
a2
are available in the git repository at:

  git@HIDDEN:tarsius/undo-tree.git silencio

for you to fetch.

----------------------------------------------------------------
Jonas Bernoulli (2):
      Use _ as VAR in calls to dotimes.
      Declare two mode variables to silence byte-compiler.

 undo-tree.el | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

----------------------------------------------------------------
Toby, I am aware that I have suggested before that you use `_' as VAR in
calls to `dotimes' instead of `i'.  You rejected that suggestion,
claiming that the byte-compiler complaining about `i' not being used is
a bug.

That is not so, it is a feature, which is helpful when you accidentially
don't use `i'.  The byte-compiler *not* complaining when you use `_'
instead is also a feature, it allows using `dotimes' even when you
intentionally don't use `_' without getting these warnings which would
be bogus in this case.  This is not unique to `dotimes' and I think that
now that `undo-tree' is part of Emacs/Elpa you should respect those
conventions / use those features, even if you should think that they are
misguided.

  Best regards,
  Jonas




Acknowledgement sent to Jonas Bernoulli <jonas@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#24354; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 26 Jan 2018 14:15:02 UTC

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