Article View: gnu.emacs.bug
Article #87617"insert-buffer" behavior differs from documentation
From: Alan K. Stebbens aks
Date: Fri, 09 Sep 1994 20:55
Date: Fri, 09 Sep 1994 20:55
45 lines
2105 bytes
2105 bytes
The documentation of "insert-buffer" differs from its behavior; the doc
says:
"insert-buffer: an interactive compiled Lisp function.
(insert-buffer BUFFER)
Insert after point the contents of BUFFER.
Puts mark after the inserted text.
BUFFER may be a buffer or a buffer name."
while the behavior is that point remains where it was prior to the
invocation of "insert-buffer".
Here's the proof:
Examine the following sexp and then eval it:
(let ((buf1 (get-buffer-create "test"))
(buf2 (get-buffer-create "text")))
(set-buffer buf2)
(insert "THIS IS A NEW LINE\n")
(set-buffer buf1)
(insert "this is a test\n")
(insert "this is line 2\n")
(insert-buffer buf2)
(insert "this is line 3\n")
(display-buffer buf1))
Note that the "text" buffer is being inserted *between* lines 2 and 3 of
the "test" buffer. But, what happens is this:
this is a test
this is line 2
this is line 3
THIS IS A NEW LINE
which can only be explained by the fact that (point) remains unchanged
by the "insert-buffer", thus causing the "line 3" insert to occur in
front of the "text" buffer insertion, rather than after, as you would
expect.
BTW, this is (emacs-version) "GNU Emacs 19.26.3 (mips-sgi-irix5.2, X
toolkit) of Thu Sep 8 1994 on dokoka"
Alan
Technical Details
Message-ID:
<9409092053.AA02126@dokoka>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!dokoka.ucsb.edu!aksShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,2f4ddf823195e3cd,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-09-12 18:27:38 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!dokoka.ucsb.edu!aks From: aks@dokoka.ucsb.edu (Alan K. Stebbens <aks@dokoka.ucsb.edu>) Newsgroups: gnu.emacs.bug Subject: "insert-buffer" behavior differs from documentation Date: 9 Sep 1994 16:55:22 -0400 Organization: GNUs Not Usenet Lines: 46 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <9409092053.AA02126@dokoka> Reply-To: Alan Stebbens <aks@hub.ucsb.edu>