unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: miles@gnu.org, emacs-devel@gnu.org
Subject: Re: make-indirect-buffer
Date: Mon, 12 Apr 2004 18:36:15 -0500 (CDT)	[thread overview]
Message-ID: <200404122336.i3CNaFO27207@raven.dms.auburn.edu> (raw)
In-Reply-To: <m11xmsreoz.fsf-monnier+emacs@empanada.iro.umontreal.ca> (message from Stefan Monnier on 12 Apr 2004 18:53:34 -0400)

Stefan Monnier wrote:

   > Basically one could do this (I do not know whether it is worth the
   > extra variable):

   AFAIK, variables have no cost.

So what if I install the following:

===File ~/buffer.c-diff=====================================
diff -c /home/teirllm/emacscvsdir/emacs/src/buffer.c /home/teirllm/buffer.new.c
*** /home/teirllm/emacscvsdir/emacs/src/buffer.c	Mon Apr 12 18:26:33 2004
--- /home/teirllm/buffer.new.c	Mon Apr 12 18:01:22 2004
***************
*** 521,527 ****
         2, 3,
         "bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
         doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME.
! BASE-BUFFER should be an existing buffer (or buffer name).
  NAME should be a string which is not the name of an existing buffer.
  Optional argument CLONE non-nil means preserve BASE-BUFFER's state,
  such as major and minor modes, in the indirect buffer.
--- 521,527 ----
         2, 3,
         "bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
         doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME.
! BASE-BUFFER should be a live buffer, or the name of an existing buffer.
  NAME should be a string which is not the name of an existing buffer.
  Optional argument CLONE non-nil means preserve BASE-BUFFER's state,
  such as major and minor modes, in the indirect buffer.
***************
*** 529,535 ****
       (base_buffer, name, clone)
       Lisp_Object base_buffer, name, clone;
  {
!   Lisp_Object buf;
    struct buffer *b;
  
    CHECK_STRING (name);
--- 529,535 ----
       (base_buffer, name, clone)
       Lisp_Object base_buffer, name, clone;
  {
!   Lisp_Object buf, tem;
    struct buffer *b;
  
    CHECK_STRING (name);
***************
*** 537,545 ****
    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");
--- 537,548 ----
    if (!NILP (buf))
      error ("Buffer name `%s' is in use", SDATA (name));
  
+   tem = base_buffer;
    base_buffer = Fget_buffer (base_buffer);
    if (NILP (base_buffer))
!     error ("No such buffer: `%s'", SDATA (tem));
!   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");

Diff finished.  Mon Apr 12 18:27:39 2004
============================================================

  reply	other threads:[~2004-04-12 23:36 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 ` 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         ` Luc Teirlinck [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200404122336.i3CNaFO27207@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).