From: Juri Linkov <juri@jurta.org>
Cc: bug-gnu-emacs@gnu.org, b.jc-emacs@netzero.com
Subject: Re: Bug in clone-indirect-buffer and clone-indirect-buffer-other-window
Date: Sun, 22 Jan 2006 02:45:01 +0200 [thread overview]
Message-ID: <87hd7x3xbm.fsf@jurta.org> (raw)
In-Reply-To: <E1EzdpH-0008AN-3a@fencepost.gnu.org> (Richard M. Stallman's message of "Thu, 19 Jan 2006 12:43:59 -0500")
> 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/
next prev parent reply other threads:[~2006-01-22 0:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=87hd7x3xbm.fsf@jurta.org \
--to=juri@jurta.org \
--cc=b.jc-emacs@netzero.com \
--cc=bug-gnu-emacs@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).