all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [Fwd: Re: next-error insists on split windows]
@ 2006-04-28 15:45 Kevin Rodgers
  0 siblings, 0 replies; only message in thread
From: Kevin Rodgers @ 2006-04-28 15:45 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

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

[-- Attachment #2: Re: next-error insists on split windows --]
[-- Type: message/rfc822, Size: 2140 bytes --]

From: Kevin Rodgers <ihs_4664@yahoo.com>
To: Bill Wohler <wohler@newt.com>
Subject: Re: next-error insists on split windows
Date: Thu, 27 Apr 2006 11:08:12 -0600
Message-ID: <4450FA7C.7040001@yahoo.com>

Bill Wohler wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> 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


[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-28 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 15:45 [Fwd: Re: next-error insists on split windows] Kevin Rodgers

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.