Gnus development mailing list
 help / color / mirror / Atom feed
* Set temp files (viewing attachments) read-only?
@ 2008-04-05 17:37 Reiner Steib
  2008-04-07  3:50 ` Daniel Pittman
  2008-04-08 16:22 ` Magnus Henoch
  0 siblings, 2 replies; 6+ messages in thread
From: Reiner Steib @ 2008-04-05 17:37 UTC (permalink / raw)
  To: ding

Hi,

when a user views an attachment, modifies and saves it with the helper
application (say OpenOffice), after quitting the helper application
Gnus deletes the temp file.  I.e. all modifications made by the user
are lost. (Similar to Mozilla: [1])

Setting the temp file read-only[2] should make it clear, that editing
it might be a bad idea.  It also forces the user to choose a different
file name or location when saving.  What do you think?

--8<---------------cut here---------------start------------->8---
--- mm-decode.el	02 Mar 2008 18:05:57 +0100	7.64
+++ mm-decode.el	05 Apr 2008 13:31:01 +0200	
@@ -815,6 +815,10 @@
 					    nil suffix))))
 	  (let ((coding-system-for-write mm-binary-coding-system))
 	    (write-region (point-min) (point-max) file nil 'nomesg))
+	  ;; The file is deleted after the viewer exists.  If the users edits
+	  ;; the file, changes will be lost.  Set file to read-only to make it
+	  ;; clear.
+	  (set-file-modes file (string-to-number "400" 8))
 	  (message "Viewing with %s" method)
 	  (cond
 	   (needsterm
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.

[1] This is currently discussed in a German-language Mozilla newsgroup:
    <news12f4e$47f4f7ee$3e63fcfd$26586@news.inode.at> ff
    <https://bugzilla.mozilla.org/show_bug.cgi?id=191239#c0>
[2] <https://bugzilla.mozilla.org/show_bug.cgi?id=191239#c13>
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

end of thread, other threads:[~2008-04-13 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-05 17:37 Set temp files (viewing attachments) read-only? Reiner Steib
2008-04-07  3:50 ` Daniel Pittman
2008-04-07  4:19   ` Katsumi Yamaoka
2008-04-13 20:39     ` Reiner Steib
2008-04-08 16:22 ` Magnus Henoch
2008-04-08 17:05   ` Reiner Steib

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 NNTP newsgroup(s).