Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* .newsrc-dribble autosave
@ 2014-07-05  7:13 akb427
  2014-07-05 23:09 ` Michael Heerdegen
       [not found] ` <mailman.4916.1404601810.1147.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 15+ messages in thread
From: akb427 @ 2014-07-05  7:13 UTC (permalink / raw)
  To: info-gnus-english

I've recently switched from xemacs to gnu emacs.

In gnus, I am now sometimes getting the message "Buffer .newsrc-dribble has shrunk a lot; auto save disabled in that buffer until next real save"

Isn't the whole point of the dribble file that it should get autosaved frequently
in case of a crash? What should I do about this?

Emacs is 23.2, Gnus is 5.13.


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

* Re: .newsrc-dribble autosave
  2014-07-05  7:13 .newsrc-dribble autosave akb427
@ 2014-07-05 23:09 ` Michael Heerdegen
  2014-07-07  4:45   ` Katsumi Yamaoka
       [not found] ` <mailman.4916.1404601810.1147.info-gnus-english@gnu.org>
  1 sibling, 1 reply; 15+ messages in thread
From: Michael Heerdegen @ 2014-07-05 23:09 UTC (permalink / raw)
  To: info-gnus-english

akb427 <google@mirror.to> writes:

> In gnus, I am now sometimes getting the message "Buffer
> .newsrc-dribble has shrunk a lot; auto save disabled in that buffer
> until next real save"

I don't know if this behavior is intended, but it doesn't seem very
useful to me.

The variable `auto-save-include-big-deletions` controls whether
auto-save-mode is turned off when the buffer has shrunk a lot - the
default is nil (meaning: turn off).

Gnus would have to set the buffer local value of this var to non-nil to
fix this.


Michael.



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

* Re: .newsrc-dribble autosave
       [not found] ` <mailman.4916.1404601810.1147.info-gnus-english@gnu.org>
@ 2014-07-06 14:18   ` Alan Smaill
  2014-07-06 20:14     ` why not just .newsrc? (was: Re: .newsrc-dribble autosave) Emanuel Berg
  2014-07-06 20:22     ` .newsrc-dribble autosave Michael Heerdegen
  0 siblings, 2 replies; 15+ messages in thread
From: Alan Smaill @ 2014-07-06 14:18 UTC (permalink / raw)
  To: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> akb427 <google@mirror.to> writes:
>
>> In gnus, I am now sometimes getting the message "Buffer
>> .newsrc-dribble has shrunk a lot; auto save disabled in that buffer
>> until next real save"
>
> I don't know if this behavior is intended, but it doesn't seem very
> useful to me.

Presumably the idea is that if you have inadvertently deleted a big
chunk of the buffer, you should be warned before any previous backup
gets overwritten.

> The variable `auto-save-include-big-deletions` controls whether
> auto-save-mode is turned off when the buffer has shrunk a lot - the
> default is nil (meaning: turn off).
>
> Gnus would have to set the buffer local value of this var to non-nil to
> fix this.
>
>
> Michael.
>
>

-- 
Alan Smaill

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

* why not just .newsrc? (was: Re: .newsrc-dribble autosave)
  2014-07-06 14:18   ` Alan Smaill
@ 2014-07-06 20:14     ` Emanuel Berg
  2014-07-06 21:09       ` why not just .newsrc? David Engster
                         ` (3 more replies)
  2014-07-06 20:22     ` .newsrc-dribble autosave Michael Heerdegen
  1 sibling, 4 replies; 15+ messages in thread
From: Emanuel Berg @ 2014-07-06 20:14 UTC (permalink / raw)
  To: info-gnus-english

One thing I don't understand is, if .newsrc-dribble is
used to track every little change, just to have in case
of a crash (which never happens), then why not do that
to .newsrc itself, keeping it up-to-date constantly?
(.newsrc or .newsrc.eld)

Is .newsrc so big it gets expansive parsing it?

In that case, a better solution I would think would be
to have "modular" .newsrc buffers - like one for each
group, or one for the gnus-newsrc-alist, one for
gnus-zombie-list, and so on.

I found some material here:

    Whenever you do something that changes the Gnus
    data (reading articles, catching up,
    killing/subscribing groups), the change is added to
    a special dribble buffer. This buffer is auto-saved
    the normal Emacs way. If your Emacs should crash
    before you have saved the `.newsrc' files, all
    changes you have made can be recovered from this
    file. [1]

[1] http://www.chemie.fu-berlin.de/chemnet/use/info/gnus/gnus_3.html

-- 
underground experts united:
http://user.it.uu.se/~embe8573

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

* Re: .newsrc-dribble autosave
  2014-07-06 14:18   ` Alan Smaill
  2014-07-06 20:14     ` why not just .newsrc? (was: Re: .newsrc-dribble autosave) Emanuel Berg
@ 2014-07-06 20:22     ` Michael Heerdegen
  1 sibling, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2014-07-06 20:22 UTC (permalink / raw)
  To: info-gnus-english

