unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* buffer-local-value confusion
@ 2014-10-08  6:13 Eric Abrahamsen
  2014-10-08  7:29 ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2014-10-08  6:13 UTC (permalink / raw)
  To: help-gnu-emacs

I have defined a buffer-local variable like this:

(defvar nngnorb-attachment-file-list nil)
(make-variable-buffer-local 'nngnorb-attachment-file-list)

I'm first setting a value for it in the buffer referred to by
nnir-tmp-buffer, then trying to copy that buffer-local value to a
different buffer. Here's what I'm seeing, which confuses me:

(with-current-buffer (get-buffer nnir-tmp-buffer)
  nngnorb-attachment-file-list) --> proper, populated value

(buffer-local-value
 nngnorb-attachment-file-list
 (get-buffer nnir-tmp-buffer)) --> nil

I thought this was the whole point of buffer-local-value? Am I doing it
wrong?

On the other hand, using with-current-buffer is almost precisely the
same number of characters as buffer-local-value, so maybe there's no
point in insisting on the latter...

Eric




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-08  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.10699.1412748865.1147.help-gnu-emacs@gnu.org>
2014-10-08  7:27 ` buffer-local-value confusion Marco Wahl
2014-10-08  7:34   ` Eric Abrahamsen
2014-10-08  6:13 Eric Abrahamsen
2014-10-08  7:29 ` Thorsten Jolitz

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).