unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: emacs-devel@gnu.org
Subject: Compilation auto-jump bug (was: Info bug)
Date: Tue, 22 Apr 2008 23:57:51 +0300	[thread overview]
Message-ID: <87ej8xka66.fsf_-_@jurta.org> (raw)
In-Reply-To: <18445.9167.275354.249388@kahikatea.snap.net.nz> (Nick Roberts's message of "Tue, 22 Apr 2008 11:31:27 +1200")

>  > @@ -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/




  reply	other threads:[~2008-04-22 20:57 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     ` Juri Linkov [this message]
2008-04-23  1:51       ` Compilation auto-jump bug Stefan Monnier
2008-04-23  8:54         ` 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=87ej8xka66.fsf_-_@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.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).