unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* kill buffer in other window
@ 2008-03-03 19:45 Florian Kaufmann
  2008-03-04  8:27 ` Tim X
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Florian Kaufmann @ 2008-03-03 19:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hello

Say you called something that displays a new buffer in the 'other
window', e.g. describe-function, grep. When you done reading that
buffer, you want to undo the displaying. That is kill the buffer, and
delete the window if one was created. I din't found yet a convenient
way to do it. Of course I can write a small lisp function, but I think
there are other cool ways.

Greetings

Flo





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

* Re: kill buffer in other window
  2008-03-03 19:45 kill buffer in other window Florian Kaufmann
@ 2008-03-04  8:27 ` Tim X
  2008-03-22  7:46 ` Uday S Reddy
  2008-04-24 12:47 ` harven
  2 siblings, 0 replies; 5+ messages in thread
From: Tim X @ 2008-03-04  8:27 UTC (permalink / raw)
  To: help-gnu-emacs

Florian Kaufmann <sensorflo@gmail.com> writes:

> Hello
>
> Say you called something that displays a new buffer in the 'other
> window', e.g. describe-function, grep. When you done reading that
> buffer, you want to undo the displaying. That is kill the buffer, and
> delete the window if one was created. I din't found yet a convenient
> way to do it. Of course I can write a small lisp function, but I think
> there are other cool ways.
>

First, don't get hung up on killing the buffer. Buffers like *Help*
don't use much resoruces and the buffer will be reused next time you use
help. I've often got many buffers open in emacs at a time (normally
around 30 or more). 

All you want is to have the buffer not use up valuable display space. To
do this, use the window commands. For example, when a help buffer pops
up and your finished with it, just hit C-x 1 from within the buffer you
want to stay and the help buffer will vanish while your current buffer
expands to fill the frame. 

Tim

-- 
tcross (at) rapttech dot com dot au


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

* Re: kill buffer in other window
  2008-03-03 19:45 kill buffer in other window Florian Kaufmann
  2008-03-04  8:27 ` Tim X
@ 2008-03-22  7:46 ` Uday S Reddy
  2008-04-24 12:47 ` harven
  2 siblings, 0 replies; 5+ messages in thread
From: Uday S Reddy @ 2008-03-22  7:46 UTC (permalink / raw)
  To: help-gnu-emacs

"Florian Kaufmann" <sensorflo@gmail.com> wrote in message 
news:c59035aa-c961-4910-8b82-e15022e384ac@e6g2000prf.googlegroups.com...
> Hello
>
> Say you called something that displays a new buffer in the 'other
> window', e.g. describe-function, grep. When you done reading that
> buffer, you want to undo the displaying.

You might want to check out electric-help (ehelp.el).  There is nothing 
more satisfying than the window disappearing when you think it should!

Cheers,
Uday Reddy



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

* Re: kill buffer in other window
  2008-03-03 19:45 kill buffer in other window Florian Kaufmann
  2008-03-04  8:27 ` Tim X
  2008-03-22  7:46 ` Uday S Reddy
@ 2008-04-24 12:47 ` harven
  2008-04-24 13:29   ` Sébastien Vauban
  2 siblings, 1 reply; 5+ messages in thread
From: harven @ 2008-04-24 12:47 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 3, 9:45 pm, Florian Kaufmann <sensor...@gmail.com> wrote:
> Hello
>
> Say you called something that displays a new buffer in the 'other
> window', e.g. describe-function, grep. When you done reading that
> buffer, you want to undo the displaying. That is kill the buffer, and
> delete the window if one was created. I din't found yet a convenient
> way to do it. Of course I can write a small lisp function, but I think
> there are other cool ways.
>
> Greetings
>
> Flo

Here is a short code snippet which gets ride of a hanging compilation
window if compilation was successful. Taken from some .emacs file
found on the wiki.

;; I also don't like that the compilation window sticks around after a
;; successful compile. After all, most of the time, all I care about
;; is that the compile completed cleanly. Here's how I make the
;; compilation window go away, only if there was no compilation
;; errors:
 (setq compilation-finish-function
       (lambda (buf str)
         (if (string-match "exited abnormally" str)
             ;; there were errors
             (message "compilation errors, press C-x ` to visit")
           ;; no errors, make compilation window go away in 0.5 sec
           (run-at-time 0.5 nil 'delete-windows-on buf)
           (message "NO COMPILATION ERRORS!"))))


I use something similar to get rid of a hanging help window when
compiling successfully a tex file using auctex.

(defadvice TeX-command-master (after kill-Help-window)
 (if (and TeX-error-report-switches
     (plist-get TeX-error-report-switches
       (intern (plist-get TeX-error-report-switches 'TeX-current-
master))))
            (TeX-next-error 1)
       (when (get-buffer "*TeX Help*")
         (set-buffer "*TeX Help*")
         (kill-buffer-and-window))))
(ad-activate 'TeX-command-master)
(setq TeX-process-asynchronous nil)


Hope this helps.


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

* Re: kill buffer in other window
  2008-04-24 12:47 ` harven
@ 2008-04-24 13:29   ` Sébastien Vauban
  0 siblings, 0 replies; 5+ messages in thread
From: Sébastien Vauban @ 2008-04-24 13:29 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

> I use something similar to get rid of a hanging help window
> when compiling successfully a tex file using auctex.
>
> (defadvice TeX-command-master (after kill-Help-window)
>  (if (and TeX-error-report-switches
>      (plist-get TeX-error-report-switches
>        (intern (plist-get TeX-error-report-switches 'TeX-current-master))))
>             (TeX-next-error 1)
>        (when (get-buffer "*TeX Help*")
>          (set-buffer "*TeX Help*")
>          (kill-buffer-and-window))))
> (ad-activate 'TeX-command-master)
> (setq TeX-process-asynchronous nil)

I took this from http://www.mygooglest.com/fni/dot-emacs.html#sec4:

    ;; don't show output of TeX compilation in other window
    (setq TeX-show-compilation nil)

Works for me...

Seb

-- 
Sébastien Vauban


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

end of thread, other threads:[~2008-04-24 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-03 19:45 kill buffer in other window Florian Kaufmann
2008-03-04  8:27 ` Tim X
2008-03-22  7:46 ` Uday S Reddy
2008-04-24 12:47 ` harven
2008-04-24 13:29   ` Sébastien Vauban

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