From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Confused about buffer-local variables
Date: Mon, 31 Mar 2014 23:10:27 +0200 [thread overview]
Message-ID: <87a9c6oz0c.fsf@gmail.com> (raw)
In-Reply-To: 87lhvq1775.fsf@yahoo.fr
Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
> Thorsten Jolitz <tjolitz@gmail.com> writes:
>> assume function `foo' is defined in library A and uses variable `bar'
>> defined in that library with value "X". Now I call function `foo' from a
>> buffer where variable `bar' is set as a buffer-local variable to a
>> different value "Y".
>>
>> Which value is `foo' going to use - "X" or "Y"? I would have said "Y"
>> but feel a bit confused right now ...
>
> I'd say 'Y' also, but maybe I'm confused and I do not know it. Do you
> have any code sample that doesn't do what you expected ?
You are right, I should have rather tested it:
Evaluating library mylib.el:
,--------------------------
| (defvar mylib-bar "X")
|
| (defun mylib-foo ()
| (print mylib-bar))
`--------------------------
after opening buffer local-var-test.org:
,---------------------
| * 1st Level
|
| Lorem Ipsum
|
| # Local Variables:
| # mylib-bar: "Y"
| # End:
`---------------------
does not change the expected result when doing
,----------------------
| M-: (mylib-foo)
`----------------------
with point in buffer local-var-test.org:
,----
| "Y"
`----
--
cheers,
Thorsten
next prev parent reply other threads:[~2014-03-31 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 16:41 Confused about buffer-local variables Thorsten Jolitz
2014-03-31 19:47 ` Nicolas Richard
2014-03-31 21:10 ` Thorsten Jolitz [this message]
2014-04-01 10:11 ` Nicolas Richard
2014-04-01 10:33 ` Thorsten Jolitz
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=87a9c6oz0c.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@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 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.