Alan Smaill <smaill@SPAMinf.ed.ac.uk> writes:

> > I don't know if this behavior is intended, but it doesn't seem very
> > useful to me.
>
> Presumably the idea is that if you have inadvertently deleted a big
> chunk of the buffer, you should be warned before any previous backup
> gets overwritten.

That's the idea behind this feature of autosave mode, and it is useful
in general.  The question is whether it is useful for the gnus dribble
file, which the user typically doesn't edit directly.  And when gnus
exits, the autosave file is gone.  That makes it not much useful as a
tool to undo changes.

autosave is mainly intended to recover stuff after a crash.  And I
wonder if it makes sense to disable autosave in certain situations for
an automatically maintained and only internally used file.
  

Michael.



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

* Re: why not just .newsrc?
  2014-07-06 20:14     ` why not just .newsrc? (was: Re: .newsrc-dribble autosave) Emanuel Berg
@ 2014-07-06 21:09       ` David Engster
  2014-07-06 21:50         ` Peter Münster
  2014-07-06 21:48       ` Peter Münster
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: David Engster @ 2014-07-06 21:09 UTC (permalink / raw)
  To: info-gnus-english

Emanuel Berg writes:
> One thing I don't understand is, if .newsrc-dribble is
> used to track every little change, just to have in case
> of a crash (which never happens), then why not do that
> to .newsrc itself, keeping it up-to-date constantly?
> (.newsrc or .newsrc.eld)

. That would increase the chance of a crash corrupting .newsrc.eld
  itself, instead of just the dribble file.

. It would make it more difficult to quit Gnus without saving
  .newsrc.eld in case you did something stupid (you'd have to store undo
  information instead, leading to a reverse dribble file).

-David



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

* Re: why not just .newsrc?
  2014-07-06 20:14     ` why not just .newsrc? (was: Re: .newsrc-dribble autosave) Emanuel Berg
  2014-07-06 21:09       ` why not just .newsrc? David Engster
@ 2014-07-06 21:48       ` Peter Münster
       [not found]       ` <mailman.4958.1404680975.1147.info-gnus-english@gnu.org>
       [not found]       ` <mailman.4959.1404683318.1147.info-gnus-english@gnu.org>
  3 siblings, 0 replies; 15+ messages in thread
From: Peter Münster @ 2014-07-06 21:48 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Jul 06 2014, Emanuel Berg wrote:

> One thing I don't understand is, if .newsrc-dribble is
> used to track every little change, just to have in case
> of a crash (which never happens), then why not do that
> to .newsrc itself, keeping it up-to-date constantly?
> (.newsrc or .newsrc.eld)

I have good experience with:

(setq
 gnus-use-dribble-file             nil
 gnus-read-newsrc-file             nil
 gnus-save-newsrc-file             nil
 gnus-startup-file                 (concat pm/emacs-dir "newsrc"))

(gnus-demon-add-handler 'gnus-group-save-newsrc   5     2)

-- 
           Peter



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

* Re: why not just .newsrc?
  2014-07-06 21:09       ` why not just .newsrc? David Engster
@ 2014-07-06 21:50         ` Peter Münster
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Münster @ 2014-07-06 21:50 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Jul 06 2014, David Engster wrote:

> Emanuel Berg writes:
>> One thing I don't understand is, if .newsrc-dribble is
>> used to track every little change, just to have in case
>> of a crash (which never happens), then why not do that
>> to .newsrc itself, keeping it up-to-date constantly?
>> (.newsrc or .newsrc.eld)
>
> . That would increase the chance of a crash corrupting .newsrc.eld
>   itself, instead of just the dribble file.

Yes, but there is still "newsrc.eld~" and probably backups.

-- 
           Peter



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

* Re: why not just .newsrc?
       [not found]       ` <mailman.4958.1404680975.1147.info-gnus-english@gnu.org>
@ 2014-07-06 22:03         ` Emanuel Berg
  2014-07-06 22:35           ` Peter Münster
  0 siblings, 1 reply; 15+ messages in thread
From: Emanuel Berg @ 2014-07-06 22:03 UTC (permalink / raw)
  To: info-gnus-english

David Engster <deng@randomsample.de> writes:

>> One thing I don't understand is, if .newsrc-dribble
>> is used to track every little change, just to have
>> in case of a crash (which never happens), then why
>> not do that to .newsrc itself, keeping it up-to-date
>> constantly?  (.newsrc or .newsrc.eld)
>
> . That would increase the chance of a crash
> corrupting .newsrc.eld itself, instead of just the
> dribble file.

