unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: jidanni@jidanni.org
To: 10258@debbugs.gnu.org
Subject: bug#10258: compilation-error-regexp-alist just assumes columns not characters
Date: Sat, 10 Dec 2011 04:18:12 +0800	[thread overview]
Message-ID: <8739ctzegr.fsf@jidanni.org> (raw)

Gentlemen, why does *compilation* say

  basex -b y=3 TaiwanAMFMSW.xq
  Stopped at line 57, column 29 in /home/jidanni/millerliu/xquery/TaiwanAMFMSW.xq:
  [XPST0003] Expecting "return", found "r".

But the cursor upon next-error ends up at

        case "TaiwanAMFMSW_by_band" retrun let $K:= "AM/FM/SW" return ()
                            ^      ^
                            A, not B       if those blanks at front were a TAB.

Well that is because on
   (describe-variable (quote compilation-error-regexp-alist))
there is nary a mention of what to do when the compiler making the
message is counting characters (TAB=1) and emacs is thinking it is
counting columns (TAB=8, etc.).

All we see is
  COLUMN can also be of the form (COLUMN . END-COLUMN) meaning a range of
  columns starting on LINE and ending on END-LINE, if that matched.

There is no way to communicate to emacs that this certain compiler does
not know how many columns a TAB equals in emacs, and is just reporting a
character count from the last newline.

So one is forced to untabify ones source files!

So it seems that compilation-error-regexp-alist needs an extra parameter
to tell if we are just counting characters or actually counting columns.

P.S., guess what happens when there are wide characters involved,

        case "補補補TaiwanAMFMSW_by_band" retrun let $K:= "AM/FM/SW" return ()

you guessed it!

How can I tell emacs in
   (add-to-list 'compilation-error-regexp-alist-alist
   '(basex "^Stopped at line \\([0-9]+\\), column \\([0-9]+\\) in \\(.*?\\):$" 3 1 2))
     (add-to-list 'compilation-error-regexp-alist 'basex)
that "column" means "char"?





             reply	other threads:[~2011-12-09 20:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 20:18 jidanni [this message]
2011-12-12 16:28 ` bug#10258: compilation-error-regexp-alist just assumes columns not characters Stefan Monnier
2011-12-14 14:09 ` jidanni
2011-12-16  0:06   ` Stefan Monnier
2011-12-21 23:59 ` jidanni
2011-12-27 23:49   ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8739ctzegr.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=10258@debbugs.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 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).