GNU bug report logs - #1073
23.0.60; Bad interaction between compilation-scroll-output and dedicated windows

Previous Next

Package: emacs;

Reported by: Lawrence Mitchell <wence <at> gmx.li>

Date: Fri, 3 Oct 2008 09:30:02 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 1073 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>, 1073 <at> debbugs.gnu.org
Cc: Lawrence Mitchell <wence <at> gmx.li>
Subject: Re: bug#1073: 23.0.60;	Bad interaction between compilation-scroll-output
 and	dedicated	windows
Date: Fri, 03 Oct 2008 15:18:25 +0200
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))




This bug report was last modified 16 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.