GNU bug report logs - #4940
Avoiding loss of rcirc messages from the on disk log

Previous Next

Package: emacs;

Reported by: Giorgos Keramidas <keramida <at> ceid.upatras.gr>

Date: Mon, 16 Nov 2009 21:45:04 UTC

Severity: normal

Tags: patch

Done: Deniz Dogan <deniz.a.m.dogan <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4940 in the body.
You can then email your comments to 4940 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report stored :
bug#4940; Package emacs. (Mon, 16 Nov 2009 21:45:04 GMT) Full text and rfc822 format available.

Message #3 received at quiet <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Giorgos Keramidas <keramida <at> ceid.upatras.gr>
To: quiet <at> debbugs.gnu.org
Subject: Avoiding loss of rcirc messages from the on disk log
Date: Sat, 31 Oct 2009 05:19:06 +0200
[ Resent from
  http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00691.html ]


The IRC buffers of "rcirc.el" use the auto-save mechanism to push log
messages on disk.  This is a very good idea, since it avoids hitting the
disk for every single line of the IRC log.  On busy channels it probably
saves a *lot* of time that would be spent waiting for messages to be
saved on disk.

Unfortunately, it also means that the simple action of killing an rcirc
buffer may lose some of the messages.  Any messages still on the alist
`rcirc-log-alist' are still in memory and I've noticed that some of
these may not be written to the log files in `rcirc-log-directory'.

I have now bound `C-c L' locally to a function that explicitly calls
`rcirc-log-write':

    (defun keramida/rcirc-log-write ()
      "A command-wrapper for the `rcirc-log-write' function.  This
    wrapper may be bound to a key, so that `rcirc-log-write' can be
    called from any IRC buffer to immediately save any pending
    messages on disk."
      (interactive)
      (if (null rcirc-log-alist)
          (message "No IRC messages to save")
        (when rcirc-log-directory
          (rcirc-log-write)
          (message "IRC messages saved in %s" rcirc-log-directory))))

    (defun keramida/rcirc-setup-keys ()
      "Set up some custom keys that I find useful in rcirc buffers."
      (local-set-key (kbd "C-c L") 'keramida/rcirc-log-write))

    (add-hook 'rcirc-mode-hook 'keramida/rcirc-setup-keys)

This is ok for now, but it seems slightly ugly.

Looking at the source code of rcirc, I see that it adds its own
`rcirc-kill-buffer-hook' to the `kill-buffer-hook'.  This calls
`rcirc-clean-up-buffer', but there is no call to `rcirc-log-write' in
the rcirc buffer cleanup function.

Would it be a good idea to install the following change to `rcirc.el' so
that all log messages are flushed to disk when an rcirc buffer is
killed?

------------------------------------------------------------------------
diff -r e1381fd70a71 lisp/net/rcirc.el
--- a/lisp/net/rcirc.el	Fri Apr 03 03:02:01 2009 +0300
+++ b/lisp/net/rcirc.el	Sat Oct 31 05:12:55 2009 +0200
@@ -984,6 +984,8 @@ If ALL is non-nil, update prompts in all
 (defun rcirc-kill-buffer-hook ()
   "Part the channel when killing an rcirc buffer."
   (when (eq major-mode 'rcirc-mode)
+    (when (and rcirc-log-directory rcirc-log-alist)
+      (rcirc-log-write))
     (rcirc-clean-up-buffer "Killed buffer")))
 
 (defun rcirc-change-major-mode-hook ()
------------------------------------------------------------------------



bug reassigned from package 'emacs' to 'emacs,rcirc'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 02 Dec 2009 21:35:17 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com:
bug#4940; Package emacs,rcirc. (Sun, 06 Dec 2009 17:25:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Deniz Dogan <deniz.a.m.dogan <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com. (Sun, 06 Dec 2009 17:25:07 GMT) Full text and rfc822 format available.

Message #10 received at 4940 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Deniz Dogan <deniz.a.m.dogan <at> gmail.com>
To: 4940 <at> debbugs.gnu.org
Date: Sun, 6 Dec 2009 18:21:43 +0100
Shouldn't rcirc-log-flag be part of the equation here?

(and rcirc-log-flag rcirc-log-directory rcirc-log-alist)

-- 
Deniz Dogan



Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#4940; Package emacs,rcirc. (Mon, 18 Jan 2010 00:02:02 GMT) Full text and rfc822 format available.

Message #13 received at 4940 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Ryan Yeske <rcyeske <at> gmail.com>
Cc: 4940 <at> debbugs.gnu.org
Subject: Re: Avoiding loss of rcirc messages from the on disk log
Date: Sun, 17 Jan 2010 19:01:33 -0500
Hi Ryan,

Could you review the patch from Giorgos Keramidas?  Thanks.

> The IRC buffers of "rcirc.el" use the auto-save mechanism to push log
> messages on disk.  This is a very good idea, since it avoids hitting the
> disk for every single line of the IRC log.  On busy channels it probably
> saves a *lot* of time that would be spent waiting for messages to be
> saved on disk.

> Unfortunately, it also means that the simple action of killing an rcirc
> buffer may lose some of the messages.  Any messages still on the alist
> `rcirc-log-alist' are still in memory and I've noticed that some of
> these may not be written to the log files in `rcirc-log-directory'.


diff -r e1381fd70a71 lisp/net/rcirc.el
--- a/lisp/net/rcirc.el	Fri Apr 03 03:02:01 2009 +0300
+++ b/lisp/net/rcirc.el	Sat Oct 31 05:12:55 2009 +0200
 <at>  <at>  -984,6 +984,8  <at>  <at>  If ALL is non-nil, update prompts in all
 (defun rcirc-kill-buffer-hook ()
   "Part the channel when killing an rcirc buffer."
   (when (eq major-mode 'rcirc-mode)
+    (when (and rcirc-log-directory rcirc-log-alist)
+      (rcirc-log-write))
     (rcirc-clean-up-buffer "Killed buffer")))
 
 (defun rcirc-change-major-mode-hook ()




Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 19 Jan 2010 19:24:02 GMT) Full text and rfc822 format available.

Reply sent to Deniz Dogan <deniz.a.m.dogan <at> gmail.com>:
You have taken responsibility. (Sat, 22 Jan 2011 16:19:02 GMT) Full text and rfc822 format available.

Notification sent to Giorgos Keramidas <keramida <at> ceid.upatras.gr>:
bug acknowledged by developer. (Sat, 22 Jan 2011 16:19:02 GMT) Full text and rfc822 format available.

Message #20 received at 4940-done <at> debbugs.gnu.org (full text, mbox):

From: Deniz Dogan <deniz.a.m.dogan <at> gmail.com>
To: 4940-done <at> debbugs.gnu.org
Date: Sat, 22 Jan 2011 17:26:01 +0100
I just pushed this change, only slightly modified, to trunk. Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Feb 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.