[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I tell when the current buffer is the minibuffer?

From: Andreas Schwab
Subject: Re: How do I tell when the current buffer is the minibuffer?
Date: Sun, 06 Mar 2016 00:03:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

> Hello, Andreas.
> On Sat, Mar 05, 2016 at 11:40:15PM +0100, Andreas Schwab wrote:
>> Alan Mackenzie <address@hidden> writes:
>> > How does one correctly create a buffer local variable in C?  What I have
>> > at the moment is:
>> >     DEFSYM (Qcomment_depth_hwm, "comment-depth-hwm");
>> >     DEFVAR_LISP ("comment-depth-hwm", Vcomment_depth_hwm,
>> >                  doc: /* Buffer position below which the `comment-depth' 
>> > property is valid.  */);
>> >     Vcomment_depth_hwm = make_number (1);
>> >     Fmake_variable_buffer_local (Qcomment_depth_hwm);
>> > This is clearly inadequate, of itself, to create a buffer local variable.
>> In which way?
> Until a `setq' (or the like) is done on the variable for a particular
> buffer, C code reading/writing from Vcomment_depth_hwm reads and writes
> the same piece of RAM that all other buffers do.

That seems to work for deactivate-mark.


Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]