From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: Nick Roberts <nickrob@snap.net.nz>, emacs-devel@gnu.org
Subject: Re: Compilation auto-jump bug
Date: Tue, 22 Apr 2008 21:51:35 -0400 [thread overview]
Message-ID: <jwvskxdnxwl.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ej8xka66.fsf_-_@jurta.org> (Juri Linkov's message of "Tue, 22 Apr 2008 23:57:51 +0300")
> BTW, there is also the opposite bug: when `compilation-scroll-output' is
> `first-error', but `compilation-auto-jump-to-first-error' is nil, when
> the current buffer is not the *compilation* buffer, then it doesn't keep
> point on the first error. This means when I switch to the *compilation*
> buffer, point is at the beginning of the *compilation* buffer instead of
> the position of the first error. But when the current buffer is the
> *compilation* buffer at the time when compilation moves point, then it
> keeps the correct position of the first error. This is due to the code:
> (defun compilation-auto-jump (buffer pos)
> (with-current-buffer buffer
> (goto-char pos)
> (if compilation-auto-jump-to-first-error
> (compile-goto-error))))
> It doesn't use `save-excursion', so it is strange that it doesn't keep
> point on the new position after `goto-char'.
I guess the problem is that we need to affect the window-point of the
window that's showing the compilation buffer and this only happens when
we do `goto-char' if that window is the selected one.
So maybe something like:
(defun compilation-auto-jump (buffer pos)
(with-current-buffer buffer
(goto-char pos)
(let ((win (get-buffer-window buffer 0)))
(if win (set-window-point win pos)))
(if compilation-auto-jump-to-first-error
(compile-goto-error))))
-- Stefan
next prev parent reply other threads:[~2008-04-23 1:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 20:01 Info bug Chong Yidong
2008-04-21 23:16 ` Juri Linkov
2008-04-21 23:31 ` Nick Roberts
2008-04-22 20:57 ` Compilation auto-jump bug (was: Info bug) Juri Linkov
2008-04-23 1:51 ` Stefan Monnier [this message]
2008-04-23 8:54 ` Compilation auto-jump bug Juri Linkov
2008-04-23 15:40 ` Stefan Monnier
2008-04-22 3:02 ` Info bug Chong Yidong
2008-04-22 3:08 ` Stefan Monnier
2008-04-22 5:59 ` David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvskxdnxwl.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).