unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Is emacs wrong? - EOF is allowed without EOL
@ 2005-11-28  8:41 Brian Elmegaard
  2005-11-28  9:01 ` Björn Lindström
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Brian Elmegaard @ 2005-11-28  8:41 UTC (permalink / raw)


Hi

I am using a program compiled with the g77 fortran compiler to read
files. I discovered that g77 does not read the last line of a file if
it is not terminated by the EOL-character(s). 

Some posters in the mingw mailing list finds it to be a problem that
an editor allows this. Is is so? And, moreover, can I have a setting
in an emacs mode that forces a line break before end of file?
-- 
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk

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

* Re: Is emacs wrong? - EOF is allowed without EOL
  2005-11-28  8:41 Is emacs wrong? - EOF is allowed without EOL Brian Elmegaard
@ 2005-11-28  9:01 ` Björn Lindström
  2005-11-28  9:08 ` Henrik Enberg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Björn Lindström @ 2005-11-28  9:01 UTC (permalink / raw)


Brian Elmegaard <brian@rkspeed-rugby.dk> writes:

> And, moreover, can I have a setting in an emacs mode that forces a
> line break before end of file?

Setting the variable require-final-newline to the appropriate value
should do it.

I like

(setq require-final-newline 'ask)

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

* Re: Is emacs wrong? - EOF is allowed without EOL
  2005-11-28  8:41 Is emacs wrong? - EOF is allowed without EOL Brian Elmegaard
  2005-11-28  9:01 ` Björn Lindström
@ 2005-11-28  9:08 ` Henrik Enberg
       [not found] ` <mailman.17031.1133168913.20277.help-gnu-emacs@gnu.org>
  2005-11-28  9:22 ` Glenn Morris
  3 siblings, 0 replies; 6+ messages in thread
From: Henrik Enberg @ 2005-11-28  9:08 UTC (permalink / raw)


> From: Brian Elmegaard <brian@rkspeed-rugby.dk>
> Date: 28 Nov 2005 09:41:21 +0100
> 
> can I have a setting in an emacs mode that forces a line break before
> end of file?

(setq require-final-newline t)

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

* Re: Is emacs wrong? - EOF is allowed without EOL
       [not found] ` <mailman.17031.1133168913.20277.help-gnu-emacs@gnu.org>
@ 2005-11-28  9:13   ` Brian Elmegaard
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Elmegaard @ 2005-11-28  9:13 UTC (permalink / raw)


Thanks for the prompt answers.

-- 
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk

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

* Re: Is emacs wrong? - EOF is allowed without EOL
  2005-11-28  8:41 Is emacs wrong? - EOF is allowed without EOL Brian Elmegaard
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.17031.1133168913.20277.help-gnu-emacs@gnu.org>
@ 2005-11-28  9:22 ` Glenn Morris
  2005-11-28  9:41   ` Brian Elmegaard
  3 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2005-11-28  9:22 UTC (permalink / raw)


Brian Elmegaard wrote:

> I discovered that g77 does not read the last line of a file if it is
> not terminated by the EOL-character(s).
>
> Some posters in the mingw mailing list finds it to be a problem that
> an editor allows this. Is is so? And, moreover, can I have a setting
> in an emacs mode that forces a line break before end of file?

Just for the record, Emacs does the correct thing in f90 and fortran
mode by default.

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

* Re: Is emacs wrong? - EOF is allowed without EOL
  2005-11-28  9:22 ` Glenn Morris
@ 2005-11-28  9:41   ` Brian Elmegaard
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Elmegaard @ 2005-11-28  9:41 UTC (permalink / raw)


Glenn Morris <gmorris+news@ast.cam.ac.uk> writes:

> Just for the record, Emacs does the correct thing in f90 and fortran
> mode by default.

I see. It is only for the mode I have written I didn't know that g77
programs did not read it as most other compilers, e.g., gfortran, g95.

-- 
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk

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

end of thread, other threads:[~2005-11-28  9:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28  8:41 Is emacs wrong? - EOF is allowed without EOL Brian Elmegaard
2005-11-28  9:01 ` Björn Lindström
2005-11-28  9:08 ` Henrik Enberg
     [not found] ` <mailman.17031.1133168913.20277.help-gnu-emacs@gnu.org>
2005-11-28  9:13   ` Brian Elmegaard
2005-11-28  9:22 ` Glenn Morris
2005-11-28  9:41   ` Brian Elmegaard

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