unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15938: diff-mode mishandles diff-default-read-only
@ 2013-11-20 19:47 Ivan Shmakov
  2013-11-23  2:57 ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Shmakov @ 2013-11-20 19:47 UTC (permalink / raw)
  To: 15938

	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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-23 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 19:47 bug#15938: diff-mode mishandles diff-default-read-only Ivan Shmakov
2013-11-23  2:57 ` Glenn Morris
2013-11-23  8:14   ` Ivan Shmakov
2013-11-23 18:54     ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).