[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFM: How to make a buffer-local var in C layer
From: |
Phillip Lord |
Subject: |
RFM: How to make a buffer-local var in C layer |
Date: |
Mon, 14 Sep 2015 15:41:13 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Sorry for the total newbie noise, but I am trying to add a buffer-local
variable to the undo machinary. In emacs-lisp I would do...
(defvar-local undo-buffer-undoably-changed nil
"Non-nil means that that the buffer has had a recent undo-able change.
Recent means since the value of this variable was last set explicitly to nil,
usually as part of the undo machinary.")
My C is very poor (I'm learning it as I go). But I *think* I need to do
this in the C layer, as I am going to use and set this directly from
within undo.c. Or am I wrong about this? Is it easier to just use the
lisp above and access it's value in C (not sure how do do that either).
If I need to do this in C, I have worked out how to add new variables to
Emacs in C, but it's the buffer-local bit that is causing problems. Do,
I need to do follow all the steps in buffer.c, which look something like
- call it "buffer-undoably-changed"
- add to the structure in buffer.h
- add a bset-* method
- do DEFVAR_PER_BUFFER in syms_of_buffer_c
The background to this is in this thread here:
https://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00013.html
Sorry for dumb questions; this bit of Emacs is totally new to me.
Phil
- Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change e5ff575 2/2: Add a timer to ensure undo-boundaries in buffers., Phillip Lord, 2015/09/01
- Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change e5ff575 2/2: Add a timer to ensure undo-boundaries in buffers., Stefan Monnier, 2015/09/01
- Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change e5ff575 2/2: Add a timer to ensure undo-boundaries in buffers., Phillip Lord, 2015/09/01
- Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change e5ff575 2/2: Add a timer to ensure undo-boundaries in buffers., Stefan Monnier, 2015/09/06
- RFM: How to make a buffer-local var in C layer,
Phillip Lord <=
- Re: RFM: How to make a buffer-local var in C layer, Stefan Monnier, 2015/09/14
- Re: RFM: How to make a buffer-local var in C layer, Phillip Lord, 2015/09/15
- Re: RFM: How to make a buffer-local var in C layer, Stefan Monnier, 2015/09/15
- Re: RFM: How to make a buffer-local var in C layer, Stefan Monnier, 2015/09/15
- Re: RFM: How to make a buffer-local var in C layer, Phillip Lord, 2015/09/15