unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly
@ 2011-10-13 23:47 Matthieu Lemerre
  2011-10-14 17:41 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Lemerre @ 2011-10-13 23:47 UTC (permalink / raw)
  To: 9749

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

Just try to compile the following snippet with a recent (I used debian's
gcc 4.5.2):

main() {
  int i;
  for( i = 0;;)
    {
      int k;
      int f;
      {
	1 + a23098^^;
      }
      2 + a23098^^
    }
}

(All lines begin with space, but the 1 + a23098^^ line, which is
indented by tab. This is the default behaviour with emacs -Q)

Then compile (M-x compile - gcc test.c), the result is

test.c: In function ‘main’:
test.c:8:6: error: ‘a23098’ undeclared (first use in this function)
test.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
test.c:8:13: error: expected expression before ‘^’ token
test.c:10:18: error: expected expression before ‘^’ token

When clicking on the first error, the cursor is put in the wrong place
(before the 1, rather than before the a, because the tab has not been
accounted as a single character.)

If the 	1 + a23098^^; is commented out, and the file recompiled, then
the result of compilation is:
test.c:10:11: error: ‘a23098’ undeclared (first use in this function)
test.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
test.c:10:18: error: expected expression before ‘^’ token

This time, when selecting the first error emacs puts the cursor at the
right position, because there are no tabs in indentation.



In GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)
 of 2011-04-04 on rothera, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
