From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: mode-require-final-newline Date: Wed, 30 Mar 2005 19:21:16 -0600 (CST) Message-ID: <200503310121.j2V1LGX06840@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1112233153 7345 80.91.229.2 (31 Mar 2005 01:39:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2005 01:39:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 31 03:39:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DGoeI-0006Y8-Pj for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2005 03:39:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGout-0008B3-WF for ged-emacs-devel@m.gmane.org; Wed, 30 Mar 2005 20:56:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DGotU-00078i-I7 for emacs-devel@gnu.org; Wed, 30 Mar 2005 20:54:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DGotP-00074U-0X for emacs-devel@gnu.org; Wed, 30 Mar 2005 20:54:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGotN-00071x-CI for emacs-devel@gnu.org; Wed, 30 Mar 2005 20:54:41 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DGoO8-00021k-9W for emacs-devel@gnu.org; Wed, 30 Mar 2005 20:22:24 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j2V1MH9N021213 for ; Wed, 30 Mar 2005 19:22:18 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j2V1LGX06840; Wed, 30 Mar 2005 19:21:16 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35395 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35395 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") ============================================================