[Top][All Lists]

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

Re: [Emacs-diffs] master d82e73f: Handle 'unbound' like nil for 'window-

From: martin rudalics
Subject: Re: [Emacs-diffs] master d82e73f: Handle 'unbound' like nil for 'window-point-insertion-type' (Bug#33871)
Date: Wed, 02 Jan 2019 09:32:21 +0100

>>      * src/window.c (save_window_save): When setting the marker
>>      insertion type of saved window points treat a buffer local
>>      value of 'unbound' for 'window-point-insertion-type' like
>>      nil (Bug#33871).
> I think treating it like nil is technically incorrect: instead of nil it
> should use the global value of the variable (like Fbuffer_local_value would).

The only difference between buffer_local_value and Fbuffer_local_value
I see is that the latter signals an error when the value returned by
buffer_local_value is 'unbound'.  I cannot signal an error here so I
use nil instead.  I don't see anything else I could do here but if you
have any suggestions I will try them.

In general, I am completely lost as to what the canonical way to find
out whether a variable has a buffer local binding is: I suppose it's

Fassoc (variable, BVAR (buf, local_var_alist), Qnil);

from buffer_local_value.  And I suppose in Lisp I would have to check
for membership in 'buffer-local-variables'.  Or how could I check the
following part of the doc-string of 'buffer-local-value' separately:

"If VARIABLE does not have a buffer-local binding in BUFFER,"


reply via email to

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