configured using `configure  '--build' 'i686-linux-gnu' '--build' 'i686-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i686-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  recentf-mode: t
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-f 
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f C-n C-n C-n C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-h v <return> 
C-x b C-g C-x k <return> C-x 1 C-l C-b C-b C-b <tab> 
C-e <return> <tab> i n t SPC f ; <return> <tab> { <return> 
} C-p C-e <return> <tab> C-b C-f C-b C-f a s n t h 
2 3 0 9 8 <f3> ^ ^ C-x C-s C-c m C-a C-k g c c SPC 
t e s t . c <return> C-a M-< C-f C-f C-f C-f ( ) C-x 
C-s C-c m <return> C-x o <tab> <return> C-b C-p C-p 
C-n C-n C-k C-y C-p C-p <return> C-y <tab> C-x C-s 
C-c m <return> C-x o C-x o C-a C-k C-k C-n C-n C-e 
<return> C-y C-k C-x C-s C-c m <return> C-x o <tab> 
<return> C-b C-f C-b C-x o <tab> <return> C-x o <S-iso-lefttab> 
<S-iso-lefttab> <return> C-x o <return> C-x o <tab> 
<return> C-a <tab> 1 SPC + S-SPC C-x C-s C-c m <return> 
C-x o <tab> <return> C-x o <tab> C-x o C-n C-n M-m 
1 SPC + S-SPC C-x C-s C-c m <return> C-x o <tab> <tab> 
<return> C-x o C-x o C-e ; C-x C-s C-c m <return> C-x 
o C-x o C-a / / C-x C-s C-c m <return> C-x o <tab> 
<return> C-p C-p <backspace> <backspace> <tab> C-x 
C-s C-c m <return> C-x o <tab> <return> x c C-x u C-x 
o <return> M-x r e p o r t <tab> b <tab> <return>

Recent messages:
(No files need saving)
Compilation exited abnormally with code 1
Mark set
Saving file /home/matthieu/src/new-l/test.c...
Wrote /home/matthieu/src/new-l/test.c
(No files need saving)
Compilation exited abnormally with code 1
Mark set
Undo!
Mark set

Load-path shadows:
/usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs23/site-lisp/flim/sha1 hides /usr/share/emacs/23.2/lisp/sha1
/usr/share/emacs23/site-lisp/flim/hex-util hides /usr/share/emacs/23.2/lisp/hex-util
/usr/share/emacs23/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell
/usr/share/emacs23/site-lisp/org-mode/org-indent hides /usr/share/emacs/23.2/lisp/org/org-indent
/usr/share/emacs23/site-lisp/org-mode/org-crypt hides /usr/share/emacs/23.2/lisp/org/org-crypt
/usr/share/emacs23/site-lisp/org-mode/org hides /usr/share/emacs/23.2/lisp/org/org
/usr/share/emacs23/site-lisp/org-mode/org-footnote hides /usr/share/emacs/23.2/lisp/org/org-footnote
/usr/share/emacs23/site-lisp/org-mode/org-mouse hides /usr/share/emacs/23.2/lisp/org/org-mouse
/usr/share/emacs23/site-lisp/org-mode/org-install hides /usr/share/emacs/23.2/lisp/org/org-install
/usr/share/emacs23/site-lisp/org-mode/org-remember hides /usr/share/emacs/23.2/lisp/org/org-remember
/usr/share/emacs23/site-lisp/org-mode/org-bbdb hides /usr/share/emacs/23.2/lisp/org/org-bbdb
/usr/share/emacs23/site-lisp/org-mode/org-xoxo hides /usr/share/emacs/23.2/lisp/org/org-xoxo
/usr/share/emacs23/site-lisp/org-mode/org-latex hides /usr/share/emacs/23.2/lisp/org/org-latex
/usr/share/emacs23/site-lisp/org-mode/org-timer hides /usr/share/emacs/23.2/lisp/org/org-timer
/usr/share/emacs23/site-lisp/org-mode/org-mhe hides /usr/share/emacs/23.2/lisp/org/org-mhe
/usr/share/emacs23/site-lisp/org-mode/org-wl hides /usr/share/emacs/23.2/lisp/org/org-wl
/usr/share/emacs23/site-lisp/org-mode/org-freemind hides /usr/share/emacs/23.2/lisp/org/org-freemind
/usr/share/emacs23/site-lisp/org-mode/org-datetree hides /usr/share/emacs/23.2/lisp/org/org-datetree
/usr/share/emacs23/site-lisp/org-mode/org-habit hides /usr/share/emacs/23.2/lisp/org/org-habit
/usr/share/emacs23/site-lisp/org-mode/org-inlinetask hides /usr/share/emacs/23.2/lisp/org/org-inlinetask
/usr/share/emacs23/site-lisp/org-mode/org-colview hides /usr/share/emacs/23.2/lisp/org/org-colview
/usr/share/emacs23/site-lisp/org-mode/org-table hides /usr/share/emacs/23.2/lisp/org/org-table
/usr/share/emacs23/site-lisp/org-mode/org-clock hides /usr/share/emacs/23.2/lisp/org/org-clock
/usr/share/emacs23/site-lisp/org-mode/org-feed hides /usr/share/emacs/23.2/lisp/org/org-feed
/usr/share/emacs23/site-lisp/org-mode/org-mac-message hides /usr/share/emacs/23.2/lisp/org/org-mac-message
/usr/share/emacs23/site-lisp/org-mode/org-faces hides /usr/share/emacs/23.2/lisp/org/org-faces
/usr/share/emacs23/site-lisp/org-mode/org-attach hides /usr/share/emacs/23.2/lisp/org/org-attach
/usr/share/emacs23/site-lisp/org-mode/org-exp-blocks hides /usr/share/emacs/23.2/lisp/org/org-exp-blocks
/usr/share/emacs23/site-lisp/org-mode/org-archive hides /usr/share/emacs/23.2/lisp/org/org-archive
/usr/share/emacs23/site-lisp/org-mode/org-w3m hides /usr/share/emacs/23.2/lisp/org/org-w3m
/usr/share/emacs23/site-lisp/org-mode/org-gnus hides /usr/share/emacs/23.2/lisp/org/org-gnus
/usr/share/emacs23/site-lisp/org-mode/org-plot hides /usr/share/emacs/23.2/lisp/org/org-plot
/usr/share/emacs23/site-lisp/org-mode/org-bibtex hides /usr/share/emacs/23.2/lisp/org/org-bibtex
/usr/share/emacs23/site-lisp/org-mode/org-vm hides /usr/share/emacs/23.2/lisp/org/org-vm
/usr/share/emacs23/site-lisp/org-mode/org-agenda hides /usr/share/emacs/23.2/lisp/org/org-agenda
/usr/share/emacs23/site-lisp/org-mode/org-irc hides /usr/share/emacs/23.2/lisp/org/org-irc
/usr/share/emacs23/site-lisp/org-mode/org-mobile hides /usr/share/emacs/23.2/lisp/org/org-mobile
/usr/share/emacs23/site-lisp/org-mode/org-jsinfo hides /usr/share/emacs/23.2/lisp/org/org-jsinfo
/usr/share/emacs23/site-lisp/org-mode/org-docbook hides /usr/share/emacs/23.2/lisp/org/org-docbook
/usr/share/emacs23/site-lisp/org-mode/org-icalendar hides /usr/share/emacs/23.2/lisp/org/org-icalendar
/usr/share/emacs23/site-lisp/org-mode/org-html hides /usr/share/emacs/23.2/lisp/org/org-html
/usr/share/emacs23/site-lisp/org-mode/org-macs hides /usr/share/emacs/23.2/lisp/org/org-macs
/usr/share/emacs23/site-lisp/org-mode/org-list hides /usr/share/emacs/23.2/lisp/org/org-list
/usr/share/emacs23/site-lisp/org-mode/org-publish hides /usr/share/emacs/23.2/lisp/org/org-publish
/usr/share/emacs23/site-lisp/org-mode/org-compat hides /usr/share/emacs/23.2/lisp/org/org-compat
/usr/share/emacs23/site-lisp/org-mode/org-exp hides /usr/share/emacs/23.2/lisp/org/org-exp
/usr/share/emacs23/site-lisp/org-mode/org-info hides /usr/share/emacs/23.2/lisp/org/org-info
/usr/share/emacs23/site-lisp/org-mode/org-rmail hides /usr/share/emacs/23.2/lisp/org/org-rmail
/usr/share/emacs23/site-lisp/org-mode/org-ascii hides /usr/share/emacs/23.2/lisp/org/org-ascii
/usr/share/emacs23/site-lisp/org-mode/org-id hides /usr/share/emacs/23.2/lisp/org/org-id
/usr/share/emacs23/site-lisp/org-mode/org-src hides /usr/share/emacs/23.2/lisp/org/org-src
/usr/share/emacs23/site-lisp/org-mode/org-mew hides /usr/share/emacs/23.2/lisp/org/org-mew
/usr/share/emacs23/site-lisp/org-mode/org-protocol hides /usr/share/emacs/23.2/lisp/org/org-protocol
/usr/share/emacs23/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.2/lisp/net/sasl-ntlm
/usr/share/emacs23/site-lisp/flim/hmac-def hides /usr/share/emacs/23.2/lisp/net/hmac-def
/usr/share/emacs23/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.2/lisp/net/sasl-cram
/usr/share/emacs23/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.2/lisp/net/hmac-md5
/usr/share/emacs23/site-lisp/flim/sasl hides /usr/share/emacs/23.2/lisp/net/sasl
/usr/share/emacs23/site-lisp/flim/ntlm hides /usr/share/emacs/23.2/lisp/net/ntlm
/usr/share/emacs23/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.2/lisp/net/sasl-digest

Features:
(shadow emacsbug find-func magit log-edit pcvs-util add-log pcmpl-unix
ansi-color em-unix em-term term disp-table ehelp em-script em-prompt
em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic esh-opt em-banner
em-alias esh-var esh-io esh-cmd esh-ext esh-proc esh-arg eldoc
esh-groups eshell esh-module esh-mode esh-util bookmark pp recentf
tree-widget tramp-imap tramp-gw tramp-gvfs zeroconf url-parse url-vars
dbus xml tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp
tramp-compat trampver org-attach multi-isearch w3m-tabmenu auth-source
starttls mailalias gnus-msg gnus-art mm-uu mml2015 epg-config gnus-sum
nnoo gnus-group gnus-undo nnmail mail-source format-spec gnus-start
gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems quail help-mode
view sort mail-extr goto-addr w3m-form w3m-symbol mule-util hl-line info
doc-view image-mode jka-compr tar-mode tex-mode org-indent org-wl
org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs
org-html org-exp ob-exp org-exp-blocks org-info org-gnus org-docview
org-bibtex org-bbdb make-mode js etags imenu newcomment cc-mode cc-fonts
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vc-git
caml tuareg speedbar sb-image ezimage dframe assoc caml-help caml-types
caml-emacs anything-grep grep anything-config compile w3m-bookmark w3m
browse-url timezone w3m-hist w3m-e23 w3m-ccl ccl w3m-fsf w3m-favicon
w3m-image w3m-proc w3m-util rx ffap thingatpt anything-match-plugin
anything magit-autoloads package reporter smtpmail notmuch
notmuch-message notmuch-maildir-fcc notmuch-hello notmuch-show
notmuch-crypto notmuch-mua notmuch-address notmuch-wash diff-mode coolj
notmuch-query json icalendar notmuch-lib message sendmail ecomplete
rfc822 mml mml-sec mailabbrev nnheader gmm-utils wid-edit mailheader
canlock sha1 sha1-el hex-util hashcash mail-utils mm-view smime
password-cache dig mm-decode gnus-util netrc mm-bodies mm-encode mailcap
mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mm-util mail-prsvr
org-velocity cl cl-19 dabbrev electric ob-latex ob-sh shell org-notmuch
org-id edmacro kmacro org-habit org-agenda org byte-opt bytecomp
byte-compile ob-emacs-lisp ob-ref ob-lob ob-table org-footnote
org-complete pcomplete org-list org-faces org-entities noutline outline
cal-menu easymenu calendar cal-loaddefs uniquify advice help-fns
advice-preload ido dired-x dired-aux dired regexp-opt desktop time-date
ob-tangle org-src ob-comint comint ring ob-keys org-compat ob org-macs
ob-eval w3m-load org-install emacs-goodies-el emacs-goodies-custom
emacs-goodies-loaddefs easy-mmode tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly
  2011-10-13 23:47 bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly Matthieu Lemerre
@ 2011-10-14 17:41 ` Andreas Schwab
  2011-10-15  8:34   ` Matthieu Lemerre
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2011-10-14 17:41 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: 9749

Try setting compilation-error-screen-columns to nil.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly
  2011-10-14 17:41 ` Andreas Schwab
