all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: Undesired point moves while compiling
Date: Sat, 05 Nov 2005 11:47:11 +0200	[thread overview]
Message-ID: <871x1vqtt5.fsf@jurta.org> (raw)
In-Reply-To: <103F76AF-DD6C-45E2-B871-8FF18F282DEC@ll.mit.edu> (Brad Howes's message of "Wed, 2 Nov 2005 12:55:59 -0500")

>> There is special code in this function that uses beginning-of-line
>> to move point in the source buffer during fontification.
>> But I don't know is this intentional or not.  Or maybe
>> `save-excursion' is missing around `save-restriction'?
>
> Excellent suggestion! Inserting a `save-excursion' between the
> `with-current-buffer' and `save-restriction' (line 710) in the routine
> `compilation-internal-error-properties' fixed my problem. Thanks!

After looking more at this function I still can't decide if its current
behavior is intentional or not.  Someone might want to call `next-error'
on the first message, sit back and see how the cursor jumps around in the
source buffer.

But really I don't think this is useful.  Perhaps this should be
changed in CVS to save point?

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.388
diff -c -w -b -r1.388 compile.el
*** lisp/progmodes/compile.el	16 Oct 2005 14:12:50 -0000	1.388
--- lisp/progmodes/compile.el	5 Nov 2005 09:44:18 -0000
***************
*** 707,712 ****
--- 707,713 ----
        (setq marker (nth 3 (cadr marker-line))
  	    marker-line (or (car marker-line) 1))
        (with-current-buffer (marker-buffer marker)
+ 	(save-excursion
  	  (save-restriction
  	    (widen)
  	    (goto-char (marker-position marker))
***************
*** 724,730 ****
  	      (compilation-move-to-column
  	       col compilation-error-screen-columns)
  	    (forward-to-indentation 0))
! 	  (setq marker (list (point-marker))))))
  
      (setq loc (compilation-assq line (cdr file-struct)))
      (if end-line
--- 725,731 ----
  		(compilation-move-to-column
  		 col compilation-error-screen-columns)
  	      (forward-to-indentation 0))
! 	    (setq marker (list (point-marker)))))))
  
      (setq loc (compilation-assq line (cdr file-struct)))
      (if end-line

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-11-05  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-02  4:26 Undesired point moves while compiling Brad Howes
2005-11-02  6:22 ` Juri Linkov
2005-11-02 17:55   ` Brad Howes
2005-11-05  9:47     ` Juri Linkov [this message]
2005-11-05 23:43       ` Richard M. Stallman
2005-11-06  4:02       ` Miles Bader
2005-11-07 15:34   ` Richard M. Stallman

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871x1vqtt5.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.