all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to make emacs *not* add a newline at the end of the file?
@ 2008-12-31 17:56 Juha Nieminen
  2008-12-31 19:14 ` Charles Sebold
  2008-12-31 19:46 ` Teemu Likonen
  0 siblings, 2 replies; 7+ messages in thread
From: Juha Nieminen @ 2008-12-31 17:56 UTC (permalink / raw)
  To: help-gnu-emacs

  From some version forward emacs has been automatically adding a
newline at the end of the file if there wasn't one when saving the file.

  I don't need this feature, and in a few cases it actually hinders me
(ie. in the few cases where I *really* don't want that newline as the
last character of the file). I have always liked emacs because it
doesn't add any extraneous characters which I haven't specifically told
it to add, like so many other text editors do, which gives me much more
precise control over the contents of the file. This new feature is
consequently a bit annoying.

  How can the feature be turned off?

  Another related question: Is there an easy way of making emacs
visually show the end of the file? (Some other text editors have such a
feature, eg. by showing a special symbol after the last character in the
file, and it would be useful.)


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

* Re: How to make emacs *not* add a newline at the end of the file?
  2008-12-31 17:56 How to make emacs *not* add a newline at the end of the file? Juha Nieminen
@ 2008-12-31 19:14 ` Charles Sebold
  2008-12-31 20:27   ` Allan Gottlieb
  2008-12-31 23:11   ` Juha Nieminen
  2008-12-31 19:46 ` Teemu Likonen
  1 sibling, 2 replies; 7+ messages in thread
From: Charles Sebold @ 2008-12-31 19:14 UTC (permalink / raw)
  To: help-gnu-emacs

On 31 Dec 2008, Juha Nieminen wrote:

> I don't need this feature, and in a few cases it actually hinders me
> (ie. in the few cases where I *really* don't want that newline as the
> last character of the file). I have always liked emacs because it
> doesn't add any extraneous characters which I haven't specifically
> told it to add, like so many other text editors do, which gives me
> much more precise control over the contents of the file. This new
> feature is consequently a bit annoying.
>
> How can the feature be turned off?

M-x customize-variable RET require-final-newline RET

Also see the value of the variable mode-require-final-newline.

(info "(emacs)Customize Save") has the scoop.

C-h i < m emacs RET m customize save RET

> Another related question: Is there an easy way of making emacs
> visually show the end of the file? (Some other text editors have such
> a feature, eg. by showing a special symbol after the last character in
> the file, and it would be useful.)

This I don't know off the top of my head.
-- 
Charles Sebold                                    31st of December, 2008
GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) | Gnus v5.11 | org-mode 6.16trans
 


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

* Re: How to make emacs *not* add a newline at the end of the file?
  2008-12-31 17:56 How to make emacs *not* add a newline at the end of the file? Juha Nieminen
  2008-12-31 19:14 ` Charles Sebold
@ 2008-12-31 19:46 ` Teemu Likonen
  1 sibling, 0 replies; 7+ messages in thread
From: Teemu Likonen @ 2008-12-31 19:46 UTC (permalink / raw)
  To: help-gnu-emacs

Juha Nieminen (2008-12-31 17:56 +0000) wrote:

>   Another related question: Is there an easy way of making emacs
> visually show the end of the file? (Some other text editors have such
> a feature, eg. by showing a special symbol after the last character in
> the file, and it would be useful.)

There is an option for showing the first and the last line:

    M-x customize-option RET indicate-buffer-boundaries RET

But I don't know about showing the last character. I guess
whitespace-mode would be too noisy for that.


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

* Re: How to make emacs *not* add a newline at the end of the file?
  2008-12-31 19:14 ` Charles Sebold
@ 2008-12-31 20:27   ` Allan Gottlieb
  2008-12-31 23:11   ` Juha Nieminen
  1 sibling, 0 replies; 7+ messages in thread
From: Allan Gottlieb @ 2008-12-31 20:27 UTC (permalink / raw)
  To: help-gnu-emacs

At Wed, 31 Dec 2008 13:14:01 -0600 Charles Sebold <csebold@gmail.com> wrote:

> On 31 Dec 2008, Juha Nieminen wrote:
>
>> Another related question: Is there an easy way of making emacs
>> visually show the end of the file? (Some other text editors have such
>> a feature, eg. by showing a special symbol after the last character in
>> the file, and it would be useful.)
>
> This I don't know off the top of my head.

It already does when running under X windows.  See the "fringes" info
node in the emacs manual.

allan




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

* Re: How to make emacs *not* add a newline at the end of the file?
  2008-12-31 19:14 ` Charles Sebold
  2008-12-31 20:27   ` Allan Gottlieb
@ 2008-12-31 23:11   ` Juha Nieminen
  2009-01-02  4:08     ` Kevin Rodgers
       [not found]     ` <mailman.3738.1230869315.26697.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 7+ messages in thread
From: Juha Nieminen @ 2008-12-31 23:11 UTC (permalink / raw)
  To: help-gnu-emacs

Charles Sebold wrote:
> Also see the value of the variable mode-require-final-newline.

  That did what I wanted. Thanks.


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

* Re: How to make emacs *not* add a newline at the end of the file?
  2008-12-31 23:11   ` Juha Nieminen
@ 2009-01-02  4:08     ` Kevin Rodgers
       [not found]     ` <mailman.3738.1230869315.26697.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2009-01-02  4:08 UTC (permalink / raw)
  To: help-gnu-emacs

Juha Nieminen wrote:
> Charles Sebold wrote:
>> Also see the value of the variable mode-require-final-newline.
> 
>   That did what I wanted. Thanks.

Just curious: What modes set require-final-newline, and how does that
hinder you?

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: How to make emacs *not* add a newline at the end of the file?
       [not found]     ` <mailman.3738.1230869315.26697.help-gnu-emacs@gnu.org>
@ 2009-01-03 11:41       ` Juha Nieminen
  0 siblings, 0 replies; 7+ messages in thread
From: Juha Nieminen @ 2009-01-03 11:41 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Rodgers wrote:
> Juha Nieminen wrote:
>> Charles Sebold wrote:
>>> Also see the value of the variable mode-require-final-newline.
>>
>>   That did what I wanted. Thanks.
> 
> Just curious: What modes set require-final-newline, and how does that
> hinder you?

  From what I tested, at least editing .txt, .c and .cc files did that.

  It hinders me in the few cases where I really *don't* want that
newline at the end. I have always liked emacs exactly because it doesn't
add (or remove) *anything* I don't explicitly instruct it to, no matter
which file I edit. This seems to be more an exception than a rule with
text editors (especially in Windows). I don't need the text editor to
"think for me" in this case.


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

end of thread, other threads:[~2009-01-03 11:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31 17:56 How to make emacs *not* add a newline at the end of the file? Juha Nieminen
2008-12-31 19:14 ` Charles Sebold
2008-12-31 20:27   ` Allan Gottlieb
2008-12-31 23:11   ` Juha Nieminen
2009-01-02  4:08     ` Kevin Rodgers
     [not found]     ` <mailman.3738.1230869315.26697.help-gnu-emacs@gnu.org>
2009-01-03 11:41       ` Juha Nieminen
2008-12-31 19:46 ` Teemu Likonen

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.