Yeah, I just can't recall a single general Emacs/system
crash in the past five years or so. But if you are on a
power supply that fails now and then I'd say you should
focus on fixing that instead of protecting the
.newsrc.eld, don't you think?

> . It would make it more difficult to quit Gnus
> without saving .newsrc.eld in case you did something
> stupid (you'd have to store undo information instead,
> leading to a reverse dribble file).

I don't know what stupid things you can do in Gnus,
except for stupid things to tell people... But if I did
a stupid thing in Gnus, I think most definitely that
should be "undoable" rather than to quit Gnus (without
saving .newsrc.eld), hold your thumbs, and restart
it... that's just lame.

The only example I can think of is killing groups in
the group buffer by mistake, but that is undoable with
the old Emacs keystroke, isn't it?

Note that I don't think that the dribble file is bad or
anything. Just thought there was some better reason for
it to exist. The crash thing you mention is of course a
valid point in a situation where crashes are common
and/or somehow externally unavoidable...

-- 
underground experts united:
http://user.it.uu.se/~embe8573

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

* Re: why not just .newsrc?
       [not found]       ` <mailman.4959.1404683318.1147.info-gnus-english@gnu.org>
@ 2014-07-06 22:04         ` Emanuel Berg
  2014-07-06 22:38         ` Emanuel Berg
  1 sibling, 0 replies; 15+ messages in thread
From: Emanuel Berg @ 2014-07-06 22:04 UTC (permalink / raw)
  To: info-gnus-english

Peter Münster <pmlists@free.fr> writes:

> I have good experience with ...
>
> (gnus-demon-add-handler 'gnus-group-save-newsrc 5 2)

Thank you, I will examine that!

-- 
underground experts united:
http://user.it.uu.se/~embe8573
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: why not just .newsrc?
  2014-07-06 22:03         ` Emanuel Berg
@ 2014-07-06 22:35           ` Peter Münster
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Münster @ 2014-07-06 22:35 UTC (permalink / raw)
  To: info-gnus-english

On Mon, Jul 07 2014, Emanuel Berg wrote:

> Note that I don't think that the dribble file is bad or
> anything. Just thought there was some better reason for
> it to exist. The crash thing you mention is of course a
> valid point in a situation where crashes are common
> and/or somehow externally unavoidable...

See also:
http://article.gmane.org/gmane.emacs.gnus.general/79040

-- 
           Peter



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

* Re: why not just .newsrc?
       [not found]       ` <mailman.4959.1404683318.1147.info-gnus-english@gnu.org>
  2014-07-06 22:04         ` Emanuel Berg
@ 2014-07-06 22:38         ` Emanuel Berg
  1 sibling, 0 replies; 15+ messages in thread
From: Emanuel Berg @ 2014-07-06 22:38 UTC (permalink / raw)
  To: info-gnus-english

Peter Münster <pmlists@free.fr> writes:

> I have good experience with ...
>
> (gnus-demon-add-handler 'gnus-group-save-newsrc 5 2)

Yes, the idle-timer can be used but I would prefer if
it just saved every time I did something that should be
saved.

When exiting a summary buffer, for example, I most
often have r'd (or !'d) some articles, and naturally I
would like that reflected in the group buffer next time
I visit it. That I had solved with:

(gnus-summary-save-newsrc)

in gnus-summary-exit-hook, but there are many cases
like that, for example gnus-group-catchup-current.

It would be cool if it could be configured once! Did
anyone do work on that?

Again, the reason I like this isn't because any care
(or the opposite) for newsrc and dribble, it is rather
I would like the Gnus I see and use to be instantly
responsive and consistent the moment a change is made.

-- 
underground experts united:
http://user.it.uu.se/~embe8573
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: .newsrc-dribble autosave
  2014-07-05 23:09 ` Michael Heerdegen
@ 2014-07-07  4:45   ` Katsumi Yamaoka
  2014-07-07  6:06     ` Katsumi Yamaoka
  0 siblings, 1 reply; 15+ messages in thread
From: Katsumi Yamaoka @ 2014-07-07  4:45 UTC (permalink / raw)
  To: info-gnus-english

On Sun, 06 Jul 2014 01:09:42 +0200, Michael Heerdegen wrote:
> akb427 <google@mirror.to> writes:

>> In gnus, I am now sometimes getting the message "Buffer
>> .newsrc-dribble has shrunk a lot; auto save disabled in that buffer
>> until next real save"

> I don't know if this behavior is intended, but it doesn't seem very
> useful to me.

This is probably due to the change that I've made in 2011-06-10,
though I've never seen such a warning.  The original message I
posted to the ding list is missing in Gmane, but Google says:

,----
| Development list for Gnus, the Emacs newsreader - Gmane
| <http://comments.gmane.org/gmane.emacs.gnus.general/79033>
| 2011/06/08 - Hi, You may see the dribble buffer and the dribble
| file get pretty big if you use Gnus all day long without saving
| .newsrc.eld. I tried improving Gnus' dribble data handling so as
| to prevent the dribble buffer from growing infinitely ...
`----

