From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: make-indirect-buffer
Date: 12 Apr 2004 17:01:09 -0400 [thread overview]
Message-ID: <m17jwkrk0h.fsf-monnier+emacs@empanada.iro.umontreal.ca> (raw)
In-Reply-To: <200404120519.i3C5Jrn21195@raven.dms.auburn.edu>
> ***************
> *** 536,544 ****
> if (!NILP (buf))
> error ("Buffer name `%s' is in use", SDATA (name));
> base_buffer = Fget_buffer (base_buffer);
> ! if (NILP (base_buffer))
> ! error ("No such buffer: `%s'", SDATA (name));
> if (SCHARS (name) == 0)
> error ("Empty string for buffer name is not allowed");
> --- 536,547 ----
> if (!NILP (buf))
> error ("Buffer name `%s' is in use", SDATA (name));
> + if (NILP (Fget_buffer (base_buffer)))
> + error ("No such buffer: `%s'", SDATA (base_buffer));
> +
> base_buffer = Fget_buffer (base_buffer);
> ! if (NILP (XBUFFER (base_buffer)->name))
> ! error ("Base buffer has been killed");
> if (SCHARS (name) == 0)
> error ("Empty string for buffer name is not allowed");
The basic idea looks fine, but the above code calls Fget_buffer twice for
no reason. It seems the following code would work as well:
base_buffer = Fget_buffer (base_buffer);
if (NILP (base_buffer))
/* We assume that (get-buffer foo)==nil implies STRINGP (foo).
Is that true? --Stef */
error ("No such buffer: `%s'", SDATA (base_buffer));
if (NILP (XBUFFER (base_buffer)->name))
error ("Base buffer has been killed");
-- Stefan
next prev parent reply other threads:[~2004-04-12 21:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-12 5:19 make-indirect-buffer Luc Teirlinck
2004-04-12 21:01 ` Stefan Monnier [this message]
2004-04-12 21:04 ` make-indirect-buffer Miles Bader
2004-04-12 21:12 ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:22 ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:35 ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:37 ` make-indirect-buffer Luc Teirlinck
2004-04-12 22:53 ` make-indirect-buffer Stefan Monnier
2004-04-12 23:36 ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:27 ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:49 ` make-indirect-buffer Kim F. Storm
2004-04-13 17:45 ` make-indirect-buffer Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2004-04-12 4:58 make-indirect-buffer Luc Teirlinck
2004-04-13 17:45 ` make-indirect-buffer Richard Stallman
2004-03-13 23:23 make-indirect-buffer Luc Teirlinck
2004-03-15 4:56 ` make-indirect-buffer Richard Stallman
2004-03-15 22:37 ` make-indirect-buffer Luc Teirlinck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m17jwkrk0h.fsf-monnier+emacs@empanada.iro.umontreal.ca \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.