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: Mon, 02 Apr 2012 23:52:11 +0200 Message-ID: <20120402215210.3718F201C8@saturn.ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1333403574 9178 80.91.229.3 (2 Apr 2012 21:52:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2012 21:52:54 +0000 (UTC) To: 11156@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 02 23:52:52 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 1SEpBD-0000cC-ON for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2012 23:52:51 +0200 Original-Received: from localhost ([::1]:53243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpBD-0004sj-24 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2012 17:52:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpB8-0004sT-Cu for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEpB6-0003tL-Hh for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:45 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpB6-0003tH-Bn for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SEpBN-0003qe-TW for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:53:01 -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: Mon, 02 Apr 2012 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 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.133340356114762 (code B ref -1); Mon, 02 Apr 2012 21:53:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Apr 2012 21:52:41 +0000 Original-Received: from localhost ([127.0.0.1]:37047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEpB3-0003q3-9o for submit@debbugs.gnu.org; Mon, 02 Apr 2012 17:52:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60548) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEpB0-0003pu-Ss for submit@debbugs.gnu.org; Mon, 02 Apr 2012 17:52:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEpAh-0003k5-3L for submit@debbugs.gnu.org; Mon, 02 Apr 2012 17:52:20 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:48869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpAg-0003k1-Tm for submit@debbugs.gnu.org; Mon, 02 Apr 2012 17:52:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpAf-0004pw-6d for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEpAd-0003hf-8d for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:16 -0400 Original-Received: from ristopher.com ([146.185.21.93]:46271 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEpAc-0003fg-Qd for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2012 17:52:15 -0400 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id 3718F201C8; Mon, 2 Apr 2012 22:52:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1333403530; bh=ZFUhFF9l5irny0ckOlPiqjc2iHqJz3NCF3YCWyhKFvo=; h=From:To:Subject:Date:MIME-Version:Content-Type:Message-Id; b=vYlaHVU12dMwp1QMVMl9J4k1vgWfMszTFea8sv1F4KilxBQBeSX1GC2462Yb2+Rei Jw4/YfL+oyFvgQXu/JoGbAXEW/bfYbKSWbFTE0k/XU2l0O5Wu3MB/m4WhZK48P0Nw2 NaMJo7IT9eYdcvR9FjEEV/G5oWR54ieeYT2EyOyk= 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:58472 Archived-At: --=-=-= Content-Type: text/plain Hi, I think I hit on a bug in GNU Emacs 24.0.95.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-04-02. Recipe: cd /tmp echo -n rms > rms chmod u=r rms emacs -q eval: (setq require-final-newline 'visit) C-x C-f /tmp/rms RET There is a new buffer but no window displays it. The *Messages*-buffer contains `find-file-noselect-1: Buffer is read-only: #' Emacs tries to add a newline to the (read-only) buffer. Here's a quick fix: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=patch.diff === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-02 16:32:06 +0000 +++ lisp/ChangeLog 2012-04-02 21:28:06 +0000 @@ -1,3 +1,8 @@ +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-01 02:44:24 +0000 +++ lisp/files.el 2012-04-02 21:45:36 +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 --=-=-=--