emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mode-require-final-newline


From: Luc Teirlinck
Subject: mode-require-final-newline
Date: Wed, 30 Mar 2005 19:21:16 -0600 (CST)

This is about something I already reported on March 5, but the bug is
still present.  Custom does not allow you to set the value of
`mode-require-final-newline' to nil and if you set it to nil outside
Custom, then Custom falsely claims that the value is 'ask.  The patch
below fixes these problems.  Note also that the current first line of
the docstring is too long.  It not only looks bad in apropos, it also
looks bad in the Custom buffer.  The patch below shortens it.

I can install if desired.

Note that a value of nil for `mode-require-final-newline' makes a lot
of sense and there is no reason to discourage people from setting it
to nil.  I personally have it set to nil.  While working on a file,
a final newline signifies to me that the last paragraph or function is
finished.  Who cares whether a standard specifies that a file should
end in a newline?  Standards only apply to the final file, not to work
in progress.  If one occasionally forgets the final newline when the
file is finished, then that is no disaster at all: if the compiler
does not like it, he will tell so.

===File ~/files.el-diff-2===================================
*** files.el    28 Mar 2005 15:33:36 -0600      1.753
--- files.el    30 Mar 2005 18:43:21 -0600      
***************
*** 291,297 ****
    :group 'editing-basics)
  
  (defcustom mode-require-final-newline t
!   "*Whether to add a newline at the end of the file, in certain major modes.
  Those modes set `require-final-newline' to this value when you enable them.
  They do so because they are used for files that are supposed
  to end in newlines, and the question is how to arrange that.
--- 291,297 ----
    :group 'editing-basics)
  
  (defcustom mode-require-final-newline t
!   "*Whether to add a newline at end of file, in certain major modes.
  Those modes set `require-final-newline' to this value when you enable them.
  They do so because they are used for files that are supposed
  to end in newlines, and the question is how to arrange that.
***************
*** 303,308 ****
--- 303,309 ----
    :type '(choice (const :tag "When visiting" visit)
                 (const :tag "When saving" t)
                 (const :tag "When visiting or saving" visit-save)
+                (const :tag "Never" nil)
                 (other :tag "Ask" ask))
    :group 'editing-basics
    :version "22.1")
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]