help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shrinking grep/compile window to fit contents of buffer


From: Nordlöw
Subject: Re: Shrinking grep/compile window to fit contents of buffer
Date: Tue, 13 Nov 2007 01:38:58 -0800
User-agent: G2/1.0

On Nov 13, 9:52 am, "Lennart Borgman (gmail)"
<lennart.borg...@gmail.com> wrote:
> Nordlöw wrote:
> > How can I make emacs call shrink-window-if-larger-than-buffer() in the
> > message buffer upon completion of compile/grep?
>
> > Thanks in advance,
> > Nordlöw
>
> (info "(elisp) Standard Hooks")
>
> Look at compilation-finish-functions.

I thought the following code should work:

(defun shrink-compilation-window-if-larger-than-buffer (buf str)
  (shrink-window-if-larger-than-buffer)
  )
(if t
    (add-hook 'compilation-finish-functions
              'shrink-compilation-window-if-larger-than-buffer)
  )

but nothing happens. I believe I am missing a way to convert the BUF
argument to its window since shrink-window-if-larger-than-buffer()
needs a window as argument the above code does nothing yet.

/Nordlöw



reply via email to

[Prev in Thread] Current Thread [Next in Thread]