|
From: | Lennart Borgman (gmail) |
Subject: | bug#1073: 23.0.60; Bad interaction between compilation-scroll-output and dedicated windows |
Date: | Fri, 03 Oct 2008 15:18:25 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
martin rudalics wrote: >> When this code in `compilation-start' is executed: >> >> (if (buffer-local-value 'compilation-scroll-output outbuf) >> (save-selected-window >> (select-window outwin) >> (goto-char (point-max)))) >> >> outwin is #<window 13 on *compilation*> >> and after the select-window call (selected-window) is #<window 13 >> on *compilation*>. However, at this point (current-buffer) >> returns *test*, rather than *compilation*. > > This is a very, very great nuisance of `select-window'. Would the > attached patch DTRT? I did not try the patch so maybe I misunderstand it. But is not the problem that (current-buffer) is not the same as (window-buffer)? If so then perhaps using (save-selected-window (select-window outwin) (with-current-buffer (window-buffer) (goto-char (point-max))) would do the expected thing? But it looks strange to me. How does one know that this will change the point in outwin? It would be much cleaner with something like a defmacro `with-window-buffer' which would take a window as its first argument. With that defmacro the code would be (with-window-buffer outwin (goto-char (point-max))
[Prev in Thread] | Current Thread | [Next in Thread] |