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

* Re: Set temp files (viewing attachments) read-only?
  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-08 16:22 ` Magnus Henoch
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Pittman @ 2008-04-07  3:50 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> 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?

I think that this would be a good idea.

Regards,
        Daniel




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

* Re: Set temp files (viewing attachments) read-only?
  2008-04-07  3:50 ` Daniel Pittman
@ 2008-04-07  4:19   ` Katsumi Yamaoka
  2008-04-13 20:39     ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-04-07  4:19 UTC (permalink / raw)
  To: ding

>>>>> Daniel Pittman wrote:
> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> 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?

> I think that this would be a good idea.

I think that's good, too.

BTW, do you know that performing `gnus-mime-copy-part' on the pdf
part automatically launches the `doc-view-mode'?  I.e., the pdf
file is viewed in an Emacs buffer.  I think it would also be nice
if the `doc-view-mode' supports not only pdf/ps/dvi files but also
the types that OpenOffice supports. ;-)

Regards,



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

* Re: Set temp files (viewing attachments) read-only?
  2008-04-05 17:37 Set temp files (viewing attachments) read-only? Reiner Steib
  2008-04-07  3:50 ` Daniel Pittman
@ 2008-04-08 16:22 ` Magnus Henoch
  2008-04-08 17:05   ` Reiner Steib
  1 sibling, 1 reply; 6+ messages in thread
From: Magnus Henoch @ 2008-04-08 16:22 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> +	  (set-file-modes file (string-to-number "400" 8))

I propose #o400 instead of string-to-number :)

Magnus




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

* Re: Set temp files (viewing attachments) read-only?
  2008-04-08 16:22 ` Magnus Henoch
@ 2008-04-08 17:05   ` Reiner Steib
  0 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2008-04-08 17:05 UTC (permalink / raw)
  To: ding

On Tue, Apr 08 2008, Magnus Henoch wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>> +	  (set-file-modes file (string-to-number "400" 8))
>
> I propose #o400 instead of string-to-number :)

I seem to recall the Emacs 21 (and maybe XEmacs?) don't support that.
I didn't test it, though.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Set temp files (viewing attachments) read-only?
  2008-04-07  4:19   ` Katsumi Yamaoka
@ 2008-04-13 20:39     ` Reiner Steib
  0 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2008-04-13 20:39 UTC (permalink / raw)
  To: ding

On Mon, Apr 07 2008, Katsumi Yamaoka wrote:

>>>>>> Daniel Pittman wrote:
>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>>> 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?
>
>> I think that this would be a good idea.
>
> I think that's good, too.

Installed.

Bye, Reiner.
-- 
       ,,,
      (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).