all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: defvar inside let-binding
Date: Tue, 02 Aug 2011 21:56:45 +0200	[thread overview]
Message-ID: <m3d3gn1taa.fsf@stories.gnus.org> (raw)
In-Reply-To: <jwv39hjei14.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 02 Aug 2011 15:22:35 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Yes.  Tho the "next" step you suggested (to cause defvar to change the
> outer let-binding) will require another such function and will make
> symbol-let-bound-p unneeded.

Let's see...

  ;; Use defvar to set the docstring as well as the special-variable-p flag.
  ;; FIXME: We should reproduce more of `defvar's behavior, such as the warning
  ;; when the var is currently let-bound.
  (if (not (default-boundp symbol))
      ;; Don't use defvar to avoid setting a default-value when undesired.
      (when doc (put symbol 'variable-documentation doc))
    (eval `(defvar ,symbol nil ,@(when doc (list doc)))))

So what I would do here now would be to add

(when (symbol-let-bound-p symbol)
  (message "Warning: let-bound etc"))

now, and in Emacs 24.2, I'd change that to

(when (symbol-let-bound-p symbol)
  (change-outer-let-binding symbol default))

Or something along those lines?  

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



  reply	other threads:[~2011-08-02 19:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 14:38 bug#9090: 24.0.50; void-variable jka-compr-verbose lee
2011-07-15 17:04 ` Glenn Morris
2011-07-15 18:11   ` Lars Magne Ingebrigtsen
2011-07-15 18:20     ` Glenn Morris
2011-07-18 14:03     ` defvar inside let-binding (was: bug#9090: 24.0.50; void-variable jka-compr-verbose) Stefan Monnier
2011-07-18 14:20       ` defvar inside let-binding Lars Magne Ingebrigtsen
2011-07-18 16:18         ` Stefan Monnier
2011-07-19 16:14           ` Lars Magne Ingebrigtsen
2011-08-01 21:20             ` Stefan Monnier
2011-08-02 13:42               ` Lars Magne Ingebrigtsen
2011-08-02 19:22                 ` Stefan Monnier
2011-08-02 19:56                   ` Lars Magne Ingebrigtsen [this message]
2011-08-02 20:47                     ` Stefan Monnier

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=m3d3gn1taa.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.