Subject: bug#9679: 24.0.90; After rgrep, next-error goes to the wrong line

From: Ari Roponen <[email-masked]>
Date: Fri, 07 Oct 2011 18:51:26 +0300

Juri Linkov <[email-masked]> writes:

> I suspect it may be related to screen columns because somehow
> `compilation-move-to-column' in `compilation-next-error-function'
> goes to the wrong line and column, i.e. to the position 387.
> What values of `compilation-error-screen-columns' and
> `grep-error-screen-columns' do you have in the *grep* buffer?
> I have both of them equal to `nil'.

I run the test case with "emacs -Q -l bug.el", so the variables
use their default values:

compilation-error-screen-columns is a variable defined in `compile.el'.
Its value is nil
Original value was t
Local in buffer *grep*; global value is t

grep-error-screen-columns is a variable defined in `grep.el'.
Its value is nil

>
> Could you please get the values of arguments that
> `compilation-move-to-column' receives here by debugging
> or adding (message "...") and seeing what values it prints
> in the *Message* buffer?

(defun compilation-move-to-column (col screen)
  "Go to column COL on the current line.
If SCREEN is non-nil, columns are screen columns, otherwise, they are
just char-counts."
  (message "col: %S, screen %S" col screen) ; Display parameters.
  (if screen
      (move-to-column (max col 0))
    (goto-char (min (+ (line-beginning-position) col) (line-end-position)))))

=>
Grep finished (matches found)
col: 13, screen nil
col: 7, screen nil
col: 13, screen t
col: 7, screen t

I get the same values also with the simpler "fix" that I mentioned in
the other post.

-- 
Ari Roponen