unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nordlöw <per.nordlow@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Shrinking grep/compile window to fit contents of buffer
Date: Tue, 13 Nov 2007 01:38:58 -0800	[thread overview]
Message-ID: <1194946738.067410.88880@o80g2000hse.googlegroups.com> (raw)
In-Reply-To: <mailman.3418.1194943989.18990.help-gnu-emacs@gnu.org>

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

  parent reply	other threads:[~2007-11-13  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13  8:18 Shrinking grep/compile window to fit contents of buffer Nordlöw
2007-11-13  8:52 ` Lennart Borgman (gmail)
     [not found] ` <mailman.3418.1194943989.18990.help-gnu-emacs@gnu.org>
2007-11-13  9:38   ` Nordlöw [this message]
2007-11-13  9:56     ` Juanma Barranquero
     [not found]     ` <mailman.3423.1194947780.18990.help-gnu-emacs@gnu.org>
2007-11-13 10:06       ` Nordlöw
2007-11-14  9:26         ` David Rod

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=1194946738.067410.88880@o80g2000hse.googlegroups.com \
    --to=per.nordlow@gmail.com \
    --cc=help-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.
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).