unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10770: info-display-manual replaces existing *info* buffer
@ 2012-02-09  6:33 Glenn Morris
  2012-02-09  9:28 ` Juri Linkov
  2012-02-09 18:36 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Glenn Morris @ 2012-02-09  6:33 UTC (permalink / raw)
  To: 10770

Package: emacs
Version: 24.0.93
Severity: wishlist

emacs -Q
M-x info-display-manual RET gnus RET
M-x info-display-manual RET emacs RET

Now my Gnus manual is gone, replaced by the Emacs manual.
I expected it to use a new buffer for the Emacs manual.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09  6:33 bug#10770: info-display-manual replaces existing *info* buffer Glenn Morris
@ 2012-02-09  9:28 ` Juri Linkov
  2012-02-09 18:43   ` Eli Zaretskii
  2012-02-09 18:36 ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2012-02-09  9:28 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

tags 10770 patch
thanks

> M-x info-display-manual RET gnus RET
> M-x info-display-manual RET emacs RET
>
> Now my Gnus manual is gone, replaced by the Emacs manual.
> I expected it to use a new buffer for the Emacs manual.

Maybe it would be good to append manual names to buffer names
as suffixes like "*info*<gnu>" and "*info*<emacs>" to make
unique and recognizable buffer names?

But since currently uniqueness is provided by adding a number
like "*info*<2>", the following patch will work with the
current naming convention:

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-01-25 17:54:01 +0000
+++ lisp/info.el	2012-02-09 09:27:10 +0000
@@ -4999,7 +5005,7 @@ (defun info-display-manual (manual)
     (if found
 	(switch-to-buffer found)
       (info-initialize)
-      (info (Info-find-file manual)))))
+      (info (Info-find-file manual) (generate-new-buffer-name "*info*")))))
 
 (provide 'info)
 






^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09  6:33 bug#10770: info-display-manual replaces existing *info* buffer Glenn Morris
  2012-02-09  9:28 ` Juri Linkov
@ 2012-02-09 18:36 ` Eli Zaretskii
  2012-02-09 18:46   ` Glenn Morris
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2012-02-09 18:36 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

> From: Glenn Morris <rgm@gnu.org>
> Date: Thu, 09 Feb 2012 01:33:40 -0500
> 
> M-x info-display-manual RET gnus RET
> M-x info-display-manual RET emacs RET
> 
> Now my Gnus manual is gone, replaced by the Emacs manual.
> I expected it to use a new buffer for the Emacs manual.

It doesn't create new buffers, only finds existing ones.  (Did the doc
string suggest otherwise?)

IOW, do it like this:

  M-x info-display-manual RET gnus RET
  M-x rename-buffer *info*<1> RET
  M-x info-display-manual RET emacs RET
  M-x rename-buffer *info*<2> RET

(The second rename is not necessary, but it clears the way for yet
another info-display-manual.)

Now you can use info-display-manual, and it will switch to the right
buffer automatically.

I wrote that command because I always have several dozens of Info
manuals open in my Emacs session, and I want to be able to switch
between them without any hassle.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09  9:28 ` Juri Linkov
@ 2012-02-09 18:43   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2012-02-09 18:43 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 10770

> From: Juri Linkov <juri@jurta.org>
> Date: Thu, 09 Feb 2012 11:28:03 +0200
> Cc: 10770@debbugs.gnu.org
> 
> > M-x info-display-manual RET gnus RET
> > M-x info-display-manual RET emacs RET
> >
> > Now my Gnus manual is gone, replaced by the Emacs manual.
> > I expected it to use a new buffer for the Emacs manual.
> 
> Maybe it would be good to append manual names to buffer names
> as suffixes like "*info*<gnu>" and "*info*<emacs>" to make
> unique and recognizable buffer names?

How would that help?

> But since currently uniqueness is provided by adding a number
> like "*info*<2>", the following patch will work with the
> current naming convention:
> 
> === modified file 'lisp/info.el'
> --- lisp/info.el	2012-01-25 17:54:01 +0000
> +++ lisp/info.el	2012-02-09 09:27:10 +0000
> @@ -4999,7 +5005,7 @@ (defun info-display-manual (manual)
>      (if found
>  	(switch-to-buffer found)
>        (info-initialize)
> -      (info (Info-find-file manual)))))
> +      (info (Info-find-file manual) (generate-new-buffer-name "*info*")))))

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:36 ` Eli Zaretskii
@ 2012-02-09 18:46   ` Glenn Morris
  2012-02-09 18:53     ` Glenn Morris
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Glenn Morris @ 2012-02-09 18:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 10770

Eli Zaretskii wrote:

> IOW, do it like this:
>
>   M-x info-display-manual RET gnus RET
>   M-x rename-buffer *info*<1> RET
>   M-x info-display-manual RET emacs RET
>   M-x rename-buffer *info*<2> RET

Yes, I can do that. But I think it would be more useful to me if it
worked the way Juri suggested:

  Maybe it would be good to append manual names to buffer names as
  suffixes like "*info*<gnu>" and "*info*<emacs>" to make unique and
  recognizable buffer names?

Maybe require a prefix arg, or have an option, to get that behaviour if
you don't like it.

Anyway, just a feature request, not a bug report.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:46   ` Glenn Morris
@ 2012-02-09 18:53     ` Glenn Morris
  2012-02-09 19:05       ` Eli Zaretskii
  2012-02-09 19:23       ` Glenn Morris
  2012-02-09 19:04     ` Eli Zaretskii
  2012-02-10 15:15     ` Stefan Monnier
  2 siblings, 2 replies; 16+ messages in thread
From: Glenn Morris @ 2012-02-09 18:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 10770


PS maybe there should be an `info-rename' command that renames an info
buffer to include the name of the displayed manual. Presumably it was
the fact that you had *info*<1>, *info*<2> etc rather than *info*<emacs>
that led you to write info-display-manual in the first place.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:46   ` Glenn Morris
  2012-02-09 18:53     ` Glenn Morris
@ 2012-02-09 19:04     ` Eli Zaretskii
  2012-12-02  6:24       ` Chong Yidong
  2012-02-10 15:15     ` Stefan Monnier
  2 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2012-02-09 19:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

> From: Glenn Morris <rgm@gnu.org>
> Cc: 10770@debbugs.gnu.org
> Date: Thu, 09 Feb 2012 13:46:14 -0500
> 
> Maybe require a prefix arg, or have an option, to get that behaviour if
> you don't like it.

Juri's patch for generating *info*<N> automatically is OK with me.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:53     ` Glenn Morris
@ 2012-02-09 19:05       ` Eli Zaretskii
  2012-02-09 19:16         ` Drew Adams
  2012-02-09 19:19         ` Glenn Morris
  2012-02-09 19:23       ` Glenn Morris
  1 sibling, 2 replies; 16+ messages in thread
From: Eli Zaretskii @ 2012-02-09 19:05 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

> From: Glenn Morris <rgm@gnu.org>
> Cc: 10770@debbugs.gnu.org
> Date: Thu, 09 Feb 2012 13:53:20 -0500
> 
> 
> PS maybe there should be an `info-rename' command that renames an info
> buffer to include the name of the displayed manual. Presumably it was
> the fact that you had *info*<1>, *info*<2> etc rather than *info*<emacs>
> that led you to write info-display-manual in the first place.

Also because typing "emacs" or "make" is shorter than "*info*<emacs>"
etc., and completion doesn't help much when all the candidates begin
with the same substring.






^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:05       ` Eli Zaretskii
@ 2012-02-09 19:16         ` Drew Adams
  2012-02-09 19:19         ` Glenn Morris
  1 sibling, 0 replies; 16+ messages in thread
From: Drew Adams @ 2012-02-09 19:16 UTC (permalink / raw)
  To: 'Eli Zaretskii', 'Glenn Morris'; +Cc: 10770

> Also because typing "emacs" or "make" is shorter than "*info*<emacs>"
> etc., and completion doesn't help much when all the candidates begin
> with the same substring.

Huh?  Prefix completion for things that share a common prefix just abstracts
away that prefix (by completing to it), so you do not have to type it.  The
difference would be that completion would help with the *non*-prefix part.

(I do not have a particular opinion about the rest of what was discussed.  Just
pointing out that it is not the case that completion doesn't help much when all
candidates share a common prefix.)






^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:05       ` Eli Zaretskii
  2012-02-09 19:16         ` Drew Adams
@ 2012-02-09 19:19         ` Glenn Morris
  2012-02-09 22:04           ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Glenn Morris @ 2012-02-09 19:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 10770

Eli Zaretskii wrote:

> Also because typing "emacs" or "make" is shorter than "*info*<emacs>"
> etc., and completion doesn't help much when all the candidates begin
> with the same substring.

But completion is smart now! :)

C-x b <emTAB

will happily complete to *info*<emacs>





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:53     ` Glenn Morris
  2012-02-09 19:05       ` Eli Zaretskii
@ 2012-02-09 19:23       ` Glenn Morris
  2012-02-10 10:14         ` Juri Linkov
  2012-02-10 15:13         ` Stefan Monnier
  1 sibling, 2 replies; 16+ messages in thread
From: Glenn Morris @ 2012-02-09 19:23 UTC (permalink / raw)
  To: 10770

Glenn Morris wrote:

> PS maybe there should be an `info-rename' command that renames an info
> buffer to include the name of the displayed manual.

Or maybe `rename-uniquely' should get some (optional) smart behaviour to
use more meaningful names. Names of manuals in info, names of recipient
of current mail message, etc.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:19         ` Glenn Morris
@ 2012-02-09 22:04           ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2012-02-09 22:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

> From: Glenn Morris <rgm@gnu.org>
> Cc: 10770@debbugs.gnu.org
> Date: Thu, 09 Feb 2012 14:19:33 -0500
> 
> But completion is smart now! :)
> 
> C-x b <emTAB
> 
> will happily complete to *info*<emacs>

But for that, I need to _think_ first.  When I go to another manual, I
don't want to think about how to set up the completion thingy.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:23       ` Glenn Morris
@ 2012-02-10 10:14         ` Juri Linkov
  2012-02-10 15:13         ` Stefan Monnier
  1 sibling, 0 replies; 16+ messages in thread
From: Juri Linkov @ 2012-02-10 10:14 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

>> PS maybe there should be an `info-rename' command that renames an info
>> buffer to include the name of the displayed manual.
>
> Or maybe `rename-uniquely' should get some (optional) smart behaviour to
> use more meaningful names. Names of manuals in info, names of recipient
> of current mail message, etc.

Then functions like `occur-rename-buffer' could be replaced with a simple
buffer-local naming function (named e.g. `rename-buffer-name-function')
with the behaviour similar to `compilation-buffer-name-function'.

This will help to replace such customizations as:

(add-hook 'occur-hook (lambda () (occur-rename-buffer t)))
(setq compilation-buffer-name-function
      (lambda (mode-name)
        (generate-new-buffer-name
         (concat "*" (downcase mode-name) "*"))))

with just:

(add-hook 'occur-hook 'rename-uniquely)
(add-hook 'compilation-mode-hook 'rename-uniquely)





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:23       ` Glenn Morris
  2012-02-10 10:14         ` Juri Linkov
@ 2012-02-10 15:13         ` Stefan Monnier
  1 sibling, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2012-02-10 15:13 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

>> PS maybe there should be an `info-rename' command that renames an info
>> buffer to include the name of the displayed manual.
> Or maybe `rename-uniquely' should get some (optional) smart behaviour to
> use more meaningful names. Names of manuals in info, names of recipient
> of current mail message, etc.

You mean improve uniquify to handle these cases as well?
Agreed, that would be good,


        Stefan





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 18:46   ` Glenn Morris
  2012-02-09 18:53     ` Glenn Morris
  2012-02-09 19:04     ` Eli Zaretskii
@ 2012-02-10 15:15     ` Stefan Monnier
  2 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2012-02-10 15:15 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10770

>   Maybe it would be good to append manual names to buffer names as
>   suffixes like "*info*<gnu>" and "*info*<emacs>" to make unique and
>   recognizable buffer names?

If we want info-display-manual to do that, we'd need to make sure that
either you can't move up to `dir' and select some other manual in those
info buffers, or otherwise catch this case and dynamically rename the
buffer (e.g. with uniquify).


        Stefan





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#10770: info-display-manual replaces existing *info* buffer
  2012-02-09 19:04     ` Eli Zaretskii
@ 2012-12-02  6:24       ` Chong Yidong
  0 siblings, 0 replies; 16+ messages in thread
From: Chong Yidong @ 2012-12-02  6:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 10770

Eli Zaretskii <eliz@gnu.org> writes:

>> Maybe require a prefix arg, or have an option, to get that behaviour
>> if you don't like it.
>
> Juri's patch for generating *info*<N> automatically is OK with me.

Me too; added to trunk.  The other suggestions discussed in this thread
don't seem particularly necessary to me.





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-12-02  6:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09  6:33 bug#10770: info-display-manual replaces existing *info* buffer Glenn Morris
2012-02-09  9:28 ` Juri Linkov
2012-02-09 18:43   ` Eli Zaretskii
2012-02-09 18:36 ` Eli Zaretskii
2012-02-09 18:46   ` Glenn Morris
2012-02-09 18:53     ` Glenn Morris
2012-02-09 19:05       ` Eli Zaretskii
2012-02-09 19:16         ` Drew Adams
2012-02-09 19:19         ` Glenn Morris
2012-02-09 22:04           ` Eli Zaretskii
2012-02-09 19:23       ` Glenn Morris
2012-02-10 10:14         ` Juri Linkov
2012-02-10 15:13         ` Stefan Monnier
2012-02-09 19:04     ` Eli Zaretskii
2012-12-02  6:24       ` Chong Yidong
2012-02-10 15:15     ` Stefan Monnier

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).