all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* closing man and help buffers
@ 2013-08-19  8:53 Luca Ferrari
  2013-08-19  9:08 ` Vlad Piersec
  2013-08-19  9:47 ` Eric Abrahamsen
  0 siblings, 2 replies; 16+ messages in thread
From: Luca Ferrari @ 2013-08-19  8:53 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
this should be trivial, but I have not found a solution yet: often I
open a man buffer (M-x man) or an help buffer (e.g., C-h something).
The behavior is that the window splits and the buffer I was currently
editing keeps the focus, so to close the other informational buffer I
have to either use C-x C-b or switch to the buffer and kill it. Is
there a smarter way to close such buffer (and only it) while keep the
focus on the editing one? Something like "close the last opened
buffer" could work.

Thanks,
Luca



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

* Re: closing man and help buffers
  2013-08-19  8:53 closing man and help buffers Luca Ferrari
@ 2013-08-19  9:08 ` Vlad Piersec
  2013-08-19  9:55   ` Luca Ferrari
  2013-08-19  9:47 ` Eric Abrahamsen
  1 sibling, 1 reply; 16+ messages in thread
From: Vlad Piersec @ 2013-08-19  9:08 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs

If you are in that help buffer you can press Q to close it. If not select
the window (C-x o)​ and close it with Q.


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

* Re: closing man and help buffers
  2013-08-19  8:53 closing man and help buffers Luca Ferrari
  2013-08-19  9:08 ` Vlad Piersec
@ 2013-08-19  9:47 ` Eric Abrahamsen
  1 sibling, 0 replies; 16+ messages in thread
From: Eric Abrahamsen @ 2013-08-19  9:47 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari <fluca1978@infinito.it> writes:

> Hi all,
> this should be trivial, but I have not found a solution yet: often I
> open a man buffer (M-x man) or an help buffer (e.g., C-h something).
> The behavior is that the window splits and the buffer I was currently
> editing keeps the focus, so to close the other informational buffer I
> have to either use C-x C-b or switch to the buffer and kill it. Is
> there a smarter way to close such buffer (and only it) while keep the
> focus on the editing one? Something like "close the last opened
> buffer" could work.

The advice of the help buffer itself is to use "C-x 1" to get rid of it
-- since successive calls to help or man will reuse those buffers,
that's not too onerous. If you had more than one window to begin with,
of course, it's not nice as it will get rid of *all* the other windows.
I agree that some sort of "close utility window" command would be great,
and please God let it apply to the Quail Completion buffer as well.

Perhaps a fair solution would be a command that calls delete-window for
any buffer matching a list of regexps stored in (for example)
utility-buffer-names. Default to '("\\*Help\\*" "\\*Man*"
"\\*Apropos\\*" "\\*Quail Completions\\*) or something like that.

Untested code:

(defvar utility-buffer-names '("\\*Help\\*" "\\*Man" "\\*Apropos\\*"))

(defun kill-utility-windows ()
  (dolist (w (window-list))
    (dolist (b utility-buffer-names)
      (when (string-match-p b (buffer-name (window-buffer w)))
	(delete-window w))))) 

Probably too simplistic, but could be developed into something....

E




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

* Re: closing man and help buffers
  2013-08-19  9:08 ` Vlad Piersec
@ 2013-08-19  9:55   ` Luca Ferrari
  2013-08-19 11:42     ` Tim Visher
  0 siblings, 1 reply; 16+ messages in thread
From: Luca Ferrari @ 2013-08-19  9:55 UTC (permalink / raw)
  To: Vlad Piersec; +Cc: help-gnu-emacs

On Mon, Aug 19, 2013 at 11:08 AM, Vlad Piersec <vlad.piersec@gmail.com> wrote:
> If you are in that help buffer you can press Q to close it. If not select
> the window (C-x o) and close it with Q.


I know that, thanks. What I was wondering to avoid is to move to such
window (C-x o) to close it.

Luca



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

