You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0,
doc: /* Return most recently selected buffer other than BUFFER.Buffers not visible in windows are preferred to visible buffers, unlessoptional second argument VISIBLE-OK is non-nil. Ignore the argumentBUFFER unless it denotes a live buffer. If the optional third argumentFRAME specifies a live frame, then use that frame's buffer list insteadof the selected frame's buffer list.The buffer is found by scanning the selected or specified frame's bufferlist first, followed by the list of all buffers. If no other bufferexists, return the buffer `*scratch*' (creating it if necessary). */)
(Lisp_Objectbuffer, Lisp_Objectvisible_ok, Lisp_Objectframe)
{
structframe*f=decode_live_frame (frame);
Lisp_Objecttail=f->buffer_list, pred=f->buffer_predicate;
Lisp_Objectbuf, notsogood=Qnil;
/* Consider buffers that have been seen in the frame first. */for (; CONSP (tail); tail=XCDR (tail))
{
buf=XCAR (tail);
if (candidate_buffer (buf, buffer)
/* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */&& (NILP (pred) || !NILP (call1 (pred, buf))))
{
if (!NILP (visible_ok)
||NILP (Fget_buffer_window (buf, Qvisible)))
returnbuf;
elseif (NILP (notsogood))
notsogood=buf;
}
}
/* Consider alist of all buffers next. */FOR_EACH_LIVE_BUFFER (tail, buf)
{
if (candidate_buffer (buf, buffer)
/* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */&& (NILP (pred) || !NILP (call1 (pred, buf))))
{
if (!NILP (visible_ok)
||NILP (Fget_buffer_window (buf, Qvisible)))
returnbuf;
elseif (NILP (notsogood))
notsogood=buf;
}
}
if (!NILP (notsogood))
returnnotsogood;
else
{
AUTO_STRING (scratch, "*scratch*");
buf=Fget_buffer (scratch);
if (NILP (buf))
{
buf=Fget_buffer_create (scratch);
Fset_buffer_major_mode (buf);
}
returnbuf;
}
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: