From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: [Fwd: Re: next-error insists on split windows] Date: Fri, 28 Apr 2006 09:45:05 -0600 Organization: IHS Message-ID: <44523881.6030607@yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080606020009090703060604" X-Trace: sea.gmane.org 1146249434 21034 80.91.229.2 (28 Apr 2006 18:37:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Apr 2006 18:37:14 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 28 20:37:10 2006 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FZXq2-0003iM-1D for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Apr 2006 20:37:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZXq1-0004Ja-IX for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Apr 2006 14:37:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZVAY-0008Bu-HF for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2006 11:46:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZVAS-00089d-NF for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2006 11:46:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZVAS-00089W-Et for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2006 11:46:04 -0400 Original-Received: from [207.167.43.222] (helo=mail1.ihs.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZVDb-0007qx-0Q for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2006 11:49:19 -0400 Original-Received: from [10.4.208.178] (eng0450354.ihs.internal.corp [10.4.208.178]) by mail1.ihs.com (8.13.0/8.13.0) with ESMTP id k3SFj7JD029252 for ; Fri, 28 Apr 2006 09:45:08 -0600 (MDT) User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) Original-To: bug-gnu-emacs@gnu.org X-Mailman-Approved-At: Fri, 28 Apr 2006 14:37:03 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15065 Archived-At: This is a multi-part message in MIME format. --------------080606020009090703060604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Bill Wohler confirms my attached analysis and workaround: > That seems to be doing what I hoped. Nice job. Thanks! That'll work > nicely until the underlying code gets an option for configuring this > behavior. > > To OP would probably appreciate a copy of this. Thanks, -- Kevin Rodgers --------------080606020009090703060604 Content-Type: message/rfc822; name="Re: next-error insists on split windows" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Re: next-error insists on split windows" Message-ID: <4450FA7C.7040001@yahoo.com> Date: Thu, 27 Apr 2006 11:08:12 -0600 From: Kevin Rodgers Organization: IHS User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: Bill Wohler Subject: Re: next-error insists on split windows References: <87hd4k1aai.fsf@jidanni.org> <87k69etxy3.fsf@olgas.newt.com> <32390.1145920329@olgas.newt.com> <87y7xtckpg.fsf@olgas.newt.com> <87slnzxd6t.fsf@olgas.newt.com> In-Reply-To: <87slnzxd6t.fsf@olgas.newt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Bill Wohler wrote: > Kevin Rodgers writes: > >> So M-x compile and M-x grep ought to display the *compilation* and >> *grep* buffers, but next-error and previous-error shouldn't. Does >> advising them to preserve the window configuration do what you want: >> >> (defadvice next-error (around save-window-excursion activate) >> "Preserve the current window configuration." >> (save-window-excursion >> ad-do-it)) > > It's a bit too strong since if the buffer with the next error isn't > current visible, you won't see it. OK, I've dug a little deeper and I think I understand how this works. The compilation buffer is displayed by compilation-goto-locus, but only when next-error and friends were called from some other buffer or the compilation buffer isn't already visible. I don't think messing with display-buffer is a good idea, but after the buffer is displayed compilation-set-window-height is called (unless it was already visible, which doesn't concern us). So perhaps advising compilation-set-window to undisplay the buffer when it was called in that context will work: (defadvice compilation-set-window-height (after delete-window activate) "Undisplay WINDOW if `compilation-goto-locus' made it visible." (when (and (boundp 'from-compilation-buffer) (boundp 'pre-existing) (or (not from-compilation-buffer) (not pre-existing))) (delete-window (ad-get-arg 0)))) -- Kevin --------------080606020009090703060604 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --------------080606020009090703060604--