[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: switch-to-buffer incompatible behavior with Emacs 21
From: |
Stefan Monnier |
Subject: |
Re: switch-to-buffer incompatible behavior with Emacs 21 |
Date: |
Thu, 24 Aug 2006 23:22:20 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> OK, I've installed this change. I notice that sometimes Fcar and Fcdr
> are used instead of XCAR and XCDR eg.
> this change:
> if (NILP (norecord) && !EQ (buffer, XCDR (XCAR (Vbuffer_alist))))
> in window.c:
> w-> buffer = Fcdr (Fcar (Vbuffer_alist));
> When is it ever better to use the latter?
XCAR and XCDR are the better option when they can be used. But they can
only be used when you absolutely positively know 100% that the argument can
only ever be a cons cell, even in the face of a shrewd and/or
perverted user. Typically, this is only the case when you've done a CONSP
test earlier.
Stefan
Re: switch-to-buffer incompatible behavior with Emacs 21, Richard Stallman, 2006/08/25