Gnus development mailing list
 help / color / mirror / Atom feed
* Re: PATCH: truncated dribble files
       [not found] <87iruztv4t.fsf@peder.flower>
@ 2005-11-11 13:23 ` Reiner Steib
  2005-11-11 13:41   ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2005-11-11 13:23 UTC (permalink / raw)
  Cc: Ding List, bugs

On Fri, Nov 11 2005, Jan Nieuwenhuizen wrote:

> +2005-11-11  Jan Nieuwenhuizen  <janneke@gnu.org>
> +
> +	* gnus-start.el (gnus-dribble-read-file): Set file-precious-p, as
> +	a buffer-local variable.  This avoids creating truncated dribble
> +	files as a result of a hang up, eg.
[...]

Shouldn't it read `file-precious-flag' instead of `file-precious-p'?
(At least current Emacs from CVS and Emacs 21.3 only have the former
variable.)

It it save to set this unconditionally by default despite of the
warnings in the doc string?

,----[ <f1> v file-precious-flag RET ]
| file-precious-flag is a variable defined in `files.el'.
| Its value is nil
| 
| Documentation:
| *Non-nil means protect against I/O errors while saving files.
| Some modes set this non-nil in particular buffers.
| 
| This feature works by writing the new contents into a temporary file
| and then renaming the temporary file to replace the original.
| In this way, any I/O error in writing leaves the original untouched,
| and there is never any instant where the file is nonexistent.
| 
| Note that this feature forces backups to be made by copying.
| Yet, at the same time, saving a precious file
| breaks any hard links between it and other files.
`----

Bye, Reiner.

[ Redirecting to ding@gnus ]
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: PATCH: truncated dribble files
  2005-11-11 13:23 ` PATCH: truncated dribble files Reiner Steib
@ 2005-11-11 13:41   ` Jan Nieuwenhuizen
  2005-11-12 19:28     ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2005-11-11 13:41 UTC (permalink / raw)


Reiner Steib writes:

> Shouldn't it read `file-precious-flag' instead of `file-precious-p'?

Yes it should.  Wow, how did I do that now?

> It it save to set this unconditionally by default despite of the
> warnings in the doc string?

I'm not sure, what warnings are you concerned about?  The only problem
that I see is if the directory is not writable, but is that a setup
that anyone would/could use?

> ,----[ <f1> v file-precious-flag RET ]
> | file-precious-flag is a variable defined in `files.el'.
> | Its value is nil
> | 
> | Documentation:
> | *Non-nil means protect against I/O errors while saving files.
> | Some modes set this non-nil in particular buffers.
> | 
> | This feature works by writing the new contents into a temporary file
> | and then renaming the temporary file to replace the original.
> | In this way, any I/O error in writing leaves the original untouched,
> | and there is never any instant where the file is nonexistent.
> | 
> | Note that this feature forces backups to be made by copying.
> | Yet, at the same time, saving a precious file
> | breaks any hard links between it and other files.
> `----

Greetings,
Jan.

Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.889
diff -p -u -r7.889 ChangeLog
--- lisp/ChangeLog	10 Nov 2005 11:15:54 -0000	7.889
+++ lisp/ChangeLog	11 Nov 2005 09:00:14 -0000
@@ -1,3 +1,9 @@
+2005-11-11  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* gnus-start.el (gnus-dribble-read-file): Set file-precious-flag,
+	as a buffer-local variable.  This avoids creating truncated
+	dribble files as a result of a hang up, eg.
+
 2005-11-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* messagexmas.el (message-use-toolbar): Change the valid values
Index: lisp/gnus-start.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-start.el,v
retrieving revision 7.40
diff -p -u -r7.40 gnus-start.el
--- lisp/gnus-start.el	10 Nov 2005 00:33:09 -0000	7.40
+++ lisp/gnus-start.el	11 Nov 2005 09:00:15 -0000
@@ -865,6 +865,8 @@ prompt the user for the name of an NNTP 
       (set-buffer (setq gnus-dribble-buffer
 			(gnus-get-buffer-create
 			 (file-name-nondirectory dribble-file))))
+      (make-variable-buffer-local file-precious-flag)
+      (setq file-precious-flag t)
       (erase-buffer)
       (setq buffer-file-name dribble-file)
       (auto-save-mode t)


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



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

* Re: PATCH: truncated dribble files
  2005-11-11 13:41   ` Jan Nieuwenhuizen
