changeset 39323:b5dd113d61d1

(diff-mode): Don't make the buffer read-only if it's empty (and thus probably a new patch file about to be edited).
author Miles Bader <miles@gnu.org>
date Tue, 18 Sep 2001 01:19:51 +0000
parents 06ab5586085a
children 65a3980d9aa3
files lisp/diff-mode.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/diff-mode.el	Tue Sep 18 01:04:37 2001 +0000
+++ b/lisp/diff-mode.el	Tue Sep 18 01:19:51 2001 +0000
@@ -1,6 +1,6 @@
 ;;; diff-mode.el --- A mode for viewing/editing context diffs
 
-;; Copyright (C) 1998, 1999, 2000  Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: patch diff
@@ -893,7 +893,8 @@
   ;; (compilation-shell-minor-mode 1)
 
   ;; setup change hooks
-  (toggle-read-only t)
+  (unless (and (bobp) (eobp))
+    (toggle-read-only t))
   (if (not diff-update-on-the-fly)
       (add-hook 'write-contents-hooks 'diff-write-contents-hooks)
     (make-local-variable 'diff-unhandled-changes)