From: Tom Tromey <tromey@redhat.com>
Cc: emacs-devel@gnu.org
Subject: Re: java line termination
Date: 29 Jan 2003 12:39:08 -0700 [thread overview]
Message-ID: <877kcnpwyr.fsf@fleche.redhat.com> (raw)
In-Reply-To: <E18dlq9-0000j0-00@fencepost.gnu.org>
>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:
rms> Why does GCJ follow the Java convention for the line number
rms> in its error messages? I see no reason to do that. Does it
rms> have anything to do with correct execution of the Java program?
rms> If this were changed, in what sense would that be a problem?
I think the gcj issue is a red herring. I'll try to respond anyway,
though, and come back to the other stuff.
Changing gcj here probably wouldn't affect correct execution of the
code. I can't think of a situation where it would. However, it would
cause us to fail some more tests in Jacks (Jacks is a free software
test suite for Java compilers). Though I suppose we could revert to
java-style line termination with `-pedantic'.
It would affect the bytecode generated by `gcj -g -C'. This means
that other java debuggers would display things incorrectly, stack
traces in java interpreters would have the wrong line numbers (at
least to users who aren't using Emacs), etc.
> I think in java-mode Emacs ought to respect Java's notion of line
> termination.
rms> That is probably impossible because the buffer contents have already
rms> been subject to EOL conversion. If you turn this off, Emacs will
rms> display \r as ^M, which will be rather annoying. Emacs has many
rms> line-counting features and you would have to change them all.
rms> It is not feasible.
What's going on here is that I have some files with inconsistent line
termination. Right now if I have a file with consistent \r\n
termination, Emacs will mark it as `DOS' and display things, count
line numbers, etc, in the way I would expect.
What if Emacs could recognize inconsistent termination and make it
consistent somehow? For instance it could mark every "weird"
terminator, convert the whole buffer to \n, and then revert each
terminator to its original state on saving. New terminators could
take whatever form is convenient; since the file is inconsistent to
start with this wouldn't matter.
Perhaps this transformation could only be applied to java files, or in
response to some flag setting.
I haven't used jdb yet; this is an instance of gud-mode that runs jdb
(a Java debugger) underneath. How does jdb deal with files like this?
What if the files were compiled with a non-gcj Java compiler? What
about using M-x next-error when the java code is not compiled by gcj?
Another failure mode is if we compile the bytecode output of some
other compiler with gcj; in this case we can't rewrite the line
numbers. In fact, it was this exact scenario where I first noticed
the problem.
Tom
next prev parent reply other threads:[~2003-01-29 19:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-28 18:30 java line termination Tom Tromey
2003-01-29 6:36 ` Richard Stallman
2003-01-29 19:39 ` Tom Tromey [this message]
2003-01-31 3:23 ` Richard Stallman
2003-01-31 3:33 ` Tom Tromey
2003-02-01 4:22 ` Richard Stallman
2003-02-03 1:14 ` Tom Tromey
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877kcnpwyr.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.