* Re: closing man and help buffers
  2013-08-19  9:55   ` Luca Ferrari
@ 2013-08-19 11:42     ` Tim Visher
  2013-08-19 13:42       ` Luca Ferrari
  0 siblings, 1 reply; 16+ messages in thread
From: Tim Visher @ 2013-08-19 11:42 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: Vlad Piersec, help-gnu-emacs

`C-x 1` is nice in simple scenarios.

For more complex scenarios I've come to rely on winner-mode.

On Mon, Aug 19, 2013 at 2:55 AM, Luca Ferrari <fluca1978@infinito.it> wrote:
> On Mon, Aug 19, 2013 at 11:08 AM, Vlad Piersec <vlad.piersec@gmail.com> wrote:
>> If you are in that help buffer you can press Q to close it. If not select
>> the window (C-x o) and close it with Q.
>
>
> I know that, thanks. What I was wondering to avoid is to move to such
> window (C-x o) to close it.
>
> Luca
>



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

* Re: closing man and help buffers
  2013-08-19 11:42     ` Tim Visher
@ 2013-08-19 13:42       ` Luca Ferrari
  2013-08-19 14:11         ` Michael Heerdegen
  0 siblings, 1 reply; 16+ messages in thread
From: Luca Ferrari @ 2013-08-19 13:42 UTC (permalink / raw)
  To: Tim Visher; +Cc: Vlad Piersec, help-gnu-emacs

On Mon, Aug 19, 2013 at 1:42 PM, Tim Visher <tim.visher@gmail.com> wrote:
> `C-x 1` is nice in simple scenarios.
>

Of course, but that will keep the buffer open, just pops up the other
to be visible on all the screen.


> For more complex scenarios I've come to rely on winner-mode.

An interesting mode I was not aware of, but I don't see how this will
solve the problem, since it allows only to restore the windowing
"history".
I suspect that an utility as kill-utility-buffer described in the
thread is the solution.

Thanks,
Luca



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

* Re: closing man and help buffers
  2013-08-19 13:42       ` Luca Ferrari
@ 2013-08-19 14:11         ` Michael Heerdegen
  2013-08-19 14:36           ` Luca Ferrari
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Heerdegen @ 2013-08-19 14:11 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari <fluca1978@infinito.it> writes:

> On Mon, Aug 19, 2013 at 1:42 PM, Tim Visher <tim.visher@gmail.com> wrote:
> > `C-x 1` is nice in simple scenarios.
> >
>
> Of course, but that will keep the buffer open, just pops up the other
> to be visible on all the screen.

Why do you think is it important to kill those buffers?

Michael.




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

* Re: closing man and help buffers
  2013-08-19 14:11         ` Michael Heerdegen
@ 2013-08-19 14:36           ` Luca Ferrari
  2013-08-19 16:11             ` Michael Heerdegen
       [not found]             ` <mailman.352.1376928704.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Luca Ferrari @ 2013-08-19 14:36 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, Aug 19, 2013 at 4:11 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:

> Why do you think is it important to kill those buffers?

It is not important, but it bother me when I switch to other buffers
since they are in the cycle.

Luca



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

* Re: closing man and help buffers
  2013-08-19 14:36           ` Luca Ferrari
@ 2013-08-19 16:11             ` Michael Heerdegen
       [not found]             ` <mailman.352.1376928704.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Michael Heerdegen @ 2013-08-19 16:11 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari <fluca1978@infinito.it> writes:

> On Mon, Aug 19, 2013 at 4:11 PM, Michael Heerdegen
> <michael_heerdegen@web.de> wrote:
>
> > Why do you think is it important to kill those buffers?
>
> It is not important, but it bother me when I switch to other buffers
> since they are in the cycle.

IMHO cleaning up buffers that way, be it automatically or manually, is
either annoying (when doing it manually) or dangerous (when doing it
automatically - buffers may be killed that you want to keep).

Instead, try to live with many buffers.  Configure Emacs so that
commands that display new buffers do it the way you want.  Configure
`display-buffer-alist'.  Use winner-mode.  Configure
`winner-boring-buffers' so that winner doesn't restore buffers you don't
want back.

Second, try to find a better way to switch buffers than relying on the
history (there are many approaches helping here: ido, elscreen, using
multiple frames, using bookmarks or save positions in registers, also
Icicles or Helm have good interfaces for buffer switching).

