From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.bugs Subject: bug#11156: 24.0.95; require-final-newline and read-only files Date: Sun, 15 Apr 2012 15:48:24 +0200 Message-ID: <20120415134821.0001E20235@saturn.ch.ristopher.com> References: <20120402215210.3718F201C8@saturn.ch.ristopher.com> <20120414134925.D1D9B20217@saturn.ch.ristopher.com> <4F89C879.6070209@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1334504559 18653 80.91.229.3 (15 Apr 2012 15:42:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2012 15:42:39 +0000 (UTC) To: 11156@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 15 17:42:39 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SJRb4-0006ac-PK for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Apr 2012 17:42:39 +0200 Original-Received: from localhost ([::1]:34480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJRb3-0001kj-Rl for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Apr 2012 11:42:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJRb0-0001ja-AE for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 11:42:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJRay-0001Px-Gj for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 11:42:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJRay-0001Pr-B5 for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 11:42:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SJRcP-0003KZ-SJ for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 11:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Schmidt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Apr 2012 15:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133450460412656 (code B ref -1); Sun, 15 Apr 2012 15:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Apr 2012 15:43:24 +0000 Original-Received: from localhost ([127.0.0.1]:59751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJRbn-0003I4-RM for submit@debbugs.gnu.org; Sun, 15 Apr 2012 11:43:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52007) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJRbl-0003Hp-AZ for submit@debbugs.gnu.org; Sun, 15 Apr 2012 11:43:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJRaH-0001LG-Be for submit@debbugs.gnu.org; Sun, 15 Apr 2012 11:41:50 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:58020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJRaG-0001LA-V9 for submit@debbugs.gnu.org; Sun, 15 Apr 2012 11:41:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJPoZ-0002ck-If for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 09:48:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJPoX-0000SH-Bu for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 09:48:26 -0400 Original-Received: from ristopher.com ([146.185.21.93]:49000 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJPoW-0000S4-RQ for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2012 09:48:25 -0400 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id 0001E20235; Sun, 15 Apr 2012 14:48:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1334497701; bh=N9hB9N5hwiD1z5MUjMyNHq+5s9hkHVWnjB7LOhaqYHA=; h=From:To:Subject:In-Reply-To:References:Date:MIME-Version: Content-Type:Message-Id; b=blAoLqwKQargTI1vyQoCFz8lb8VkY228lLY8edjVnY7gSB6E/5aaGZVLxEBmfyaWY GzqD8UuFToC7xeeNQnAcIz+xMWqj0x3xL4VHBU9J4yBHiNW25Q1w/XGQFwfFm4LF2T sFQDYtpDmCPFXosIkvRkHDNCccNy+c5fnK01ISqI= In-Reply-To: <4F89C879.6070209@gmx.at> (martin rudalics's message of "Sat, 14 Apr 2012 20:56:57 +0200") Mail-Followup-To: bug-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59089 Archived-At: --=-=-= Content-Type: text/plain martin rudalics writes: > `after-find-file' shouldn't try adding a newline if `buffer-read-only' > is non-nil. And the values 'visit and 'visit-save should be > documented in the Elisp manual. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=require-final-newline.diff === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-04-15 07:28:01 +0000 +++ doc/lispref/ChangeLog 2012-04-15 13:37:35 +0000 @@ -1,3 +1,8 @@ +2012-04-15 Christopher Schmidt + + * files.texi (Saving Buffers): Document the values visit and + visit-save for require-final-newline. + 2012-04-15 Glenn Morris * processes.texi (Processes, Subprocess Creation, Shell Arguments): === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2012-04-14 01:59:01 +0000 +++ doc/lispref/files.texi 2012-04-15 13:47:26 +0000 @@ -489,11 +489,13 @@ @defopt require-final-newline This variable determines whether files may be written out that do @emph{not} end with a newline. If the value of the variable is -@code{t}, then @code{save-buffer} silently adds a newline at the end of -the file whenever the buffer being saved does not already end in one. -If the value of the variable is non-@code{nil}, but not @code{t}, then -@code{save-buffer} asks the user whether to add a newline each time the -case arises. +@code{t}, then @code{save-buffer} silently adds a newline at the end +of the buffer whenever it does not already end in one. If the value +is @code{visit}, a newline is added at the end of buffer that doesn't +have one, just after the file is visited. If the value is +@code{visit-save}, a newline is added both on visiting and on saving. +For every other non-@code{nil} value, @code{save-buffer} asks the user +whether to add a newline each time the case arises. If the value of the variable is @code{nil}, then @code{save-buffer} doesn't add newlines at all. @code{nil} is the default value, but a few === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-15 09:16:50 +0000 +++ lisp/ChangeLog 2012-04-15 13:17:00 +0000 @@ -445,6 +445,11 @@ * notifications.el (notifications-notify): Fix docstring. +2012-04-02 Christopher Schmidt + + * files.el (after-find-file): Do not add a newline at the end when + buffer is read-only. + 2012-04-02 Glenn Morris * emacs-lisp/authors.el (authors-aliases): Another addition. === modified file 'lisp/files.el' --- lisp/files.el 2012-04-14 01:46:06 +0000 +++ lisp/files.el 2012-04-15 13:15:13 +0000 @@ -2152,6 +2152,7 @@ (/= (char-after (1- (point-max))) ?\n) (not (and (eq selective-display t) (= (char-after (1- (point-max))) ?\r))) + (not buffer-read-only) (save-excursion (goto-char (point-max)) (insert "\n"))) --=-=-= Content-Type: text/plain Christopher --=-=-=--