emacs-devel
[Top][All Lists]
Advanced

[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: Alan Mackenzie
Subject: Re: How do I tell when the current buffer is the minibuffer?
Date: Sat, 5 Mar 2016 22:19:14 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Andreas.

On Sat, Mar 05, 2016 at 11:04:57PM +0100, Andreas Schwab wrote:
> Alan Mackenzie <address@hidden> writes:

> > Part of my program is being called from `signal_after_change' after
> > activity in the minibuffer.  However, in that program the buffer local
> > variables for the main buffer (not the minibuffer) are still in scope.

> How can that happen?  A minibuffer is a buffer on its own, with its own
> local variables.

What is happening is that the variable location (created in C) is being
shared by all buffers until a buffer local value is "primed" in a buffer
with a `setq' invocation.

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.

> Andreas.

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

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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