Michael.




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

* Re: closing man and help buffers
       [not found]             ` <mailman.352.1376928704.10748.help-gnu-emacs@gnu.org>
@ 2013-08-19 16:17               ` Dan Espen
  2013-08-19 18:17                 ` Óscar Fuentes
       [not found]                 ` <mailman.361.1376936252.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Dan Espen @ 2013-08-19 16:17 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Luca Ferrari <fluca1978@infinito.it> writes:
>
>> On Mon, Aug 19, 2013 at 4:11 PM, Michael Heerdegen
>> <michael_heerdegen@web.de> wrote:
>>
>> > Why do you think is it important to kill those buffers?
>>
>> It is not important, but it bother me when I switch to other buffers
>> since they are in the cycle.
>
> IMHO cleaning up buffers that way, be it automatically or manually, is
> either annoying (when doing it manually) or dangerous (when doing it
> automatically - buffers may be killed that you want to keep).
>
> Instead, try to live with many buffers.  Configure Emacs so that
> commands that display new buffers do it the way you want.  Configure
> `display-buffer-alist'.  Use winner-mode.  Configure
> `winner-boring-buffers' so that winner doesn't restore buffers you don't
> want back.
>
> Second, try to find a better way to switch buffers than relying on the
> history (there are many approaches helping here: ido, elscreen, using
> multiple frames, using bookmarks or save positions in registers, also
> Icicles or Helm have good interfaces for buffer switching).

I've assigned Electric Buffer list to F9 and I use that binding for
all my buffer selection.

Cleaning up buffers is simple, simply type 'd' for the buffers you want
to drop on the way to the buffer you want to select.

-- 
Dan Espen


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

* Re: closing man and help buffers
  2013-08-19 16:17               ` Dan Espen
@ 2013-08-19 18:17                 ` Óscar Fuentes
       [not found]                 ` <mailman.361.1376936252.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Óscar Fuentes @ 2013-08-19 18:17 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Espen <despen@verizon.net> writes:

> Cleaning up buffers is simple, simply type 'd' for the buffers you want
> to drop on the way to the buffer you want to select.

ibuffer allows marking buffers by several critria, including major mode,
name regexp... It has shortcuts for directly marking help buffers and
"old" buffers. Then, you can delete marked buffers with D.




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

* Re: closing man and help buffers
       [not found]                 ` <mailman.361.1376936252.10748.help-gnu-emacs@gnu.org>
@ 2013-08-19 18:54                   ` Dan Espen
  2013-08-19 20:11                     ` Óscar Fuentes
       [not found]                     ` <mailman.372.1376943131.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Dan Espen @ 2013-08-19 18:54 UTC (permalink / raw)
  To: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> Dan Espen <despen@verizon.net> writes:
>
>> Cleaning up buffers is simple, simply type 'd' for the buffers you want
>> to drop on the way to the buffer you want to select.
>
> ibuffer allows marking buffers by several critria, including major mode,
> name regexp... It has shortcuts for directly marking help buffers and
> "old" buffers. Then, you can delete marked buffers with D.

Just tried ibuffer.
looks like you can mark buffers with "d", "D" is not required.
Doesn't look quite as good as electric
and acts a bit weird.

You select with return instead of space.
I don't know what that line that says Default is but when I selected it,
it appeared to select itself but with no content.
It contains a blank line and total at the end and it lets you cursor
into them.
It appears to show itself in the buffer list.

Not switching any time soon.


-- 
Dan Espen


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

* Re: closing man and help buffers
  2013-08-19 18:54                   ` Dan Espen
@ 2013-08-19 20:11                     ` Óscar Fuentes
       [not found]                     ` <mailman.372.1376943131.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Óscar Fuentes @ 2013-08-19 20:11 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Espen <despen@verizon.net> writes:

>> ibuffer allows marking buffers by several critria, including major mode,
>> name regexp... It has shortcuts for directly marking help buffers and
>> "old" buffers. Then, you can delete marked buffers with D.
>
> Just tried ibuffer.
> looks like you can mark buffers with "d", "D" is not required.

