GNU bug report logs - #18342
24.3.93; jumping to compilation error location gives the wrong column

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Thu, 28 Aug 2014 10:33:02 UTC

Severity: minor

Found in version 24.3.93

Done: Filipp Gunbin <fgunbin <at> fastmail.fm>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: 18342 <at> debbugs.gnu.org
Subject: bug#18342: 24.3.93; jumping to compilation error location gives the wrong column
Date: Fri, 06 Mar 2015 02:41:30 +0300
Ok, I fixed it by adding the following to the java-mode-hook:

(set (make-local-variable 'compilation-first-column) 0)

But the problem of the common (lack of?) knowledge between emacs and the
compiler continues to exist.

However, if we set aside the TAB problem (everywhere I worked nobody
used TAB in source code), there doesn't seem to be a big problem:

The column numbers emitted by the compiler most probably mean "screen
columns" - just where you made an error in the source file.  I don't
know of compilers which do differently (I usually work only with
Oracle's Java compiler so I'm not the best person to state that).

If emacs and the compiler agree on source file encoding (and they should
be tuned to agree), then emacs just needs to go that count of chars
forward from the beginning of line.  The only things that remains -
whether to start from 0 or from 1 - is already handled by looking at
`compilation-first-column'.

Regarding `compilation-error-regexp-alist', the
`compilation-first-column' probably could be there, but then it should
be something like `compilation-compiler-var-alist' instead :)

There are unclear cases e.g. with maven: what if we use Oracle JDK which
outputs columns beginning with 0 and then change to another JDK which
outputs beginning with 1?  Would maven correct it's output?  I doubt so.
Then we should have two items in the alist: maven-oracle and maven-smth.

It'd be good to mention `compilation-first-column' in the manual.

Filipp




This bug report was last modified 10 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.