[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compilation auto-jump bug (was: Info bug)
From: |
Juri Linkov |
Subject: |
Compilation auto-jump bug (was: Info bug) |
Date: |
Tue, 22 Apr 2008 23:57:51 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
> > @@ -2271,8 +2262,7 @@
> > ;; Note that `Info-complete-menu-buffer' could be current already,
> > ;; so we want to save point.
> > - (save-excursion
> > - (set-buffer Info-complete-menu-buffer)
> > + (with-current-buffer Info-complete-menu-buffer
> > (let ((completion-ignore-case t)
> > (case-fold-search t)
> > (orignode Info-current-node)
> >
> > In theory, these constructs should be equivalent, but they are not.
>
> with-current-buffer is equivalent to
>
> (save-current-buffer
> (set-buffer...
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'.
But when `compilation-auto-jump-to-first-error' is t, then
after calling `compile-goto-error' and switching to the source buffer,
point keeps its new position on the first error in the *compilation* buffer.
--
Juri Linkov
http://www.jurta.org/emacs/
Re: Info bug, Chong Yidong, 2008/04/21
Re: Info bug, Stefan Monnier, 2008/04/21
Re: Info bug, David Kastrup, 2008/04/22