* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
@ 2010-07-28 0:15 Johan Bockg=e5rd
2010-07-28 0:57 ` Juanma Barranquero
2010-08-01 18:35 ` Juanma Barranquero
0 siblings, 2 replies; 6+ messages in thread
From: Johan Bockg=e5rd @ 2010-07-28 0:15 UTC (permalink / raw)
To: 6744
Found by --enable-checking.
(defvar foo nil)
(defvaralias 'bar 'foo)
(make-local-variable 'bar)
(local-variable-p 'bar)
returns nil or may crash if checking is enabled. (trunk)
2010-07-27 Johan Bockg=e5rd <bojohan@gnu.org>
* data.c (Flocal_variable_p): Handle variable aliases correctly.
diff --git a/src/data.c b/src/data.c
index 152a888..b78a665 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1865,6 +1865,7 @@ BUFFER defaults to the current buffer. */)
Lisp_Object tail, elt, tmp;
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
XSETBUFFER (tmp, buf);
+ XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
2010-07-28 0:15 bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly Johan Bockg=e5rd
@ 2010-07-28 0:57 ` Juanma Barranquero
2010-07-28 3:20 ` Johan Bockgård
2010-08-01 18:35 ` Juanma Barranquero
1 sibling, 1 reply; 6+ messages in thread
From: Juanma Barranquero @ 2010-07-28 0:57 UTC (permalink / raw)
To: Johan Bockg=e5rd; +Cc: 6744
On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan@gnu.org> wrote:
> (defvar foo nil)
> (defvaralias 'bar 'foo)
> (make-local-variable 'bar)
> (local-variable-p 'bar)
>
> returns nil or may crash if checking is enabled. (trunk)
On the trunk, setting the forms inside a progn and evaluating it at
once with C-x C-e, I get nil on first try, and a crash on second try.
On emacs-23 there's no crash, but (local-variable-p 'bar) => nil.
> + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
Does this fix work also for emacs-23?
Juanma
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
2010-07-28 0:57 ` Juanma Barranquero
@ 2010-07-28 3:20 ` Johan Bockgård
2010-07-28 3:33 ` Juanma Barranquero
0 siblings, 1 reply; 6+ messages in thread
From: Johan Bockgård @ 2010-07-28 3:20 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: 6744
Juanma Barranquero <lekktu@gmail.com> writes:
> On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan@gnu.org> wrote:
>
>> (defvar foo nil)
>> (defvaralias 'bar 'foo)
>> (make-local-variable 'bar)
>> (local-variable-p 'bar)
>>
>> returns nil or may crash if checking is enabled. (trunk)
>
> On the trunk, setting the forms inside a progn and evaluating it at
> once with C-x C-e, I get nil on first try, and a crash on second try.
>
> On emacs-23 there's no crash, but (local-variable-p 'bar) => nil.
It is? I thought this problem only existed in the trunk, and I can't
reproduce it in the emacs-23 branch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
2010-07-28 3:20 ` Johan Bockgård
@ 2010-07-28 3:33 ` Juanma Barranquero
0 siblings, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2010-07-28 3:33 UTC (permalink / raw)
To: Johan Bockgård; +Cc: 6744
On Wed, Jul 28, 2010 at 05:20, Johan Bockgård <bojohan@gnu.org> wrote:
> It is? I thought this problem only existed in the trunk, and I can't
> reproduce it in the emacs-23 branch.
You're right, it returns t. Sorry for the noise.
Juanma
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
2010-07-28 0:15 bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly Johan Bockg=e5rd
2010-07-28 0:57 ` Juanma Barranquero
@ 2010-08-01 18:35 ` Juanma Barranquero
2010-08-03 17:13 ` Johan Bockgård
1 sibling, 1 reply; 6+ messages in thread
From: Juanma Barranquero @ 2010-08-01 18:35 UTC (permalink / raw)
To: Johan Bockg=e5rd; +Cc: 6744
On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan@gnu.org> wrote:
> 2010-07-27 Johan Bockg=e5rd <bojohan@gnu.org>
>
> * data.c (Flocal_variable_p): Handle variable aliases correctly.
>
> + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
If you think this is the right fix, please install it.
Juanma
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
2010-08-01 18:35 ` Juanma Barranquero
@ 2010-08-03 17:13 ` Johan Bockgård
0 siblings, 0 replies; 6+ messages in thread
From: Johan Bockgård @ 2010-08-03 17:13 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: 6744-done
Juanma Barranquero <lekktu@gmail.com> writes:
> On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan@gnu.org> wrote:
>
>> 2010-07-27 Johan Bockg=e5rd <bojohan@gnu.org>
>>
>> * data.c (Flocal_variable_p): Handle variable aliases correctly.
>>
>> + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
>
> If you think this is the right fix, please install it.
Done.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-03 17:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 0:15 bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly Johan Bockg=e5rd
2010-07-28 0:57 ` Juanma Barranquero
2010-07-28 3:20 ` Johan Bockgård
2010-07-28 3:33 ` Juanma Barranquero
2010-08-01 18:35 ` Juanma Barranquero
2010-08-03 17:13 ` Johan Bockgård
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).