all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: make-indirect-buffer
Date: Mon, 12 Apr 2004 00:19:53 -0500 (CDT)	[thread overview]
Message-ID: <200404120519.i3C5Jrn21195@raven.dms.auburn.edu> (raw)

I noticed a second (less serious, but still confusing) bug in
`make-indirect-buffer'.

After emacs -q, we run ielm:

===File ~/namebug===========================================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (make-indirect-buffer "nosuchbuffer" "indi")
*** Eval error ***  No such buffer: `indi'
ELISP> ============================================================

There is not supposed to be an `indi' buffer, we are trying to
construct one.  The problem is that "nosuchbuffer" does not exist.

After the following patch:

===File ~/buffer.c-newdiff==================================
*** buffer.c	11 Apr 2004 10:08:04 -0500	1.448
--- buffer.c	11 Apr 2004 23:41:23 -0500	
***************
*** 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");
============================================================

We get:

===File ~/namebug-after-patch===============================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (make-indirect-buffer "nosuchbuffer" "indi")
*** Eval error ***  No such buffer: `nosuchbuffer'
ELISP> 
============================================================

Note that base_buffer could be either an existing buffer or a string,
but if `Fget_buffer (base_buffer)' returns nil, it has to be a string.
I could install if desired.

Sincerely,

Luc.

             reply	other threads:[~2004-04-12  5:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-12  5:19 Luc Teirlinck [this message]
2004-04-12 21:01 ` make-indirect-buffer Stefan Monnier
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=200404120519.i3C5Jrn21195@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /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.