From: Philipp Stephani <p.stephani2@gmail.com>
To: Nicolas Richard <theonewiththeevillook@yahoo.fr>,
"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: The two-argument form of defvar
Date: Sat, 18 Apr 2015 09:25:06 +0000 [thread overview]
Message-ID: <CAArVCkTt=dC7Rz4apGn7QY=yHNvM7OaBJG9n=4M4Lw8L7ZcDpQ@mail.gmail.com> (raw)
In-Reply-To: <87mw396l2s.fsf@gnu.org>
Maybe there should be a declare-variable function to forward-declare
variables, parallel to declare-function.
Tassilo Horn <tsdh@gnu.org> schrieb am Do., 19. März 2015 um 16:52 Uhr:
> Nicolas Richard <theonewiththeevillook@yahoo.fr> 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<tab> (No matches)
>
> That behavior is a bit unexpected when the docstring says "Define SYMBOL
> as a variable, and return SYMBOL."
>
> Bye,
> Tassilo
>
next prev parent reply other threads:[~2015-04-18 9:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 11:39 The two-argument form of defvar Philipp Stephani
2015-03-19 15:03 ` Nicolas Richard
2015-03-19 15:52 ` Tassilo Horn
2015-04-18 9:25 ` Philipp Stephani [this message]
2015-04-18 13:27 ` Stefan Monnier
2015-04-18 14:14 ` Drew Adams
2015-04-18 16:50 ` Philipp Stephani
[not found] ` <mailman.1013.1429363810.904.help-gnu-emacs@gnu.org>
2015-04-19 21:48 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAArVCkTt=dC7Rz4apGn7QY=yHNvM7OaBJG9n=4M4Lw8L7ZcDpQ@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=theonewiththeevillook@yahoo.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.