GNU bug report logs - #15938
diff-mode mishandles diff-default-read-only

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Wed, 20 Nov 2013 20:20:02 UTC

Severity: minor

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Glenn Morris <rgm <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#15938: closed (diff-mode mishandles diff-default-read-only )
Date: Sat, 23 Nov 2013 02:58:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 22 Nov 2013 21:57:03 -0500
with message-id <sb61rjq0zk.fsf <at> fencepost.gnu.org>
and subject line Re: bug#15938: diff-mode mishandles diff-default-read-only
has caused the debbugs.gnu.org bug report #15938,
regarding diff-mode mishandles diff-default-read-only 
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
15938: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15938
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ivan Shmakov <ivan <at> siamics.net>
To: bug-gnu-emacs <at> gnu.org
Subject: diff-mode mishandles diff-default-read-only 
Date: Wed, 20 Nov 2013 19:47:29 +0000
	In addition to making the -*- Diff -*- buffers read-only when
	diff-default-read-only is non-nil, diff-mode also makes such
	buffers /writable/ when diff-default-read-only is nil, while per
	the documentation, I’d expect for diff-mode to have no effect on
	buffer-read-only in this latter case.

	Please consider the patch below, which seems to fix the issue.

--- diff-mode.el.~1~
+++ diff-mode.el	2013-11-20 19:42:41.000000000 +0000
@@ -1366,7 +1366,8 @@ (define-derived-mode diff-mode fundamental-mode "Diff"
 
   (diff-setup-whitespace)
 
-  (setq buffer-read-only diff-default-read-only)
+  (when diff-default-read-only
+    (setq buffer-read-only t))
   ;; setup change hooks
   (if (not diff-update-on-the-fly)
       (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t)

-- 
FSF associate member #7257


[Message part 3 (message/rfc822, inline)]
From: Glenn Morris <rgm <at> gnu.org>
To: 15938-done <at> debbugs.gnu.org
Subject: Re: bug#15938: diff-mode mishandles diff-default-read-only
Date: Fri, 22 Nov 2013 21:57:03 -0500
Version: 24.4

Thanks; applied.

(BTW, we'd probably need a copyright assignment to accept anything more
than 2-3 lines more from you in future. So maybe think about starting
that process if you expect to contribute more.)


This bug report was last modified 11 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.