@ 2011-10-15  8:34   ` Matthieu Lemerre
  2011-10-17 18:59     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Lemerre @ 2011-10-15  8:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 9749


I should have thought there would be an option for this; this solves the
problem. Thank you.

I have encountered at least two compilers which display character
positions instead of screen columns: gcc, and the ocaml compiler (the
latter also needs compilation-first-column to be set to 0). Given that
GCC is widely used and now display character positions of errors,
shouldn't the default value for compilation-error-screen-columns change?
Or maybe these parameters should be detected according to the mode of
the file in which there is an error?

Best regards,
Matthieu Lemerre


On Fri, 14 Oct 2011 19:41:19 +0200, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Try setting compilation-error-screen-columns to nil.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly
  2011-10-15  8:34   ` Matthieu Lemerre
@ 2011-10-17 18:59     ` Stefan Monnier
  2011-11-09 14:04       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2011-10-17 18:59 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: Andreas Schwab, 9749

> Or maybe these parameters should be detected according to the mode of
> the file in which there is an error?

That's a good idea.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly
  2011-10-17 18:59     ` Stefan Monnier
@ 2011-11-09 14:04       ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2011-11-09 14:04 UTC (permalink / raw)
  To: 9749-done

>> Or maybe these parameters should be detected according to the mode of
>> the file in which there is an error?
> That's a good idea.

Done,


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-09 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 23:47 bug#9749: 23.2; Compile-mode detection of error locations accounts for tabs incorrectly Matthieu Lemerre
2011-10-14 17:41 ` Andreas Schwab
2011-10-15  8:34   ` Matthieu Lemerre
2011-10-17 18:59     ` Stefan Monnier
2011-11-09 14:04       ` Stefan Monnier

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