bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RMail bug resulting in lost messages. Again


From: Christopher Neufeld
Subject: RMail bug resulting in lost messages. Again
Date: Tue, 16 Jan 2007 17:45:22 -0500

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.4.1 (i686-pc-linux-gnu, X toolkit)
 of 2005-10-30 on londo.cneufeld.ca
configured using `configure  --prefix=/usr --with-x --with-xpm --with-jpeg 
--with-tiff --with-gif --with-png'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


This is the same bug I reported to gnu.emacs.bug in message
<address@hidden> five years ago.  The patch I submitted then has
not been incorporated into the code, and as of 21.4.1, RMail still deletes
messages that the user believes he is saving to a disk file.

Here is the original news posting:



I just noticed a rather unfortunate bug in rmail in Emacs 21.1 which
has resulted in a significant quantity of lost email.  I have
rmail-delete-after-output set to 't, and I usually save messages in
mbox format.  (Note that this bug also affects users who have set
rmail-delete-after-output to nil, it just requires a bit more action
on the users' parts.)

I might receive several messages, and decide to save all of them to
the same file.  I generally type something like:
C-U 8 C-o

which saves the eight messages to a filename (prompted), and deletes
them from the rmail inbox.

Unfortunately, a bug in the mbox saving (but not in the rmail format
saving) results in the currently selected message being saved into the
file 8 times, then all eight messages being deleted.  Then, it's just
a simple rmail-summary-expunge followed by save-buffers-kill-emacs,
and the 7 unsaved messages are available only in the backup save file.
Do this once more, and they vanish forever as the backup save file is
overwritten.

The fix.  Well, the buggy operations occur within
rmail-summary-output, while the correct behaviour is observed in
rmail-summary-output-to-rmail-file.  These two functions ought to be
essentially identical, the first calling rmail-output where the second
calls rmail-output-to-rmail-file.  There is a block of code, used for
selecting the message to operate upon, which is entirely absent in the
buggy code.  This patch restores the correct behaviour on my system,
by restoring the symmetry between the two output functions.


--- 21.1/lisp/mail/rmailsum.el.orig     Fri Feb 22 22:40:30 2002
+++ 21.1/lisp/mail/rmailsum.el  Fri Feb 22 23:00:35 2002
@@ -1525,8 +1525,14 @@
    (progn (require 'rmailout)
          (list (rmail-output-read-file-name)
                (prefix-numeric-value current-prefix-arg))))
-  (let ((i 0))
-    (while (< i n)
+  (let ((i 0) prev-msg)
+    (while
+       (and (< i n)
+            (progn (rmail-summary-goto-msg)
+                   (not (eq prev-msg
+                            (setq prev-msg
+                                  (with-current-buffer rmail-buffer
+                                    rmail-current-message))))))
       (setq i (1+ i))
       (with-current-buffer rmail-buffer
        (let ((rmail-delete-after-output nil))



Of course, the .elc file should be updated after this, with
byte-compile-file.




-- 
 Christopher Neufeld
 Home page:  http://www.cneufeld.ca/neufeld
 "Don't edit reality for the sake of simplicity"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]