🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #88001

insert-buffer should default to first other, not first non-visible, buffer

#88001
From: Jonathan I. Kamens
Date: Sat, 13 Aug 1994 03:26
78 lines
4153 bytes
In GNU Emacs 19.25.2 of Fri Aug 12 1994 on gza-client1 (sparc-sun-sunos4.1.3)

I submitted the bug report and patch below for emacs 19.19.  I got
back a response from Brian Fox saying that (a) he didn't have time to
consider the change I submitted because it was a low-priority change
and there were higher-priority changes to be made, and (b) he didn't
agree with it anyway (i.e., he thought that the current behavior is
correct).

I responded with an explanation of why I don't think the current
behavior is correct (I've included that explanation in the bug report
below), and he never responded.  Since it doesn't seem to me that a
resolution has yet been reached on this, I'm resubmitting it for emacs
19.25.

Here's the bug report:

 	When I use M-x insert-buffer (which I have bound to M-i) to
 insert a buffer, the default buffer given in the prompt is the first
 non-visible buffer on the buffer list.
 
 	In my opinion, it should be the first buffer on the buffer
 list that's not the buffer in which the insert-buffer is being run.
 In other words, if I have buffers <a> and <b> displayed in windows and
 I hit M-x insert-buffer in <b>, the default buffer to insert should be
 <a>.

 	I don't think the default for insert-buffer should be the same
 as the default for switch-to-buffer (C-x b), because insert-buffer
 and switch-to-buffer are different operations with different intents.
 
 	The vast majority of times I do insert-buffer, it's to insert
 a buffer that I've just looked at, or am looking at right now, into
 the buffer I'm editing.  I will usually load the buffer to be
 inserted, verify that it is correct (and if not, make it correct),
 and then go into the buffer into which I want to insert it and do
 insert-buffer.
 
 	Given that the buffer I want to insert is often one that I've
 just been working with, it will often be one that is currently
 displayed.  It therefore seems silly for insert-buffer to skip over
 currently displayed buffers.
 
 	On the other hand, it makes sense for switch-to-buffer skips
 over currently displayed buffers for two reasons: (1) they can be
 easily selected with the mouse; (2) they can be easily selected with
 other-window (C-x o).  This is in contrast to insert-buffer, because
 there's no easy way to insert a currently displayed buffer; that, in
 my opinion, is what insert-buffer is supposed to do.

Here's a ChangeLog entry and a patch:

Thu Aug 11 20:07:40 1994  Jonathan I. Kamens  (jik@cam.ov.com)

        * simple.el (insert-buffer): default to first other buffer,
        not first non-visible buffer.

*** simple.el	1994/08/11 20:06:32	1.1.1.1
--- simple.el	1994/08/11 20:07:02
***************
*** 1220,1226 ****
  Puts mark after the inserted text.
  BUFFER may be a buffer or a buffer name."
    (interactive (list (progn (barf-if-buffer-read-only)
! 			    (read-buffer "Insert buffer: " (other-buffer) t))))
    (or (bufferp buffer)
        (setq buffer (get-buffer buffer)))
    (let (start end newmark)
--- 1220,1228 ----
  Puts mark after the inserted text.
  BUFFER may be a buffer or a buffer name."
    (interactive (list (progn (barf-if-buffer-read-only)
! 			    (read-buffer "Insert buffer: " 
! 					 (other-buffer (current-buffer)
! 						       t) t))))
    (or (bufferp buffer)
        (setq buffer (get-buffer buffer)))
    (let (start end newmark)
Technical Details
Message-ID: <199408121903.PAA13271@gza-client1.aktis.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu !asuvax!cs.utexas.edu!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cam.ov.COM!jik

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,19597b17621df93f,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-13 06:23:50 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu      !asuvax!cs.utexas.edu!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cam.ov.COM!jik
From: jik@cam.ov.COM (Jonathan I. Kamens)
Newsgroups: gnu.emacs.bug
Subject: insert-buffer should default to first other, not first non-visible, buffer
Date: 12 Aug 1994 23:26:52 -0400
Organization: GNUs Not Usenet
Lines: 79
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <199408121903.PAA13271@gza-client1.aktis.com>