From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: The two-argument form of defvar Date: Thu, 19 Mar 2015 16:52:43 +0100 Message-ID: <87mw396l2s.fsf@gnu.org> References: <87vbhxf2s6.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426780410 1472 80.91.229.3 (19 Mar 2015 15:53:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2015 15:53:30 +0000 (UTC) Cc: Philipp Stephani , "help-gnu-emacs@gnu.org" To: Nicolas Richard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 19 16:53:21 2015 Return-path: Envelope-to: geh-help-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 1YYckt-00037I-JT for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2015 16:53:07 +0100 Original-Received: from localhost ([::1]:39819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYckt-0003mG-1t for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2015 11:53:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYckc-0003ly-5q for help-gnu-emacs@gnu.org; Thu, 19 Mar 2015 11:52:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYckX-00033A-6q for help-gnu-emacs@gnu.org; Thu, 19 Mar 2015 11:52:50 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:42388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYckX-00032p-1T for help-gnu-emacs@gnu.org; Thu, 19 Mar 2015 11:52:45 -0400 Original-Received: from thinkpad-t440p (dhcp132.uni-koblenz.de [141.26.71.132]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id CE79B1A84DE; Thu, 19 Mar 2015 16:52:43 +0100 (CET) Mail-Followup-To: Nicolas Richard , Philipp Stephani , "help-gnu-emacs\@gnu.org" In-Reply-To: <87vbhxf2s6.fsf@yahoo.fr> (Nicolas Richard's message of "Thu, 19 Mar 2015 16:03:05 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103219 Archived-At: Nicolas Richard writes: >> when looking at the source code of defvar it becomes clear that the >> two-argument form >> >> (defvar foo) >> >> is a no-op. > > Not always a no-op. The source code has this comment : > /* A simple (defvar foo) with lexical scoping does "nothing" except > declare that var to be dynamically scoped *locally* (i.e. within > the current file or let-block). */ > > To reflect the above comment, the docstring has : > | The `defvar' form also declares the variable as "special", > | so that it is always dynamically bound even if `lexical-binding' is t. But it doesn't *define* anything. (defvar xxx1 1) ;; C-h v xxx1 works (defvar xxx2) ;; C-h v xxx2 (No matches) That behavior is a bit unexpected when the docstring says "Define SYMBOL as a variable, and return SYMBOL." Bye, Tassilo