[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need help tracking down a subtle bug with unrmail/mail-strip-quoted-
Re: need help tracking down a subtle bug with unrmail/mail-strip-quoted-names
Mon, 27 Dec 2010 15:56:09 -0800
Ah! I found the bug. I will submit a bug report with a patch, but
for those curious, here's what the problem was:
unrmail starts with a with-temp-buffer, which switches to the buffer
" *temp*" because it does not yet exist:
(defmacro with-temp-buffer (&rest body)
"Create a temporary buffer, and evaluate BODY there like `progn'.
See also `with-temp-file' and `with-output-to-string'."
(declare (indent 0) (debug t))
(let ((temp-buffer (make-symbol "temp-buffer")))
`(let ((,temp-buffer (generate-new-buffer " *temp*")))
;; FIXME: kill-buffer can change current-buffer in some odd cases.
(and (buffer-name ,temp-buffer)
When mail-strip-quoted-names does the following:
(with-current-buffer (get-buffer-create " *temp*")
it erases that buffer! The code above is simply wrong as it erases a
possibly existing buffer. It should be:
This will not step on any existing buffers and avoids the need for
erasing any buffers.