@ 2005-11-12 19:28     ` Reiner Steib
  2005-11-13  0:05       ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2005-11-12 19:28 UTC (permalink / raw)
  Cc: Ding List

On Fri, Nov 11 2005, Jan Nieuwenhuizen wrote:

> Reiner Steib writes:
[...]
>> It it save to set this unconditionally by default despite of the
>> warnings in the doc string?
>
> I'm not sure, what warnings are you concerned about?

It was this part:

>> | Note that this feature forces backups to be made by copying.
>> | Yet, at the same time, saving a precious file
>> | breaks any hard links between it and other files.

On a second though, I don't think this is relevant WTR the dribble
file.

I think this change should be installed in v5-10 and in the trunk.
(I don't have CVS access for a couple of days.  Maybe someone else can
install it before I'm back.)

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



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

* Re: PATCH: truncated dribble files
  2005-11-12 19:28     ` Reiner Steib
@ 2005-11-13  0:05       ` Katsumi Yamaoka
  2005-11-13 23:02         ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2005-11-13  0:05 UTC (permalink / raw)
  Cc: Ding List

>>>>> In <v93bm1ll7x.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> I think this change should be installed in v5-10 and in the trunk.
> (I don't have CVS access for a couple of days.  Maybe someone else can
> install it before I'm back.)

Done.



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

* Re: PATCH: truncated dribble files
  2005-11-13  0:05       ` Katsumi Yamaoka
@ 2005-11-13 23:02         ` Katsumi Yamaoka
  2005-11-14  7:45           ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2005-11-13 23:02 UTC (permalink / raw)
  Cc: ding

>>>>> In <87fyq3i9ni.fsf@peder.flower> Jan Nieuwenhuizen wrote:

> +2005-11-11  Jan Nieuwenhuizen  <janneke@gnu.org>
> +
> +	* gnus-start.el (gnus-dribble-read-file): Set file-precious-flag,
> +	as a buffer-local variable.  This avoids creating truncated
> +	dribble files as a result of a hang up, eg.
> +

> --- lisp/gnus-start.el	10 Nov 2005 00:33:09 -0000	7.40
> +++ lisp/gnus-start.el	11 Nov 2005 09:00:15 -0000
> @@ -865,6 +865,8 @@ prompt the user for the name of an NNTP 
>        (set-buffer (setq gnus-dribble-buffer
>  			(gnus-get-buffer-create
>  			 (file-name-nondirectory dribble-file))))
> +      (make-variable-buffer-local file-precious-flag)
> +      (setq file-precious-flag t)
>        (erase-buffer)
>        (setq buffer-file-name dribble-file)
>        (auto-save-mode t)

It makes that variable buffer-local in every buffer.  I've
changed it so as to use `make-local-variable' rather than
`make-variable-buffer-local'.



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

* Re: PATCH: truncated dribble files
  2005-11-13 23:02         ` Katsumi Yamaoka
@ 2005-11-14  7:45           ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2005-11-14  7:45 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka writes:

> It makes that variable buffer-local in every buffer.  I've
> changed it so as to use `make-local-variable' rather than
> `make-variable-buffer-local'.

Sound fine, Thanks.

Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



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

end of thread, other threads:[~2005-11-14  7:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87iruztv4t.fsf@peder.flower>
2005-11-11 13:23 ` PATCH: truncated dribble files Reiner Steib
2005-11-11 13:41   ` Jan Nieuwenhuizen
2005-11-12 19:28     ` Reiner Steib
2005-11-13  0:05       ` Katsumi Yamaoka
2005-11-13 23:02         ` Katsumi Yamaoka
2005-11-14  7:45           ` Jan Nieuwenhuizen

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).