all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: In C code, how do I create and access a (lisp) variable?
Date: Wed, 4 Nov 2015 21:04:20 +0000	[thread overview]
Message-ID: <20151104210420.GA4618@acm.fritz.box> (raw)

Hello, Emacs.

Sorry to trouble you all with such a basic question, but I'm feeling
confused about it.

In C code, I want to create a lisp variable, and access its value (which
may have become buffer local, or have become aliased to whatever, or
whatnot).

Is DEFVAR_LISP the right way to define the variable?  This looks fine,
except most uses of the variable `foo', defined by

   DEFVAR_LISP ("foo", Vfoo, doc: /* Doc string*/)

are direct accesses to the C variable `Vfoo'.  Does `Vfoo" contain buffer
local values, for example?  Or do I need to use something like
Fsymbol_value?  If so, where do I get the symbol from (since, there's no
"Sfoo" in the above DEFVAR_LISP.)

If I've missed some documentation somewhere which answers my questions,
apologies, and please direct me to it.

-- 
Alan Mackenzie (Nuremberg, Germany).



             reply	other threads:[~2015-11-04 21:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 21:04 Alan Mackenzie [this message]
2015-11-04 21:20 ` In C code, how do I create and access a (lisp) variable? Aurélien Aptel
2015-11-04 23:39   ` Andreas Schwab
2015-11-05 11:28     ` Aurélien Aptel
2015-11-05 16:43   ` Alan Mackenzie

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=20151104210420.GA4618@acm.fritz.box \
    --to=acm@muc.de \
    --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 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.