Before this change, Gnus adds newsrc data for a group to
the dribble file whenever you read article(s) in the group, but
the useful data is only the newest one.  So, I changed the code
so as to delete the old one when entering a new one to the dribble
buffer.

I guess why Emacs issues the warning message in question is that
a newsrc entry for a certain group is very big.  Otherwise, that
I often save the .newsrc.eld file using the `s' command in the
Group buffer might be the reason why I've never seen the warning.

Anyway deleting old dribble data is harmless, I believe.

> The variable `auto-save-include-big-deletions` controls whether
> auto-save-mode is turned off when the buffer has shrunk a lot - the
> default is nil (meaning: turn off).

> Gnus would have to set the buffer local value of this var to non-nil to
> fix this.

I'll do it.  Thanks.


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

* Re: .newsrc-dribble autosave
  2014-07-07  4:45   ` Katsumi Yamaoka
@ 2014-07-07  6:06     ` Katsumi Yamaoka
  2014-07-08  1:48       ` Michael Heerdegen
  0 siblings, 1 reply; 15+ messages in thread
From: Katsumi Yamaoka @ 2014-07-07  6:06 UTC (permalink / raw)
  To: info-gnus-english

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

On Mon, 07 Jul 2014 13:45:34 +0900, Katsumi Yamaoka wrote:
> On Sun, 06 Jul 2014 01:09:42 +0200, Michael Heerdegen wrote:
[...]
>> The variable `auto-save-include-big-deletions` controls whether
>> auto-save-mode is turned off when the buffer has shrunk a lot - the
>> default is nil (meaning: turn off).

>> Gnus would have to set the buffer local value of this var to non-nil to
>> fix this.

> I'll do it.  Thanks.

Currently the change below has been installed in the Emacs trunk
only.  I'll install it in the Gnus Git master too when the server
ups (it seems down now).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 614 bytes --]

--- gnus-start.el~	2014-03-23 23:08:55.000000000 +0000
+++ gnus-start.el	2014-07-07 05:38:49.670117000 +0000
@@ -889,6 +889,11 @@
       (setq buffer-save-without-query t)
       (erase-buffer)
       (setq buffer-file-name dribble-file)
+      ;; The buffer may be shrunk a lot when deleting old entries.
+      ;; It caused the auto-saving to stop.
+      (if (featurep 'emacs)
+	  (set (make-local-variable 'auto-save-include-big-deletions) t)
+	(set (make-local-variable 'disable-auto-save-when-buffer-shrinks) nil))
       (auto-save-mode t)
       (buffer-disable-undo)
       (bury-buffer (current-buffer))



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

* Re: .newsrc-dribble autosave
  2014-07-07  6:06     ` Katsumi Yamaoka
@ 2014-07-08  1:48       ` Michael Heerdegen
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2014-07-08  1:48 UTC (permalink / raw)
  To: info-gnus-english

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Currently the change below has been installed in the Emacs trunk
> only.  I'll install it in the Gnus Git master too when the server
> ups (it seems down now).

Ok, thanks.

Michael.



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

end of thread, other threads:[~2014-07-08  1:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-05  7:13 .newsrc-dribble autosave akb427
2014-07-05 23:09 ` Michael Heerdegen
2014-07-07  4:45   ` Katsumi Yamaoka
2014-07-07  6:06     ` Katsumi Yamaoka
2014-07-08  1:48       ` Michael Heerdegen
     [not found] ` <mailman.4916.1404601810.1147.info-gnus-english@gnu.org>
2014-07-06 14:18   ` Alan Smaill
2014-07-06 20:14     ` why not just .newsrc? (was: Re: .newsrc-dribble autosave) Emanuel Berg
2014-07-06 21:09       ` why not just .newsrc? David Engster
2014-07-06 21:50         ` Peter Münster
2014-07-06 21:48       ` Peter Münster
     [not found]       ` <mailman.4958.1404680975.1147.info-gnus-english@gnu.org>
2014-07-06 22:03         ` Emanuel Berg
2014-07-06 22:35           ` Peter Münster
     [not found]       ` <mailman.4959.1404683318.1147.info-gnus-english@gnu.org>
2014-07-06 22:04         ` Emanuel Berg
2014-07-06 22:38         ` Emanuel Berg
2014-07-06 20:22     ` .newsrc-dribble autosave Michael Heerdegen

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