From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#5950: defvaralias after defvar should be warned in runtime Date: Wed, 01 Aug 2018 22:14:05 -0400 Message-ID: <87sh3xzf9u.fsf@gmail.com> References: <4BC6A096.8030801@yahoo.co.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1533175987 7519 195.159.176.226 (2 Aug 2018 02:13:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Aug 2018 02:13:07 +0000 (UTC) Cc: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel To: 5950@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 02 04:13:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl36s-0001qq-Ld for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Aug 2018 04:13:02 +0200 Original-Received: from localhost ([::1]:43588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fl38z-0004mR-Ck for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Aug 2018 22:15:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fl38r-0004jU-Tj for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 22:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fl38o-0001o7-NO for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 22:15:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fl38o-0001nc-DH for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 22:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fl38n-000488-VQ for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 22:15:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4BC6A096.8030801@yahoo.co.jp> Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Aug 2018 02:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5950 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 5950-submit@debbugs.gnu.org id=B5950.153317605415801 (code B ref 5950); Thu, 02 Aug 2018 02:15:01 +0000 Original-Received: (at 5950) by debbugs.gnu.org; 2 Aug 2018 02:14:14 +0000 Original-Received: from localhost ([127.0.0.1]:38104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl382-00046n-CH for submit@debbugs.gnu.org; Wed, 01 Aug 2018 22:14:14 -0400 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:55197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl380-00046a-8e for 5950@debbugs.gnu.org; Wed, 01 Aug 2018 22:14:12 -0400 Original-Received: by mail-it0-f44.google.com with SMTP id s7-v6so1078544itb.4 for <5950@debbugs.gnu.org>; Wed, 01 Aug 2018 19:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=2K/ni35GQot+cgB1iBIF2h+CQTT0nPOqaS7ryIveNcE=; b=EVVX265VebTg/6wtqUtWNzP0MqrFDKVukmtjrsbJhj3drtgrAjGGZJ/lRkbdQVkNZP BQwQEqdIRIeDaZc4DJqfBpgtSo/bRWRRRlXIyM51lJFG+FJaVqZeKUa8g/EN1jXFfZjj PAsr0yCWg81YQ3qTsu0IiQAPxHnwClgrwTJ2WouRdRYnvT6w0i0OlzpWEX0pgYy8EjA7 9cJN8f89aLkanKmPknPp4P2KCqqQJ0QkSxDFlimpszr/9iAVs4/xHTSD98XStOlMeWBm gaZbt6SSGf1TF85i51KjkUvKQpnr3HVsAkN2OpbP1vuq6ltzrLq63TykjMfdMOu0d3HK PlWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=2K/ni35GQot+cgB1iBIF2h+CQTT0nPOqaS7ryIveNcE=; b=DkP+MnGCnsO08g1l7oK0naUN766byIURAjDY4FOV5vK6WRG+tRMr+lm0QhpJM97qCC IigOgClx93rDuPBLDxJ0+FVwyegWvUcr0sLlYVPLZ9Pa+AZvP2x56B1cvxrLgs+dfF4J vOCN5SzDlUu1KQMAF+wzQ8ctNitEPBtFeAoNudbKLJgevbkmXtjh4pAIlumMGgKfN9gf d+iwsDKwDwEIwkNYZlbWtXS6HCzQ8SehoyxYlcvRzGMfvFAAnFjsPY2aqmCrJjMhuTpK LSp3VEF2N5JLlFcKFrw/oEpY308uh4kRO0Fd/dRCx7xHmxRXxUzPOTGswkrTT27aOGSE 2RNQ== X-Gm-Message-State: AOUpUlH5J5Fg2PQxqbn6HEMs3wy+gQ6NJbkySOZRYcjQwnv1SVDMezxD RiHK85ZXAyVYh8DRtdFNuoI= X-Google-Smtp-Source: AAOMgpfoTkmc15+nfz17hu4OR8XN2ByuOaNmXM1MtAAavgUNLKoKZS4cGDJ+kD5EtKU+Hz8mCuWzCg== X-Received: by 2002:a24:704f:: with SMTP id f76-v6mr918013itc.30.1533176046895; Wed, 01 Aug 2018 19:14:06 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c18-v6sm198140ioi.3.2018.08.01.19.14.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 19:14:06 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149193 Archived-At: --=-=-= Content-Type: text/plain [forwarding to list, original didn't make it because bug was archived] --=-=-= Content-Type: message/rfc822 Content-Disposition: inline To: Noam Postavsky , Stefan Monnier References: <4BC6A096.8030801@yahoo.co.jp> <87r5gu34ag.wl%irieshinsuke@yahoo.co.jp> <3keicu1h3v.fsf@fencepost.gnu.org> <874liufjfj.fsf@gmail.com> <871sdyezwl.fsf@gmail.com> <87vaaoxm1z.fsf@gmail.com> From: =?utf-8?Q?Cl=C3=A9ment_Pit-Claudel?= Subject: Re: bug#5950: defvaralias after defvar should be warned in runtime Message-ID: Date: Wed, 1 Aug 2018 14:55:56 -0400 In-Reply-To: <87vaaoxm1z.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Noam, I just updated my Emacs and ran into this warning, but I have no idea what's wrong with the following code :) (defvaralias 'flycheck-python-pylint-executable 'python-shell-interpreter) (defvaralias 'flycheck-python-flake8-executable 'python-shell-interpreter) These two variables `flycheck-&-executable' are configuration knobs created by Flycheck, and I never want to set them individually; instead, I want them to have the same value as `python-shell-interpreter'. While the code above works, it also pops a "warning" buffer now: Warning (defvaralias): Overwriting value of =E2=80=98flycheck-python-pylint= -executable=E2=80=99 by aliasing to =E2=80=98python-shell-interpreter=E2=80= =99 Warning (defvaralias): Overwriting value of =E2=80=98flycheck-python-flake8= -executable=E2=80=99 by aliasing to =E2=80=98python-shell-interpreter=E2=80= =99 I've set warning-suppress-log-types to '(defvaralias losing-value) to work around this, but was the warning actually intended in this case? Cl=C3=A9ment. --=-=-= Content-Type: text/plain It's warning because you overwrite the original value of flycheck-python-pylint-executable when you call defvaralias. In this case you intended that, but usually it's a mistake. You could make the warning suppression more selective by adding (defvaralias losing-value flycheck-python-pylint-executable) and (defvaralias losing-value flycheck-python-flake8-executable) to warning-suppress-log-types. Alternatively, you could do (setq flycheck-python-pylint-executable python-shell-interpreter) (defvaralias 'flycheck-python-pylint-executable 'python-shell-interpreter) (setq flycheck-python-flake8-executable python-shell-interpreter) (defvaralias 'flycheck-python-flake8-executable 'python-shell-interpreter) (the warning doesn't trigger if the value being overwritten is `eq' to the new one). --=-=-=--