From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: default-toplevel-value and set-default-toplevel-value
Date: Mon, 26 Dec 2016 11:45:55 -0500 [thread overview]
Message-ID: <jwva8biabl9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <834m1qy9z5.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 26 Dec 2016 17:40:46 +0200")
> Yes, because there doesn't seem to be any need for using it, as
> default-value is unaffected by the let-binding.
That's because the let-binding was in a buffer which had a buffer-local
value, so the let-binding only affects the buffer-local value.
(defun get-A ()
(with-current-buffer "A" myvar))
(defun get-B ()
(with-current-buffer "B" myvar))
(defun get-test ()
(setq myvar 'global)
(with-current-buffer (get-buffer-create "A")
(setq-local myvar 'local-A))
(with-current-buffer (get-buffer-create "B")
(setq-local myvar 'local-B))
(list (list (get-A) (get-B) (default-value 'myvar))
(with-current-buffer "*scratch*"
(let ((myvar 'let-bound))
(list (get-A) (get-B) (default-value 'myvar))))
(with-current-buffer "A"
(let ((myvar 'let-bound))
(list (get-A) (get-B) (default-value 'myvar))))
(with-current-buffer "B"
(let ((myvar 'let-bound))
(list (get-A) (get-B) (default-value 'myvar))))))
-- Stefan
next prev parent reply other threads:[~2016-12-26 16:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 16:19 default-toplevel-value and set-default-toplevel-value Eli Zaretskii
2016-12-12 16:57 ` Stefan Monnier
2016-12-24 18:45 ` Eli Zaretskii
2016-12-26 3:29 ` Eli Zaretskii
2016-12-26 4:09 ` Stefan Monnier
2016-12-26 15:40 ` Eli Zaretskii
2016-12-26 16:45 ` Stefan Monnier [this message]
2016-12-26 17:13 ` Eli Zaretskii
2016-12-27 1:17 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwva8biabl9.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).