home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / emacs / bug / 1228 < prev    next >
Encoding:
Text File  |  1992-09-02  |  5.2 KB  |  144 lines

  1. Newsgroups: gnu.emacs.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!edscom.demon.co.uk!kevin
  3. From: kevin@edscom.demon.co.uk (Kevin Broadey)
  4. Subject: BUG ALERT: sendmail.el - FCC output doesn't have "From: " header field
  5. Message-ID: <KEVIN.92Sep2193814@runningbear.edscom.demon.co.uk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: EDS-Scicon, Milton Keynes, UK
  8. References: kevin@edscom.demon.co.uk (Kevin Broadey)
  9. Distribution: gnu
  10. Date: Wed, 2 Sep 1992 19:38:14 GMT
  11. Approved: bug-gnu-emacs@prep.ai.mit.edu
  12. Lines: 130
  13.  
  14. Don't use the fix I posted.  The fault doesn't exist in the sendmail.el
  15. distributed with either emacs 18.57 or 18.58, it's in a modified version
  16. of sendmail.el that I posted a couple of weeks ago.
  17.  
  18. My modified version checked whether the FCC file was already being
  19. visited by Emacs in RMAIL mode, and if so attempted to append the FCC
  20. message to the RMAIL buffer in BABYL format.  BUT THE FORMAT CONVERSION
  21. FUNCTION WAS WRONG.
  22.  
  23. Here is the diffs file relative to sendmail.el 18.57 that does the
  24. conversion correctly by calling RMAIL's own `rmail-convert-to-babyl-format'
  25. function.
  26.  
  27. It also fixes a longstanding bug in sendmail - RMAIL's BABYL conversion
  28. function expects the time to be in the format output by the UNIX `date'
  29. command, not the format provided by (current-time-string).  This is the
  30. fault that was really causing RMAIL summary lines to screw up.
  31.  
  32. Millions and millions of appologies to everyone whose FCC files have
  33. been screwed up.
  34.  
  35. -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip --
  36.  
  37. *** sendmail.el
  38. --- sendmail.el.old
  39. ***************
  40. *** 17,34 ****
  41.   ;; along with GNU Emacs; see the file COPYING.  If not, write to
  42.   ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  43.   
  44. - ;; 02-09-92  Kevin Broadey  EDS-Scicon
  45. - ;; File Carbon Copy feature: Change mail-do-fcc to spot when the buffer
  46. - ;; visiting the FCC file is in RMAIL mode and make it append the message in
  47. - ;; BABYL format, updating rmail's variables as well.  Also, ask whether to
  48. - ;; append to a read-only buffer instead of bombing out.
  49. - ;;
  50. - ;; This has been unashamedly lifted from the GNUS `gnus-output-to-rmail'
  51. - ;; function.
  52. - ;;
  53. - ;; Also, fix longstanding bug in FCC: Use UNIX `date' instead of
  54. - ;; `current-time-string' to get timestamp so Rmail parses it successfully when
  55. - ;; converting to BABYL format.
  56.   
  57.   (provide 'sendmail)
  58.   
  59. --- 17,22 ----
  60. ***************
  61. *** 196,202 ****
  62.       (unwind-protect
  63.       (save-excursion
  64.         (set-buffer tembuf)
  65. -       (setq buffer-undo-list t)
  66.         (erase-buffer)
  67.         (insert-buffer-substring mailbuf)
  68.         (goto-char (point-max))
  69. --- 184,189 ----
  70. ***************
  71. *** 286,293 ****
  72.                  (progn (forward-line 1) (point))))
  73.         (set-buffer tembuf)
  74.         (erase-buffer)
  75. !       (insert "\nFrom " (user-login-name) " ")
  76. !       (call-process "date" nil t nil)
  77.         (insert-buffer-substring rmailbuf)
  78.         ;; Make sure messages are separated.
  79.         (goto-char (point-max))
  80. --- 273,280 ----
  81.                  (progn (forward-line 1) (point))))
  82.         (set-buffer tembuf)
  83.         (erase-buffer)
  84. !       (insert "\nFrom " (user-login-name) " "
  85. !           (current-time-string) "\n")
  86.         (insert-buffer-substring rmailbuf)
  87.         ;; Make sure messages are separated.
  88.         (goto-char (point-max))
  89. ***************
  90. *** 306,338 ****
  91.             ;; File is present in a buffer => append to that buffer.
  92.             (let ((curbuf (current-buffer))
  93.               (beg (point-min)) (end (point-max)))
  94. !         (set-buffer buffer)
  95. !         (if (eq major-mode 'rmail-mode)
  96. !             ;; buffer is in RMAIL mode - be clever with messages.
  97. !             (let ((buffer-read-only nil)
  98. !               (curmsg rmail-current-message))
  99. !               (widen)
  100. !               (narrow-to-region (point-max) (point-max))
  101. !               (insert-buffer-substring curbuf beg end)
  102. !               (rmail-convert-to-babyl-format)
  103. !               (goto-char (point-min))
  104. !               (widen)
  105. !               (search-backward "\^_")
  106. !               (narrow-to-region (point) (point-max))
  107. !               (goto-char (1+ (point-min)))
  108. !               (rmail-count-new-messages t)
  109. !               (rmail-show-message curmsg))
  110. !           ;; Else not in rmail-mode - tag message on at end.
  111. !           (if (or (not buffer-read-only)
  112. !               (y-or-n-p
  113. !                (format "Buffer %s is read-only. Append anyway? "
  114. !                    (buffer-name buffer))))
  115. !               (let ((buffer-read-only nil))
  116. !             (save-excursion
  117. !               (save-restriction
  118. !                 (goto-char (point-max))
  119. !                 (insert-buffer-substring curbuf beg end))))
  120. !             )))
  121.           ;; Else append to the file directly.
  122.           (write-region (point-min) (point-max) (car fcc-list) t)))
  123.       (setq fcc-list (cdr fcc-list))))
  124. --- 293,302 ----
  125.             ;; File is present in a buffer => append to that buffer.
  126.             (let ((curbuf (current-buffer))
  127.               (beg (point-min)) (end (point-max)))
  128. !         (save-excursion
  129. !           (set-buffer buffer)
  130. !           (goto-char (point-max))
  131. !           (insert-buffer-substring curbuf beg end)))
  132.           ;; Else append to the file directly.
  133.           (write-region (point-min) (point-max) (car fcc-list) t)))
  134.       (setq fcc-list (cdr fcc-list))))
  135.  
  136. -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip --
  137.  
  138. --
  139. Kevin Broadey <kbroadey@edscom.demon.co.uk>
  140. EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
  141. Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
  142. These opinions are mine: others available on request.
  143.  
  144.