From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2018 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33828@debbugs.gnu.org Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154540935431130 (code B ref -1); Fri, 21 Dec 2018 16:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2018 16:22:34 +0000 Received: from localhost ([127.0.0.1]:58704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaNZK-000862-0L for submit@debbugs.gnu.org; Fri, 21 Dec 2018 11:22:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaJWz-00072m-4i for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaJWr-0004tM-GL for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:47 -0500 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,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaJWr-0004t2-BG for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaJWq-0003nA-EO for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaJWm-0004oc-B4 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:42 -0500 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]:37111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaJWk-0004gh-FA for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:38 -0500 Received: by mail-vs1-xe2d.google.com with SMTP id n13so3089055vsk.4 for ; Fri, 21 Dec 2018 04:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=leL4DO/LqazyAhTSBOISNStJCEgu9IaxpyWSTAplyP4=; b=t9mrzTa/3/UYz4/T7dyTSWnlN0fejDx+lfBoXujsaeMwY2ow0UWjVYJ2eULv1/f5ag vluympKwVdjHlCgnZ9c3aGS35JzF1XyvwEr2ca9ew5K008WZvi6ibq9xVyVEGYpyq1Ys RNbSBjYnyP/x+dvVdHC4xj6Dp9JvXWzgZoBEntSF/OYSFPGZQi/PYeqf9trTkwaJZ7Bs ENts+d7L33gobTHw1bitfYu1PuQCocDwt8MwhYI2vqnRMjInbMCPhq2gQsnjz4TuoHqA 19mIzPP+d65/QK9Q7asS3fd42hJmlY8x7UIxoAzWZqBWSFnLqSewdiuht6KxOCoZo+Zt SSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=leL4DO/LqazyAhTSBOISNStJCEgu9IaxpyWSTAplyP4=; b=Qb6FFNSAfBhmHWtmm8C+Ex7fEpAlW7HpsnYUN/S68EQPqIBDJ0nN+N0OOD07qUfGR/ eV79LogSpEGL6HHMPb9gq5+Xvw2By3+uwbVKX1UEv5Sla6SaF+pBrTPbgoRX7kN/QPkw l5l1Hl0R24K+l0/bjCftkhDSJKGI2Gl+7hBwa4+sdv63RjhMxtGqlwnoK7TJYhZ7gojj VAe+fUC0Ogs7eRIzuM7wzWv+jlzJrnHxxfWcAAWM37l/GkDUR4GNR6qPoJUBLh+WQxJx Q2oRpvx4AY/gu9TidiNr8PDDBE7l/hkKqvJtkEhwbxiIvRdqKfTwb5/RqnoGHDLWVoq4 Wt5w== X-Gm-Message-State: AA+aEWY+btIC4HkihVAdao5IbFGGYc+2pQULkFFNueIg7QnrENZjADox DHXj7HfXT4rGLRgyA9tUs5eSePEYFS6YSnWyGtAS3Q== X-Google-Smtp-Source: AFSGD/VW6AH/KTcO0rUc5dNg0+Ceuc/0c17pFbAcfUO/XkbElYW4+5qdfw7gJLWAUY6bwnbitEZAxNGA7ehAGYBztL4= X-Received: by 2002:a05:6102:245:: with SMTP id a5mr906803vsq.162.1545393812097; Fri, 21 Dec 2018 04:03:32 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Date: Fri, 21 Dec 2018 12:02:55 +0000 Message-ID: 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: -4.0 (----) X-Mailman-Approved-At: Fri, 21 Dec 2018 11:22:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, I think I've come across a bug. $ cat f1.el ;;; f1.el --- -*- lexical-binding: t; -*- ;;; Lexical binding is set to T, but the bug happens regardless. (defvar my-special) (provide 'f1) $ cat f2.el ;;; f2.el --- -*- lexical-binding: t; -*- (require 'f1) (defun f2-foo () (let ((my-special 123)) (f2-bar))) (defun f2-bar () my-special) (print (f2-bar)) $ emacs -Q -L . -f batch-byte-compile f2.el In toplevel form: f2.el:5:1:Warning: Unused lexical variable `my-special' In f2-bar: f2.el:10:3:Warning: reference to free variable `my-special' Also: $ emacs -Q -L . -batch -l f2.el Symbol's value as variable is void: my-special Changing f1.el's defvar to have an initial value makes the problem go away, but this behaviour was unexpected to me. Moving defvar inside f2.el also fixes it. Cheers, Lu=C3=ADs From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2018 16:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33828@debbugs.gnu.org Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1545410430402 (code B ref -1); Fri, 21 Dec 2018 16:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2018 16:40:30 +0000 Received: from localhost ([127.0.0.1]:58712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaNqf-00006P-Jy for submit@debbugs.gnu.org; Fri, 21 Dec 2018 11:40:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaLCR-0003E5-Pt for submit@debbugs.gnu.org; Fri, 21 Dec 2018 08:50:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaLCL-0008F9-QB for submit@debbugs.gnu.org; Fri, 21 Dec 2018 08:50:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaLCL-0008EU-MK for submit@debbugs.gnu.org; Fri, 21 Dec 2018 08:50:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaLCK-0006WR-UC for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 08:50:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaLCK-0008Bd-19 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 08:50:40 -0500 Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]:41825) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaLCJ-0008B5-RM for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 08:50:39 -0500 Received: by mail-vk1-xa31.google.com with SMTP id t127so1162251vke.8 for ; Fri, 21 Dec 2018 05:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=us6n5dSssGFAPNmqxcIKg3FGVMafGvBc497PIoGvabU=; b=Hy/Wh2mdDf8jGUMaZnZeSXDZDUqgEjguRUsIHfb0aCs9pbUtMlw2XQBCpJR5VYBu1F dz2unvGh+/rfWjOd//YhSJx4unbyN+gWC4c5wxnAXodLpbB0aqxP11aU6bzZRUVA3VZf r2+xTUCg7j7a4ODliD+d+a2IDb4YKiq8bBgNoHgYy8zAbKDcC75GHryZuYwJAIlK2qXA xLlR5FqMWCmpegY2K1df3IPzOJ7/+BR+BG4DAlGSq3MEdy63sCaX2e9lBcsSoiA0niPP nan3oeCOmUF/6iltEfP6wkDVE1467xglFJzy4LETrXJex3Dc/m+C+eLfmes8eMPJ/4gO Ll5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=us6n5dSssGFAPNmqxcIKg3FGVMafGvBc497PIoGvabU=; b=sLU3nK3zoiLQ2bwGh512fC9/idG3DGWoyv+rHTx2P5GHgEloHSHoXum6aYHuc1LkKg e2jL0uQd+YIno4xdy2VftEW3Iotb3sJSfltLMAYQGWmYcXLAblixGhAEELl/MiK5f4Jn 0DJzn4lXUTs0erVsqSyyOaOFs4+aiw5iu7R0u6DUqwpCnHhg4Zwa+YPOPkiA0Q6Kpf5u D7x5R8OLFa+JGfTEJYrTRTdsP5dLmFYnQlYZ3XoBDs6Eu/QAwGFX+A4Dfl6yFH5rI8tm z79mRL/M0EbvfWqF3oPxsGtbJ+MEp9MhvtaVW5OS8mqxmbXb/k2WnoVM3ETrXeV1xv43 +ngg== X-Gm-Message-State: AJcUukdHYUP1EWchsLspLPT/sdE4lwozSAiCkh/G4Z8HdwJ76b0dORH8 3PQbnHTzfHNes1+20Gb9TY0RzRpM8fLvp5c1s+3GLexw X-Google-Smtp-Source: ALg8bN6LcXUAtrLKym4DwM/z0kWqI1hozs3blJ6539zWMh2uDaZOJtHKEyGTAbZ1pcm6o2umW8DcB8kpu+2Kv2X9mDQ= X-Received: by 2002:a1f:e7c5:: with SMTP id e188mr898512vkh.92.1545400238722; Fri, 21 Dec 2018 05:50:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Date: Fri, 21 Dec 2018 13:50:02 +0000 Message-ID: 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: -4.0 (----) X-Mailman-Approved-At: Fri, 21 Dec 2018 11:40:27 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On Fri, Dec 21, 2018 at 12:02 PM Lu=C3=ADs Oliveira wro= te: > I think I've come across a bug. But it seems to be documented behaviour: Note that specifying a value, even nil, marks the variable as special permanently. Whereas if value is omitted then the variable is only marked special locally (i.e. within the current lexical scope, or file if at the top-level). This can be useful for suppressing byte compilation warnings, see Compiler Errors. (https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Var= iables.html) Please disregard this bug report. :-) Lu=C3=ADs From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 21 11:53:24 2018 Received: (at control) by debbugs.gnu.org; 21 Dec 2018 16:53:25 +0000 Received: from localhost ([127.0.0.1]:58733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaO3A-0000Qe-LI for submit@debbugs.gnu.org; Fri, 21 Dec 2018 11:53:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaO39-0000QQ-6W for control@debbugs.gnu.org; Fri, 21 Dec 2018 11:53:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaO33-0007Is-KQ for control@debbugs.gnu.org; Fri, 21 Dec 2018 11:53:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaO33-0007In-Fo for control@debbugs.gnu.org; Fri, 21 Dec 2018 11:53:17 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gaO33-0005lW-DJ for control@debbugs.gnu.org; Fri, 21 Dec 2018 11:53:17 -0500 Subject: control message for bug 33828 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Fri, 21 Dec 2018 11:53:17 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) severity 33828 minor tag 33828 notabug close 33828 From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2018 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Cc: joaotavora@gmail.com, 33828@debbugs.gnu.org Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.154542288828287 (code B ref 33828); Fri, 21 Dec 2018 20:09:01 +0000 Received: (at 33828) by debbugs.gnu.org; 21 Dec 2018 20:08:08 +0000 Received: from localhost ([127.0.0.1]:58815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaR5b-0007MB-P8 for submit@debbugs.gnu.org; Fri, 21 Dec 2018 15:08:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaR5a-0007Ls-Uy for 33828@debbugs.gnu.org; Fri, 21 Dec 2018 15:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaR5I-0006tk-DS for 33828@debbugs.gnu.org; Fri, 21 Dec 2018 15:07:54 -0500 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 fencepost.gnu.org ([2001:4830:134:3::e]:48994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaR5A-0006dq-Dm; Fri, 21 Dec 2018 15:07:40 -0500 Received: from [176.228.60.248] (port=2043 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gaR0h-0006uA-9k; Fri, 21 Dec 2018 15:04:52 -0500 Date: Fri, 21 Dec 2018 22:02:49 +0200 Message-Id: <83muoybqc6.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from =?UTF-8?Q?Lu=C3=ADs?= Oliveira on Fri, 21 Dec 2018 12:02:55 +0000) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Luís Oliveira > Date: Fri, 21 Dec 2018 12:02:55 +0000 > Cc: João Távora > > I think I've come across a bug. Doesn't look like a bug to me. > (defun f2-foo () > (let ((my-special 123)) > (f2-bar))) > > (defun f2-bar () > my-special) > > (print (f2-bar)) > > > > $ emacs -Q -L . -f batch-byte-compile f2.el > > In toplevel form: > f2.el:5:1:Warning: Unused lexical variable `my-special' That's because you do nothing with the value of f2-bar. > In f2-bar: > f2.el:10:3:Warning: reference to free variable `my-special' > > > Also: > > $ emacs -Q -L . -batch -l f2.el > Symbol's value as variable is void: my-special You need to use defvar in the same file. From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2018 02:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: Eli Zaretskii Cc: =?UTF-8?Q?Lu=C3=ADs?= Oliveira , 33828@debbugs.gnu.org Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.15454467448377 (code B ref 33828); Sat, 22 Dec 2018 02:46:02 +0000 Received: (at 33828) by debbugs.gnu.org; 22 Dec 2018 02:45:44 +0000 Received: from localhost ([127.0.0.1]:59018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaXIO-0002B3-DQ for submit@debbugs.gnu.org; Fri, 21 Dec 2018 21:45:44 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:40100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaXIM-0002Am-JF for 33828@debbugs.gnu.org; Fri, 21 Dec 2018 21:45:42 -0500 Received: by mail-wr1-f47.google.com with SMTP id p4so7038180wrt.7 for <33828@debbugs.gnu.org>; Fri, 21 Dec 2018 18:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=CGnBvx0RVsPf/3vDJwamq8CYJl/9nj4itK4FD72zA3k=; b=sslDQmtKwaGba38rQdvNyE/0foFDnuafg0lJkwVBhkSUiHAmdcoRatbK/6acDlmiCV H67XXpN+NflslDxgi0gCE6JUFQvrAX8uNXcajjbQ9EeykIAVHRST5alKFz5M6jH2+yBa OrB8YVQ3dc2OaqgqYKyvR1JQwFstUTGo/RtlE3TvAFsMr8xZxPzNrGEb+4c/zoCqA4sm L1S1fNSXWF6GQTyxwu8dn/+qhdWeYL8mLUveY0tyMC7gf2bA8Ro3txe41yehZ+U84EeI RzHaobONMg+ikrOUWX5B0t1J2XxFYOji+GAQBa/71Xkl3eb5sS39qRbmb44EuruZfEIg sbLA== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=CGnBvx0RVsPf/3vDJwamq8CYJl/9nj4itK4FD72zA3k=; b=iD/GBvQ+jIfEx1QaHtj0W/bODwJ2sVr+iN2Df+PBLLBmwSbaBUu/4ESSZi0LgXkUvo NCyUfOQjpyaa/spcqDVk9+bDrnGzakjHByONNehyDPQ0pQ9ZS4yQQ6hH8OrC52brVi3g wgiFXyM1xRJYpOLqQK+Xxx/rJyZ07XTgGLqVXk+wyQanHxi3uVubQqpj473BEJyOOkMP 4ukjL40Y5qWYi6qjOjAMTf17jGPe7pFPJpa8w04XehEviNauPTHl1foZP/OISKkJvw9P Q+4xDSnioVFQYqikUXjPx4dII0ZcvMkgEIBdknH7S3RXF7zO4Jpp9EUtOIO/ljt76fmF pBcA== X-Gm-Message-State: AJcUukdefZYqcFyEfFBmNPp/K5+cTZP4Ik/GGiwWN/SCTqNEh2TeJlis J/ou7uNk4vX5cTFI5LwWGDDc0Ace X-Google-Smtp-Source: ALg8bN5i+sDs6B6ukDFS9p80aKGJB9XzcNdgnxAKXYfyIdEZj+qM29Qwo+Sa7j2G4rc0SkTsbLn5nQ== X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr4614742wrx.315.1545446736500; Fri, 21 Dec 2018 18:45:36 -0800 (PST) Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id o3sm5231423wrs.30.2018.12.21.18.45.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Dec 2018 18:45:35 -0800 (PST) From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= References: <83muoybqc6.fsf@gnu.org> Date: Sat, 22 Dec 2018 02:45:32 +0000 In-Reply-To: <83muoybqc6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Dec 2018 22:02:49 +0200") Message-ID: <87lg4i8ek3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) Eli Zaretskii writes: >> From: Lu=C3=ADs Oliveira >> Date: Fri, 21 Dec 2018 12:02:55 +0000 >> Cc: Jo=C3=A3o T=C3=A1vora >>=20 >> I think I've come across a bug. > > Doesn't look like a bug to me. Indeed, it's the behaviour described in the Emacs manual, but the motivation is questionable: it says it's useful for shooshing the byte-compiler's warnings. Aren't there better alternatives to do this instead of imposing this seeming inconsistency? >> (defun f2-foo () >> (let ((my-special 123)) >> (f2-bar))) >>=20 >> (defun f2-bar () >> my-special) >>=20 >> (print (f2-bar)) >>=20 >>=20 >>=20 >> $ emacs -Q -L . -f batch-byte-compile f2.el >>=20 >> In toplevel form: >> f2.el:5:1:Warning: Unused lexical variable `my-special' > > That's because you do nothing with the value of f2-bar. f2-bar is a function, and it is called. Did you mean 'my-special'? It is used as well, in f2-bar. >> Also: >>=20 >> $ emacs -Q -L . -batch -l f2.el >> Symbol's value as variable is void: my-special > > You need to use defvar in the same file. Or alternatively, use the variable in a different file but ensure the defvar was declared with an initial value. When you do that, it produces the expected behaviour for someone who is accustomed to other Lisps lexical and dynamic binding, such as Common Lisp. In other words, it's the edge case defvar-in-different-file-with-no-initial-binding that we're questioning here. The presence of the initial binding seems to matter, even though its value is useless. Jo=C3=A3o From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2018 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: luismbo@gmail.com, 33828@debbugs.gnu.org Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.15454646965301 (code B ref 33828); Sat, 22 Dec 2018 07:45:02 +0000 Received: (at 33828) by debbugs.gnu.org; 22 Dec 2018 07:44:56 +0000 Received: from localhost ([127.0.0.1]:59096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gabxw-0001NP-IK for submit@debbugs.gnu.org; Sat, 22 Dec 2018 02:44:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gabxu-0001N8-Ua for 33828@debbugs.gnu.org; Sat, 22 Dec 2018 02:44:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gabxk-0002vO-MY for 33828@debbugs.gnu.org; Sat, 22 Dec 2018 02:44:47 -0500 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 fencepost.gnu.org ([2001:4830:134:3::e]:33790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gabxH-0002Wr-Et; Sat, 22 Dec 2018 02:44:44 -0500 Received: from [176.228.60.248] (port=1315 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gabxG-00073v-Cx; Sat, 22 Dec 2018 02:44:15 -0500 Date: Sat, 22 Dec 2018 09:43:59 +0200 Message-Id: <83bm5eatvk.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87lg4i8ek3.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Sat, 22 Dec 2018 02:45:32 +0000) References: <83muoybqc6.fsf@gnu.org> <87lg4i8ek3.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: João Távora > Cc: Luís Oliveira , > 33828@debbugs.gnu.org > Date: Sat, 22 Dec 2018 02:45:32 +0000 > > >> (defun f2-foo () > >> (let ((my-special 123)) > >> (f2-bar))) > >> > >> (defun f2-bar () > >> my-special) > >> > >> (print (f2-bar)) > >> > >> > >> > >> $ emacs -Q -L . -f batch-byte-compile f2.el > >> > >> In toplevel form: > >> f2.el:5:1:Warning: Unused lexical variable `my-special' > > > > That's because you do nothing with the value of f2-bar. > > f2-bar is a function, and it is called. Did you mean 'my-special'? It > is used as well, in f2-bar. I meant the value returned by f2-bar in f2-foo. From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2018 22:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Eli Zaretskii , luismbo@gmail.com, 33828@debbugs.gnu.org Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.154551847223522 (code B ref 33828); Sat, 22 Dec 2018 22:42:02 +0000 Received: (at 33828) by debbugs.gnu.org; 22 Dec 2018 22:41:12 +0000 Received: from localhost ([127.0.0.1]:60298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gapxH-00067J-JV for submit@debbugs.gnu.org; Sat, 22 Dec 2018 17:41:11 -0500 Received: from mail-oi1-f175.google.com ([209.85.167.175]:34012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gapxD-00066s-GP for 33828@debbugs.gnu.org; Sat, 22 Dec 2018 17:41:09 -0500 Received: by mail-oi1-f175.google.com with SMTP id r62so7675515oie.1 for <33828@debbugs.gnu.org>; Sat, 22 Dec 2018 14:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gJxxtF3WM3L4Q2Db5Zs37e4rXnb4lf4R/vHyIMPlvOk=; b=mBmsrZUxGKFndcQw9+CSdOCllCmszfpbL8e3fFpmzsD2QDsYX6U06Dk82do8VVHfeW IGaAJhGf08LiFYVUbU0739fGt0qYlA5J/O1iTww2ll4rSkizBnh0/izXzXB3Kpehmk1Q CyKytrBx/iFMq5umsz9Bbkq7RJ7VVFTOnHmw/Rl82rTrY0mSH1ifGaBDfXb7E4BCvuKa Z/SVZQ7mQvsSxzpOBGceY5yP0YadQLgqqvDU5Ke0qRrwGPhazuCuAxwEfrMsgLM4E9lR LbjEwh0aG1RaDRFeK84vAOW/onkBfATt44DaJblpVM848vQkWwZLofHCXT89U7i7TCC5 DVnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gJxxtF3WM3L4Q2Db5Zs37e4rXnb4lf4R/vHyIMPlvOk=; b=Zw4pOYoZcI+xDwJxF8eDbEu7zdpsrnlJobctzjaCxlrQioZ7f8LIhRAekuG5KpnN+t VwWSGMwt/Arten6hr9bPVaVaf9DXG/TvU1nFzzN88UaeP23zfSeCvrvJMwmErrg799bC ma3EIaRIDWls9GNthVucxH+VdmwtRzv5o5GNbGhhs2qWt01QZzNkc0YllO/fY/oB3JZZ iZkC1SyiZnmp6j5i6TW7Oj+NbT111Klxp3PQpQwC0uB0no+P/EeJG12ioevm3Ev4j0Hz Mee8DTlzt62vNDuK5Tu8raV0mn8p4uDOYKSjo+naw1gstdHpVc16W9hUwD83rCGnTTB1 XSBQ== X-Gm-Message-State: AA+aEWZGDr//GYr5DV9cD3PS2Lq8+Cll+EO1xRi1x5CHVxIowMCGPVnh hNcy0Ar3NAHN7ezPho41dY1fmFjYKxmidGoQdOQ= X-Google-Smtp-Source: AFSGD/VAeKaMVAYY7G77dWnAN5gUneiAPZ7W8R/r1zobiNIgdy7qbnSKCmuOdT331lfBxEmK49ZG8YqDqRcbkrNnMiE= X-Received: by 2002:aca:5d84:: with SMTP id r126mr4956744oib.227.1545518461755; Sat, 22 Dec 2018 14:41:01 -0800 (PST) MIME-Version: 1.0 References: <83muoybqc6.fsf@gnu.org> <87lg4i8ek3.fsf@gmail.com> In-Reply-To: <87lg4i8ek3.fsf@gmail.com> From: Philipp Stephani Date: Sat, 22 Dec 2018 23:40:50 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am Sa., 22. Dez. 2018 um 03:46 Uhr schrieb Jo=C3=A3o T=C3=A1vora : > > Eli Zaretskii writes: > > >> From: Lu=C3=ADs Oliveira > >> Date: Fri, 21 Dec 2018 12:02:55 +0000 > >> Cc: Jo=C3=A3o T=C3=A1vora > >> > >> I think I've come across a bug. > > > > Doesn't look like a bug to me. > > Indeed, it's the behaviour described in the Emacs manual, but the > motivation is questionable: it says it's useful for shooshing the > byte-compiler's warnings. Aren't there better alternatives to do this > instead of imposing this seeming inconsistency? The better alternative is to explicitly `require' the library that defines the variable. I see the one-argument `defvar' as the variable equivalent to `declare-function' - it announces that a variable exists without defining it. (Maybe there should be a `declare-variable' macro to mirror `declare-function'.) As such, its use should be exceptional; most libraries should make sure to not have cyclic dependencies and use plain `require'. From unknown Sat Jun 21 05:16:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33828: 26.1; Unbound defvar across compilation units Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Dec 2018 01:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug To: Philipp Stephani Cc: Eli Zaretskii , =?UTF-8?Q?Lu=C3=ADs?= Borges de Oliveira , 33828@debbugs.gnu.org Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.154552781621240 (code B ref 33828); Sun, 23 Dec 2018 01:17:01 +0000 Received: (at 33828) by debbugs.gnu.org; 23 Dec 2018 01:16:56 +0000 Received: from localhost ([127.0.0.1]:60370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gasO0-0005WW-Gi for submit@debbugs.gnu.org; Sat, 22 Dec 2018 20:16:56 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:39081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gasNz-0005WJ-LF for 33828@debbugs.gnu.org; Sat, 22 Dec 2018 20:16:55 -0500 Received: by mail-qt1-f169.google.com with SMTP id u47so5486699qtj.6 for <33828@debbugs.gnu.org>; Sat, 22 Dec 2018 17:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5bmC5FhCFb+LOs6hiMM+hr2flCFfWsTdYbH75g3pb9Q=; b=uBD37HYakRheIVmN+wCEk3yZj9gE9Psw8Cp1CDgHeHF5ACWHUfydjazfckq1YZ2EbQ lGeFa4i0D1rbV9FlkLC4An8bAfhjncMvt6AtaoWigYaqO9/bzvAHqA9NZ11MVw5kQGQL 2np+jjEsTaPhu5ZoXrTh/f8xV2zXAENEZJEXcKGG8/k2QY/RH+WHHz9/MzzPYqGIpU9V yXD88D4gau/gIU5UlDCVyU0e23zLxODMMEU905ULefgu7HXcHj1XgPvUXSbUafgfTvMX SKhUfkaitFQF9pXHHXBNvJ2qejif8OX5lOeIdnUJ1b1ttET01HLv/E8jNgVTgfa6OjcP qMKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5bmC5FhCFb+LOs6hiMM+hr2flCFfWsTdYbH75g3pb9Q=; b=Yf1SrQii5dCxCcInZf7PjbOMiKFh9xLq5ipOzZ+b8F0grbzDMMCycxdJ6SLWFv+Trm 7l+GGkgkTeW1F3AEU3+c9pRLbXeF+79KC5AC0pYl2SA8lwuCxqwd/MZaNOpaby465BUH B3yVGqiwj9PblhkVdvvRC7zkeijL7t7azNyKuKgGaCh8UvMTpXHRGUmD+5seEGGEU/Yr yOb0i7rXkLiw02ljOAGdAy3nygQZo1KMTQrNqN6H50g23os0/A9sAr0Hbz9eWG61Xo+J MYuzbmO11hvFgrlgZwZpz0Wfe76wdF98AtuamH14efnioWbc6E6sEIBiW+WF5AwOsnTf cMkQ== X-Gm-Message-State: AJcUukcQ/m8wgsqZZ5llXdBgywWMeOrXOUDtphDVEh2xzMK7SlU1M8NW AcywQFodx3sUVre9fbGH7gUL2xLnYF2AEVtNdIA= X-Google-Smtp-Source: AFSGD/VhSgKMvwDUf3aVQuKcTSozeTehQnfoWX9cf78rNo6mhDkx11lHj9PFu7GADfFWNLojhypgD83acVowF6rBGbo= X-Received: by 2002:ac8:3790:: with SMTP id d16mr7692396qtc.20.1545527810183; Sat, 22 Dec 2018 17:16:50 -0800 (PST) MIME-Version: 1.0 References: <83muoybqc6.fsf@gnu.org> <87lg4i8ek3.fsf@gmail.com> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Sun, 23 Dec 2018 01:16:38 +0000 Message-ID: Content-Type: multipart/alternative; boundary="0000000000001dd878057da63cad" X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) --0000000000001dd878057da63cad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Dec 22, 2018 at 10:41 PM Philipp Stephani wrote: > Am Sa., 22. Dez. 2018 um 03:46 Uhr schrieb Jo=C3=A3o T=C3=A1vora < > joaotavora@gmail.com>: > > > > Eli Zaretskii writes: > > > > >> From: Lu=C3=ADs Oliveira > > >> Date: Fri, 21 Dec 2018 12:02:55 +0000 > > >> Cc: Jo=C3=A3o T=C3=A1vora > > >> > > >> I think I've come across a bug. > > > > > > Doesn't look like a bug to me. > > > > Indeed, it's the behaviour described in the Emacs manual, but the > > motivation is questionable: it says it's useful for shooshing the > > byte-compiler's warnings. Aren't there better alternatives to do this > > instead of imposing this seeming inconsistency? > > The better alternative is to explicitly `require' the library that > defines the variable. > I see the one-argument `defvar' as the variable equivalent to > `declare-function' - it announces that a variable exists without > defining it. (Maybe there should be a `declare-variable' macro to > mirror `declare-function'.) As such, its use should be exceptional; > most libraries should make sure to not have cyclic dependencies and > use plain `require'. > I think in Lu=C3=ADs original report there is a `require' of the library wh= ere the variable is declared before using it. Unfortunately it only works when it is declared with an initial value. Jo=C3=A3o --0000000000001dd878057da63cad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Dec 22, 2018 at 10:41 PM Philipp = Stephani <p.stephani2@gmail.com= > wrote:
Am Sa., 22. Dez. 2018 um 03:46 Uhr schrieb Jo=C3= =A3o T=C3=A1vora <joaotavora@gmail.com>:
>
> Eli Zaretskii <el= iz@gnu.org> writes:
>
> >> From: Lu=C3=ADs Oliveira <luismbo@gmail.com>
> >> Date: Fri, 21 Dec 2018 12:02:55 +0000
> >> Cc: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>
> >>
> >> I think I've come across a bug.
> >
> > Doesn't look like a bug to me.
>
> Indeed, it's the behaviour described in the Emacs manual, but the<= br> > motivation is questionable: it says it's useful for shooshing the<= br> > byte-compiler's warnings.=C2=A0 Aren't there better alternativ= es to do this
> instead of imposing this seeming inconsistency?

The better alternative is to explicitly `require' the library that
defines the variable.
I see the one-argument `defvar' as the variable equivalent to
`declare-function' - it announces that a variable exists without
defining it. (Maybe there should be a `declare-variable' macro to
mirror `declare-function'.) As such, its use should be exceptional;
most libraries should make sure to not have cyclic dependencies and
use plain `require'.

I think in Lu=C3=ADs original report= there is a `require' of the library where
the variable is de= clared before using it. Unfortunately it only works
when it = is declared with an initial value.

Jo=C3=A3o
--0000000000001dd878057da63cad--