`d' marks buffers for deletion, much like `dired'. It is an special
mark, not to be confused with the ordinary mark which just indicates
which buffers will be affected by a subsequent operation.

`D' is one such operation that deletes marked buffers.

> Doesn't look quite as good as electric
> and acts a bit weird.
>
> You select with return instead of space.
> I don't know what that line that says Default is but when I selected it,
> it appeared to select itself but with no content.
> It contains a blank line and total at the end and it lets you cursor
> into them.

[Default...] is a group heading. You can configure ibuffer for dividing
buffers into groups and operate on them at once.

> It appears to show itself in the buffer list.

No it doesn't.

> Not switching any time soon.

Good to know.

For those of you interested on ibuffer, see the compulsory EmacsWiki
entry:

http://www.emacswiki.org/emacs/IbufferMode




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

* Re: closing man and help buffers
       [not found]                     ` <mailman.372.1376943131.10748.help-gnu-emacs@gnu.org>
@ 2013-08-19 20:28                       ` Dan Espen
  2013-08-19 22:30                         ` Óscar Fuentes
       [not found]                         ` <mailman.382.1376951626.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Dan Espen @ 2013-08-19 20:28 UTC (permalink / raw)
  To: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> Dan Espen <despen@verizon.net> writes:
>
>>> ibuffer allows marking buffers by several critria, including major mode,
>>> name regexp... It has shortcuts for directly marking help buffers and
>>> "old" buffers. Then, you can delete marked buffers with D.
>>
>> Just tried ibuffer.
>> looks like you can mark buffers with "d", "D" is not required.
>
> `d' marks buffers for deletion, much like `dired'. It is an special
> mark, not to be confused with the ordinary mark which just indicates
> which buffers will be affected by a subsequent operation.
>
> `D' is one such operation that deletes marked buffers.
>
>> Doesn't look quite as good as electric
>> and acts a bit weird.
>>
>> You select with return instead of space.
>> I don't know what that line that says Default is but when I selected it,
>> it appeared to select itself but with no content.
>> It contains a blank line and total at the end and it lets you cursor
>> into them.
>
> [Default...] is a group heading. You can configure ibuffer for dividing
> buffers into groups and operate on them at once.

Ah, I think I see.
Well, I selected it with return then subsequent attempts to use ibuffer
gave me this mostly empty buffer list.

>> It appears to show itself in the buffer list.
>
> No it doesn't.

What's that Buffer Menu thing?

 MR Name                    Size Mode             Filename/Process
 -- ----                    ---- ----             ----------------
[ Default ]
 *% *Summary gnu.em...       323 Summary          
 *% *Article gnu.em...      1471 Article          
 *% *Group*                  544 Group            
    *scratch*                191 Lisp Interaction 
 *  *Messages*              3220 Fundamental      
    *Async Shell Co...         0 Shell            ~/doc/
    *sent followup ...      3702 Message          ~/News/drafts/drafts/6480
    *sent followup ...      1854 Message          ~/News/drafts/drafts/6483
 *% *Buffer List*            860 Buffer Menu      
 *  .newsrc-dribble          715 Fundamental      ~/.newsrc-dribble

    14 buffers             36832                  8 files, no processes

I don't see it in the electric thing.

-- 
Dan Espen


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

* Re: closing man and help buffers
  2013-08-19 20:28                       ` Dan Espen
@ 2013-08-19 22:30                         ` Óscar Fuentes
       [not found]                         ` <mailman.382.1376951626.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Óscar Fuentes @ 2013-08-19 22:30 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Espen <despen@verizon.net> writes:

>> [Default...] is a group heading. You can configure ibuffer for dividing
>> buffers into groups and operate on them at once.
>
> Ah, I think I see.
> Well, I selected it with return then subsequent attempts to use ibuffer
> gave me this mostly empty buffer list.

When you press return on a group heading it contracts. Pressing enter
again will expand it.

