* Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
@ 2006-01-17 20:52 Jay Bingham
2006-01-18 16:41 ` Kevin Rodgers
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Jay Bingham @ 2006-01-17 20:52 UTC (permalink / raw
I am running Emacs 21.1 on Win2K.
I believe that there are two discrepancies between what is stated on the indirect buffers node in info and the way the two functions clone-indirect-buffer and clone-indirect-buffer-other-window actually work.
In the info page on indirect buffers it states:
-----------------------------------------------------------------------
A quick and handy way to make an indirect buffer is with the command
`M-x clone-indirect-buffer'. It creates and selects an indirect buffer
whose base buffer is the current buffer. With a numeric argument, it
prompts for the name of the indirect buffer; otherwise it defaults to
the name of the current buffer, modifying it by adding a `<N>' prefix
if required. `C-x 4 c' (`clone-indirect-buffer-other-window') works
like `M-x clone-indirect-buffer', but it selects the cloned buffer in
another window. These commands come in handy if you want to create new
`*info*' or `*Help*' buffers, for example.
-----------------------------------------------------------------------
The first discrepancy is that when these commands are executed the `<N>' is not prefixed to the buffer name it is suffixed to the buffer name, that is it comes after the name of the buffer not before it. Either the info page is incorrect or the code is incorrect.
Personally, I would prefer to have some way to differentiate between buffers which contain different files with the same name and buffers that actually point to the same file without having to enter a name for the clone. I also prefer the numeric indicator to follow the existing buffer name. Realizing the the same function is likely used to generate the file names I am still willing to suggest that perhaps the `[N]' or `{N}' designators could be used to indicate a cloned buffer as opposed to an automatically generated file name.
The second discrepancy is: although the info page indicates that the only difference between clone-indirect-buffer and clone-indirect-buffer-other-window is that the latter selects the buffer in another window, I do not believe that this is the case. The clone-indirect-buffer function accepts an argument and prompts for a name while the clone-indirect-buffer-other-window function ignores any numeric argument.
I would like to see the clone-indirect-buffer-other-window function accept an argument as well.
__
J_)
C_)ingham
______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-17 20:52 Bug in clone-indirect-buffer and clone-indirect-buffer-other-window Jay Bingham
@ 2006-01-18 16:41 ` Kevin Rodgers
2006-01-18 18:56 ` Eli Zaretskii
2006-01-19 17:43 ` Richard M. Stallman
2 siblings, 0 replies; 9+ messages in thread
From: Kevin Rodgers @ 2006-01-18 16:41 UTC (permalink / raw
Jay Bingham wrote:
> Personally, I would prefer to have some way to differentiate between
> buffers which contain different files with the same name and buffers
> that actually point to the same file without having to enter a name
> for the clone. I also prefer the numeric indicator to follow the
> existing buffer name. Realizing the the same function is likely used
> to generate the file names I am still willing to suggest that perhaps
> the `[N]' or `{N}' designators could be used to indicate a cloned
> buffer as opposed to an automatically generated file name.
Perhaps you can use (require 'uniquify) to help get what you want -- see
the uniquify-buffer-name-style and uniquify-ask-about-buffer-names-p
options.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-17 20:52 Bug in clone-indirect-buffer and clone-indirect-buffer-other-window Jay Bingham
2006-01-18 16:41 ` Kevin Rodgers
@ 2006-01-18 18:56 ` Eli Zaretskii
2006-01-19 17:43 ` Richard M. Stallman
2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2006-01-18 18:56 UTC (permalink / raw
Cc: bug-gnu-emacs
> From: "Jay Bingham" <b.jc-emacs@netzero.com>
> Date: Tue, 17 Jan 2006 20:52:02 GMT
>
> The first discrepancy is that when these commands are executed the `<N>' is not prefixed to the buffer name it is suffixed to the buffer name, that is it comes after the name of the buffer not before it. Either the info page is incorrect or the code is incorrect.
Thank you for your report.
The manual distributed with Emacs 21.1 was incorrect: <N> is the
suffix. In the current development sources, this is already fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-17 20:52 Bug in clone-indirect-buffer and clone-indirect-buffer-other-window Jay Bingham
2006-01-18 16:41 ` Kevin Rodgers
2006-01-18 18:56 ` Eli Zaretskii
@ 2006-01-19 17:43 ` Richard M. Stallman
2006-01-22 0:45 ` Juri Linkov
2 siblings, 1 reply; 9+ messages in thread
From: Richard M. Stallman @ 2006-01-19 17:43 UTC (permalink / raw
Cc: bug-gnu-emacs
The second discrepancy is: although the info page indicates that the only difference between clone-indirect-buffer and clone-indirect-buffer-other-window is that the latter selects the buffer in another window, I do not believe that this is the case. The clone-indirect-buffer function accepts an argument and prompts for a name while the clone-indirect-buffer-other-window function ignores any numeric argument.
I would like to see the clone-indirect-buffer-other-window function accept an argument as well.
I will do that. Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-19 17:43 ` Richard M. Stallman
@ 2006-01-22 0:45 ` Juri Linkov
2006-01-22 17:44 ` Richard M. Stallman
2006-01-22 17:44 ` Richard M. Stallman
0 siblings, 2 replies; 9+ messages in thread
From: Juri Linkov @ 2006-01-22 0:45 UTC (permalink / raw
Cc: bug-gnu-emacs, b.jc-emacs
> The second discrepancy is: although the info page indicates that the
> only difference between clone-indirect-buffer and
> clone-indirect-buffer-other-window is that the latter selects the
> buffer in another window, I do not believe that this is the case.
> The clone-indirect-buffer function accepts an argument and prompts
> for a name while the clone-indirect-buffer-other-window function
> ignores any numeric argument. I would like to see the
> clone-indirect-buffer-other-window function accept an argument
> as well.
>
> I will do that. Thanks.
Actually, your latest fix doesn't work: clone-indirect-buffer and
clone-indirect-buffer-other-window use different arguments, so to make
the behavior of clone-indirect-buffer-other-window similar to
clone-indirect-buffer, a new argument `newname' should be added.
The following patch also changes the prompt strings of `clone-buffer',
`clone-indirect-buffer' and `clone-indirect-buffer-other-window'.
(Note that the command `make-indirect-buffer' is already ok: it correctly
uses the interactive specification string "BName of indirect buffer: "
where the first character "B" is necessary. But all other commands
construct a list of arguments instead of using the interactive specification
string).
Index: lisp/simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.784
diff -c -r1.784 simple.el
*** lisp/simple.el 20 Jan 2006 01:22:07 -0000 1.784
--- lisp/simple.el 22 Jan 2006 00:38:57 -0000
***************
*** 5196,5202 ****
(error "Cannot clone a file-visiting buffer"))
(if (get major-mode 'no-clone)
(error "Cannot clone a buffer in %s mode" mode-name))
! (list (if current-prefix-arg (read-string "Name: "))
t)))
(if buffer-file-name
(error "Cannot clone a file-visiting buffer"))
--- 5221,5228 ----
(error "Cannot clone a file-visiting buffer"))
(if (get major-mode 'no-clone)
(error "Cannot clone a buffer in %s mode" mode-name))
! (list (if current-prefix-arg
! (read-buffer "Name of new cloned buffer: " (current-buffer)))
t)))
(if buffer-file-name
(error "Cannot clone a file-visiting buffer"))
***************
*** 5266,5272 ****
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
(list (if current-prefix-arg
! (read-string "BName of indirect buffer: "))
t)))
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
--- 5292,5298 ----
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
(list (if current-prefix-arg
! (read-buffer "Name of indirect buffer: " (current-buffer)))
t)))
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
***************
*** 5280,5300 ****
buffer))
! (defun clone-indirect-buffer-other-window (buffer &optional norecord)
! "Create an indirect buffer that is a twin copy of BUFFER.
! Select the new buffer in another window.
Optional second arg NORECORD non-nil means do not put this buffer at
! the front of the list of recently selected ones."
(interactive
(progn
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
! (list (if current-prefix-arg
! (read-string "BName of indirect buffer: "))
! t)))
(let ((pop-up-windows t))
! (set-buffer buffer)
! (clone-indirect-buffer nil t norecord)))
\f
;;; Handling of Backspace and Delete keys.
--- 5306,5334 ----
buffer))
! (defun clone-indirect-buffer-other-window (base-buffer &optional norecord newname)
! "Create an indirect buffer that is a twin copy of BASE-BUFFER.
! Select the new buffer in another window. The argument BASE-BUFFER defaults
! to the current buffer.
!
Optional second arg NORECORD non-nil means do not put this buffer at
! the front of the list of recently selected ones.
!
! Optional third arg NEWNAME specifies the name of the new indirect buffer.
! Interactively, read NEWNAME from the minibuffer when invoked with
! a prefix arg. If NEWNAME is nil or if not called with a prefix arg,
! NEWNAME defaults to the current buffer's name. The name is modified by
! adding a `<N>' suffix to it or by incrementing the N in an existing suffix."
(interactive
(progn
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
! (list nil nil
! (if current-prefix-arg
! (read-buffer "Name of indirect buffer: " (current-buffer))))))
(let ((pop-up-windows t))
! (if base-buffer (set-buffer base-buffer))
! (clone-indirect-buffer newname t norecord)))
\f
;;; Handling of Backspace and Delete keys.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-22 0:45 ` Juri Linkov
@ 2006-01-22 17:44 ` Richard M. Stallman
2006-01-23 1:57 ` Juri Linkov
2006-01-22 17:44 ` Richard M. Stallman
1 sibling, 1 reply; 9+ messages in thread
From: Richard M. Stallman @ 2006-01-22 17:44 UTC (permalink / raw
Cc: bug-gnu-emacs, b.jc-emacs
I had not noticed that clone-indirect-buffer-other-window asked the
user to specify the name of the buffer to start with. That seems like
a big inconsistency. Normally the only difference between foobar and
foobar-other window is where to display the results.
I see that clone-indirect-buffer-other-window is documented wrongly in
the manual, based on the assumption that it does what its name
suggests.
So I think the right thing is to replace its definition with this:
(defun clone-indirect-buffer-other-window (newname display-flag &optional norecord)
"Like `clone-indirect-buffer' but display in another window."
(interactive
(progn
(if (get major-mode 'no-clone-indirect)
(error "Cannot indirectly clone a buffer in %s mode" mode-name))
(list (if current-prefix-arg
(read-string "BName of indirect buffer: "))
t)))
(let ((pop-up-windows t))
(clone-indirect-buffer newname display-flag norecord)))
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-22 0:45 ` Juri Linkov
2006-01-22 17:44 ` Richard M. Stallman
@ 2006-01-22 17:44 ` Richard M. Stallman
1 sibling, 0 replies; 9+ messages in thread
From: Richard M. Stallman @ 2006-01-22 17:44 UTC (permalink / raw
Cc: bug-gnu-emacs, b.jc-emacs
The following patch also changes the prompt strings of `clone-buffer',
`clone-indirect-buffer' and `clone-indirect-buffer-other-window'.
(Note that the command `make-indirect-buffer' is already ok: it correctly
uses the interactive specification string "BName of indirect buffer: "
where the first character "B" is necessary. But all other commands
construct a list of arguments instead of using the interactive specification
string).
Please install those patches.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-22 17:44 ` Richard M. Stallman
@ 2006-01-23 1:57 ` Juri Linkov
2006-01-24 16:46 ` Richard M. Stallman
0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2006-01-23 1:57 UTC (permalink / raw
Cc: bug-gnu-emacs, b.jc-emacs
> I had not noticed that clone-indirect-buffer-other-window asked the
> user to specify the name of the buffer to start with. That seems like
> a big inconsistency. Normally the only difference between foobar and
> foobar-other window is where to display the results.
>
> I see that clone-indirect-buffer-other-window is documented wrongly in
> the manual, based on the assumption that it does what its name
> suggests.
>
> So I think the right thing is to replace its definition with this:
>
> (defun clone-indirect-buffer-other-window (newname display-flag &optional norecord)
> "Like `clone-indirect-buffer' but display in another window."
> (interactive
> (progn
> (if (get major-mode 'no-clone-indirect)
> (error "Cannot indirectly clone a buffer in %s mode" mode-name))
> (list (if current-prefix-arg
> (read-string "BName of indirect buffer: "))
> t)))
> (let ((pop-up-windows t))
> (clone-indirect-buffer newname display-flag norecord)))
This has only one drawback of being backward incompatible.
I don't know how many users rely on the current function arguments.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
2006-01-23 1:57 ` Juri Linkov
@ 2006-01-24 16:46 ` Richard M. Stallman
0 siblings, 0 replies; 9+ messages in thread
From: Richard M. Stallman @ 2006-01-24 16:46 UTC (permalink / raw
Cc: bug-gnu-emacs, b.jc-emacs
This has only one drawback of being backward incompatible.
I don't know how many users rely on the current function arguments.
Surely not many. There are no calls to this function in the Emacs
sources. So my decision is not to worry about it.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-01-24 16:46 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-17 20:52 Bug in clone-indirect-buffer and clone-indirect-buffer-other-window Jay Bingham
2006-01-18 16:41 ` Kevin Rodgers
2006-01-18 18:56 ` Eli Zaretskii
2006-01-19 17:43 ` Richard M. Stallman
2006-01-22 0:45 ` Juri Linkov
2006-01-22 17:44 ` Richard M. Stallman
2006-01-23 1:57 ` Juri Linkov
2006-01-24 16:46 ` Richard M. Stallman
2006-01-22 17:44 ` Richard M. Stallman
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).