GNU bug report logs -
#1073
23.0.60; Bad interaction between compilation-scroll-output and dedicated windows
Previous Next
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 #60 received at 1073 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> 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?
> martin
> *** progmodes/compile.el.~1.476.~ 2008-06-13 18:22:16.000000000 +0200
> --- progmodes/compile.el 2008-10-03 14:31:45.718750000 +0200
> ***************
> *** 1280,1289 ****
> (cons proc compilation-in-progress))))
> ;; Now finally cd to where the shell started make/grep/...
> (setq default-directory thisdir))
> ! (if (buffer-local-value 'compilation-scroll-output outbuf)
> ! (save-selected-window
> ! (select-window outwin)
> ! (goto-char (point-max))))
> ;; Make it so the next C-x ` will use this buffer.
> (setq next-error-last-buffer outbuf)))
> --- 1280,1290 ----
> (cons proc compilation-in-progress))))
> ;; Now finally cd to where the shell started make/grep/...
> (setq default-directory thisdir))
> !
> ! (with-current-buffer (window-buffer outwin)
> ! (when (local-variable-p 'compilation-scroll-output)
> ! (goto-char (point-max))))
> !
> ;; Make it so the next C-x ` will use this buffer.
> (setq next-error-last-buffer outbuf)))
I think the select-window thingy is/was needed in order to make sure we
move point in the relevant window, rather than just moving point in the
relevant buffer.
So maye something like:
(with-selected-window outwin
(with-current-buffer (window-buffer outwin)
...))
would be better.
Stefan
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.