>>> It appears to show itself in the buffer list.
>>
>> No it doesn't.
>
> What's that Buffer Menu thing?
>
>  MR Name                    Size Mode             Filename/Process
>  -- ----                    ---- ----             ----------------
> [ Default ]
>  *% *Summary gnu.em...       323 Summary          
>  *% *Article gnu.em...      1471 Article          
>  *% *Group*                  544 Group            
>     *scratch*                191 Lisp Interaction 
>  *  *Messages*              3220 Fundamental      
>     *Async Shell Co...         0 Shell            ~/doc/
>     *sent followup ...      3702 Message          ~/News/drafts/drafts/6480
>     *sent followup ...      1854 Message          ~/News/drafts/drafts/6483
>  *% *Buffer List*            860 Buffer Menu      
>  *  .newsrc-dribble          715 Fundamental      ~/.newsrc-dribble
>
>     14 buffers             36832                  8 files, no processes
>
> I don't see it in the electric thing.

*Buffer List* is created by M-x buffer-menu. AFAIK it is unrelated to
ibuffer, so it came from something you did on your Emacs session.




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

* Re: closing man and help buffers
       [not found]                         ` <mailman.382.1376951626.10748.help-gnu-emacs@gnu.org>
@ 2013-08-19 23:26                           ` Dan Espen
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Espen @ 2013-08-19 23:26 UTC (permalink / raw)
  To: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> Dan Espen <despen@verizon.net> writes:
>
>>> [Default...] is a group heading. You can configure ibuffer for dividing
>>> buffers into groups and operate on them at once.
>>
>> Ah, I think I see.
>> Well, I selected it with return then subsequent attempts to use ibuffer
>> gave me this mostly empty buffer list.
>
> When you press return on a group heading it contracts. Pressing enter
> again will expand it.

Got it.

>>>> It appears to show itself in the buffer list.
>>>
>>> No it doesn't.
>>
>> What's that Buffer Menu thing?
>>
>>  MR Name                    Size Mode             Filename/Process
>>  -- ----                    ---- ----             ----------------
>> [ Default ]
>>  *% *Summary gnu.em...       323 Summary          
>>  *% *Article gnu.em...      1471 Article          
>>  *% *Group*                  544 Group            
>>     *scratch*                191 Lisp Interaction 
>>  *  *Messages*              3220 Fundamental      
>>     *Async Shell Co...         0 Shell            ~/doc/
>>     *sent followup ...      3702 Message          ~/News/drafts/drafts/6480
>>     *sent followup ...      1854 Message          ~/News/drafts/drafts/6483
>>  *% *Buffer List*            860 Buffer Menu      
>>  *  .newsrc-dribble          715 Fundamental      ~/.newsrc-dribble
>>
>>     14 buffers             36832                  8 files, no processes
>>
>> I don't see it in the electric thing.
>
> *Buffer List* is created by M-x buffer-menu. AFAIK it is unrelated to
> ibuffer, so it came from something you did on your Emacs session.

Yep, just started up another Emacs.

Looks like electric buffer ignores it where ibuffer doesn't.

Sorry.

-- 
Dan Espen


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

end of thread, other threads:[~2013-08-19 23:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19  8:53 closing man and help buffers Luca Ferrari
2013-08-19  9:08 ` Vlad Piersec
2013-08-19  9:55   ` Luca Ferrari
2013-08-19 11:42     ` Tim Visher
2013-08-19 13:42       ` Luca Ferrari
2013-08-19 14:11         ` Michael Heerdegen
2013-08-19 14:36           ` Luca Ferrari
2013-08-19 16:11             ` Michael Heerdegen
     [not found]             ` <mailman.352.1376928704.10748.help-gnu-emacs@gnu.org>
2013-08-19 16:17               ` Dan Espen
2013-08-19 18:17                 ` Óscar Fuentes
     [not found]                 ` <mailman.361.1376936252.10748.help-gnu-emacs@gnu.org>
2013-08-19 18:54                   ` Dan Espen
2013-08-19 20:11                     ` Óscar Fuentes
     [not found]                     ` <mailman.372.1376943131.10748.help-gnu-emacs@gnu.org>
2013-08-19 20:28                       ` Dan Espen
2013-08-19 22:30                         ` Óscar Fuentes
     [not found]                         ` <mailman.382.1376951626.10748.help-gnu-emacs@gnu.org>
2013-08-19 23:26                           ` Dan Espen
2013-08-19  9:47 ` Eric Abrahamsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.