From 9e58ff96ed961794534f0278d1251ccfe59fd185 Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 18 Apr 2012 07:41:37 +0300 Subject: [PATCH] * mu4e-view.el: make the open-in-emacs attachment temp files read-only --- emacs/mu4e-view.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs/mu4e-view.el b/emacs/mu4e-view.el index 6d8f8ce3..353e9976 100644 --- a/emacs/mu4e-view.el +++ b/emacs/mu4e-view.el @@ -700,7 +700,11 @@ attachments) in response to a (mu4e-proc-extract 'temp ... )." (call-process-shell-command param path t t) (view-mode))) ((string= what "emacs") - (find-file path)) + (find-file path) + ;; make the buffer read-only since it usually does not make + ;; sense to edit the temp buffer; use C-x C-q if you insist... + (setq buffer-read-only t) + ) (t (error "Unsupported action %S" what)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;