From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.bugs Subject: bug#13814: 24.3.50; Dynamic variables shadowing prevent defvar Date: Mon, 25 Feb 2013 20:30:29 +0100 Message-ID: <87hal0199m.fsf@orion.kollektiv-hamburg.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361824529 655 80.91.229.3 (25 Feb 2013 20:35:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 20:35:29 +0000 (UTC) To: 13814@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 25 21:35:52 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UA4m1-0007Wp-Hi for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 21:35:45 +0100 Original-Received: from localhost ([::1]:60609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA4lg-0007VT-Qf for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 15:35:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA4le-0007Uz-QO for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 15:35:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA4ld-0001TR-GQ for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 15:35:22 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA4ld-0001TH-CJ for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 15:35:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UA4nF-0002nM-Nx for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 15:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jorgen Schaefer Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 20:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13814 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136182461110724 (code B ref -1); Mon, 25 Feb 2013 20:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Feb 2013 20:36:51 +0000 Original-Received: from localhost ([127.0.0.1]:50031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA4n4-0002mv-KM for submit@debbugs.gnu.org; Mon, 25 Feb 2013 15:36:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44198) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA4n1-0002mk-HU for submit@debbugs.gnu.org; Mon, 25 Feb 2013 15:36:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA3l7-0006CE-Li for submit@debbugs.gnu.org; Mon, 25 Feb 2013 14:30:50 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:51010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA3l7-0006C5-CE for submit@debbugs.gnu.org; Mon, 25 Feb 2013 14:30:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA3l0-0005WZ-6G for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 14:30:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA3kw-000691-EN for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 14:30:38 -0500 Original-Received: from istinn.electusmatari.com ([83.169.37.145]:52071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA3kw-00068b-5y for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 14:30:34 -0500 Original-Received: from orion.kollektiv-hamburg.de (hmbg-4d06b82d.pool.mediaWays.net [77.6.184.45]) by istinn.electusmatari.com (Postfix) with ESMTPSA id 17421D10001E for ; Mon, 25 Feb 2013 20:30:32 +0100 (CET) Original-Received: by orion.kollektiv-hamburg.de (Postfix, from userid 1000) id 2F22632CAD6; Mon, 25 Feb 2013 20:30:30 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71799 Archived-At: When a file is autoloaded, defvar will fail to define locally-set, dynamic variabls, resulting in such variables not being defined at all, even after their local binding ends. Situation: (let ((some-var-that-influences-behavior t)) (some-function-that-autoloads-a-library)) If the library which is autoloaded by `some-function-that-autoloads-a-library' defines `some-var-that-influences-behavior' using defvar or defcustom, the variable is never bound globally because defvar thinks it's already defined. I would expect defvar to notice that the variable is bound only locally/temporarily and define a global binding anyhow. Reproduction: Put this file, bug-lib.el, somewhere in `load-path': -----8<----- bug-lib.el -----8<----- (defvar bug-variable t "This variable is not defined when autoloaded.") (defun bug-variable-value () bug-variable) ----->8----- ---------- ----->8----- Then execute the following lines: (autoload 'bug-variable-value "bug-lib.el") (let ((bug-variable nil)) (bug-variable-value)) => nil (bug-variable-value) => Error, `bug-variable' is not defined. Regards, -- Jorgen In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu) Bzr revision: 111608 schwab@linux-m68k.org-20130126151309-wk3nb8t4xitw94lh Configured using: `configure --without-x --with-x-toolkit=no'