[Top][All Lists]

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

Re: get-live-buffer primitive

From: martin rudalics
Subject: Re: get-live-buffer primitive
Date: Fri, 14 Sep 2012 11:00:59 +0200

> Meanwhile, `get-buffer' will not find a dead buffer by name.
> So I don't see a need to create a `get-live-buffer' function.
> Unless the purpose were only to get an error if the argument
> is a dead buffer.

Just a few examples that could benefit from such a function:

Fset_window_buffer has

  buffer = Fget_buffer (buffer_or_name);
  CHECK_BUFFER (buffer);
  if (NILP (BVAR (XBUFFER (buffer), name)))
    error ("Attempt to display deleted buffer");


  buf = Fget_buffer (buffer);
  if (NILP (buf))
    nsberror (buffer);
  bp = XBUFFER (buf);
  if (!BUFFER_LIVE_P (bp))
    error ("Selecting deleted buffer");


      buf1 = Fget_buffer (buffer1);
      if (NILP (buf1))
        nsberror (buffer1);
      bp1 = XBUFFER (buf1);
      if (!BUFFER_LIVE_P (bp1))
        error ("Selecting deleted buffer");


      buf2 = Fget_buffer (buffer2);
      if (NILP (buf2))
        nsberror (buffer2);
      bp2 = XBUFFER (buf2);
      if (!BUFFER_LIVE_P (bp2))
        error ("Selecting deleted buffer");


  buffer = Fget_buffer (buffer_or_name);
  if (NILP (buffer))
    nsberror (buffer_or_name);
  if (!BUFFER_LIVE_P (XBUFFER (buffer)))
    error ("Selecting deleted buffer");


reply via email to

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