unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7746: SERIOUS BUG: mail-strip-quoted-names bug causing unrmail to lose mail
@ 2010-12-28  0:17 Mark Lillibridge
  2011-01-02  2:43 ` Glenn Morris
  2011-01-02  3:21 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Lillibridge @ 2010-12-28  0:17 UTC (permalink / raw)
  To: 7746


mail-strip-quoted-names in mail/mail-utils.el (at least version 23.1
onwards) contains the following code:

mail-utils.el:187:
	   (with-current-buffer (get-buffer-create " *temp*")
	     (erase-buffer)
	     ...
	     (erase-buffer))

This code erases the buffer " *temp*" even if it is being used by
another piece of code!  This is particularly bad because this is the
first buffer used by with-temp-buffer.

A simple fix is to switch to using with-temp-buffer, which always
creates and destroys a new buffer (patch at end):

	   (with-temp-buffer
	      ...
	      )


    This bug breaks unrmail badly, causing it to discard all messages
after one containing a from line that causes that block of code to be
executed (roughly, from lines that contain nested comments).  This is
because unrmail loads the file to be converted into a buffer created
with with-temp-buffer, which is in turn erased prematurely by
mail-strip-quoted-names.  [There is a longer discussion about this on
the developers mailing list.]

    As this bug causes the permanent loss of e-mail, it should probably
be fixed posthaste, including in version 23.

- Mark

ts-rhel5 [158]% diff mail-utils.el new-mail-utils.el
187,188c187
<          (with-current-buffer (get-buffer-create " *temp*")
<            (erase-buffer)
---
>          (with-temp-buffer
201,202c200
<            (setq address (buffer-string))
<            (erase-buffer))
---
>            (setq address (buffer-string)))





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

end of thread, other threads:[~2011-01-05 21:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28  0:17 bug#7746: SERIOUS BUG: mail-strip-quoted-names bug causing unrmail to lose mail Mark Lillibridge
2011-01-02  2:43 ` Glenn Morris
2011-01-02  3:21 ` Stefan Monnier
2011-01-03  0:18   ` Mark Lillibridge
2011-01-03  3:36     ` Stefan Monnier
2011-01-03  4:13       ` Mark Lillibridge
2011-01-03 19:17         ` Mark Lillibridge
2011-01-05 21:32           ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).