emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation auto-jump bug


From: Stefan Monnier
Subject: Re: Compilation auto-jump bug
Date: Wed, 23 Apr 2008 11:40:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> (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))))

> Yes, it works.  Maybe we should add a primitive for this additional code
> with a name like `save-window-point'?  If this name can be confused with
> a function that keeps the old window point before entering its body, then
> maybe some other name would be more clear.

We could provide

  (defun goto-char-window (pos)
    "Like `goto-char' but also moves `window-point'."
    (goto-char pos)
    (let ((win (get-buffer-window (current-buffer) 0)))
      (if win (set-window-point win pos))))

This kind of thing is needed at various places, so it might be
a good idea.  If someone could grep through the Elisp code to try and
find the various places where we do something similar and try to see if
the above function is a good fit, that would be helpful,


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]