all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 15938@debbugs.gnu.org
Subject: bug#15938: diff-mode mishandles diff-default-read-only
Date: Wed, 20 Nov 2013 19:47:29 +0000	[thread overview]
Message-ID: <87vbzmomhg.fsf@violet.siamics.net> (raw)

	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





             reply	other threads:[~2013-11-20 19:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 19:47 Ivan Shmakov [this message]
2013-11-23  2:57 ` bug#15938: diff-mode mishandles diff-default-read-only Glenn Morris
2013-11-23  8:14   ` Ivan Shmakov
2013-11-23 18:54     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbzmomhg.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=15938@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.