From e80e3bdb756eb98fe023287c80386c591869bc72 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 29 Sep 2014 21:52:10 -0700 Subject: [PATCH] Release MH-E version 8.6. * NEWS, MH-E-NEWS: Update for MH-E release 8.6. * mh-e.el (Version, mh-version): Update for release 8.6. * mh-comp.el (mh-insert-x-face): Ensure that mh-x-face-file is a string before trying to use it (closes SF #474). (mh-bare-components): New function to create a temporary initial components file; replaces mh-find-components. Improve the temp folder and file names as per a suggestion from Bill Wohler. Also address XEmacs compatibility issues: use mm-make-temp-file instead of make-temp-file, and only pass one argument to delete-directory. (mh-edit-again, mh-send-sub): Use mh-bare-components instead of mh-find-components (partially closes SF #468). --- etc/ChangeLog | 6 ++++++ etc/MH-E-NEWS | 20 ++++++++++++++++++ etc/NEWS | 2 +- lisp/mh-e/ChangeLog | 18 ++++++++++++++++ lisp/mh-e/mh-comp.el | 50 ++++++++++++++++++++++++++------------------ lisp/mh-e/mh-e.el | 4 ++-- 6 files changed, 77 insertions(+), 23 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 2a3fc7c2297..a1a8e258b11 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-30 Bill Wohler + + Release MH-E version 8.6 + + * NEWS, MH-E-NEWS: Update for MH-E release 8.6. + 2014-09-29 Fabrice Niessen * themes/leuven-theme.el: Updates. diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index f4308cedfbc..a07655aa018 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -3,6 +3,26 @@ Copyright (C) 2001-2014 Free Software Foundation, Inc. See the end of the file for license conditions. +* Changes in MH-E 8.6 + +Version 8.6 fixes composition errors in nmh 1.6. + +** Bug Fixes in MH-E 8.6 + +*** Add support for nmh 1.5 + +A components file is now generated that works with nmh 1.5 (partially +closes SF #468). + +*** Error if mh-x-face-file is nil + +Ensure that `mh-x-face-file' is a string before trying to use it +(closes SF #474). + +*** MH-Folder buffer includes "scan: bad message list unseen" + +Fix this error (closes SF #471). + * Changes in MH-E 8.5 Version 8.5 fixes bugs when incorporating or forwarding mail. diff --git a/etc/NEWS b/etc/NEWS index e8bcdb50b9d..eba9b940585 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -614,7 +614,7 @@ are lined up to the first one. *** Recognition and better indentation of continuations in array comprehensions. -** MH-E has been updated to version 8.5 - see separate MH-E-NEWS file. +** MH-E has been updated to version 8.6 - see separate MH-E-NEWS file. ** Octave mode diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index b3d37ac4b1b..e0beeef46de 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,21 @@ +2014-09-30 Bill Wohler + + Release MH-E version 8.6. + + * mh-e.el (Version, mh-version): Update for release 8.6. + +2014-09-30 Mike Kupfer + + * mh-comp.el (mh-insert-x-face): Ensure that mh-x-face-file is a + string before trying to use it (closes SF #474). + (mh-bare-components): New function to create a temporary initial + components file; replaces mh-find-components. Improve the temp + folder and file names as per a suggestion from Bill Wohler. Also + address XEmacs compatibility issues: use mm-make-temp-file instead + of make-temp-file, and only pass one argument to delete-directory. + (mh-edit-again, mh-send-sub): Use mh-bare-components instead of + mh-find-components (partially closes SF #468). + 2014-03-16 Bill Wohler * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 95c543db248..35572c1eaaf 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -411,6 +411,7 @@ See also `mh-send'." (interactive (list (mh-get-msg-num t))) (let* ((from-folder mh-current-folder) (config (current-window-configuration)) + (components-file (mh-bare-components)) (draft (cond ((and mh-draft-folder (equal from-folder mh-draft-folder)) (pop-to-buffer (find-file-noselect (mh-msg-filename message)) @@ -467,7 +468,8 @@ See also `mh-send'." ;; Text field, that's an easy case (t (mh-modify-header-field field value)))))) - (mh-components-to-list (mh-find-components))) + (mh-components-to-list components-file)) + (delete-file components-file) (goto-char (point-min)) (save-buffer) (mh-compose-and-send-mail @@ -885,22 +887,6 @@ Optional argument BUFFER can be used to specify the buffer." (t nil)))) -(defun mh-find-components () - "Return the path to the components file." - (let (components) - (cond - ((file-exists-p - (setq components - (expand-file-name mh-comp-formfile mh-user-path))) - components) - ((file-exists-p - (setq components - (expand-file-name mh-comp-formfile mh-lib))) - components) - (t - (error "Can't find %s in %s or %s" - mh-comp-formfile mh-user-path mh-lib))))) - (defun mh-send-sub (to cc subject config) "Do the real work of composing and sending a letter. Expects the TO, CC, and SUBJECT fields as arguments. @@ -910,8 +896,8 @@ CONFIG is the window configuration before sending mail." (message "Composing a message...") (let ((draft (mh-read-draft "message" - (mh-find-components) - nil))) + (mh-bare-components) + t))) (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc) (goto-char (point-max)) (mh-compose-and-send-mail draft "" folder msg-num @@ -920,6 +906,29 @@ CONFIG is the window configuration before sending mail." (mh-letter-mode-message) (mh-letter-adjust-point)))) +(defun mh-bare-components () + "Generate a temporary, clean components file and return its path." + ;; Let comp(1) create the skeleton for us. This is particularly + ;; important with nmh-1.5, because its default "components" needs + ;; some processing before it can be used. Unfortunately, comp(1) + ;; doesn't have a -build option. So, to avoid the possibility of + ;; clobbering an existing draft, create a temporary directory and + ;; use it as the drafts folder. Then copy the skeleton to a regular + ;; temp file, and return the regular temp file. + (let (new + (temp-folder (mm-make-temp-file + (concat mh-user-path "draftfolder.") t))) + (mh-exec-cmd "comp" "-nowhatnowproc" + "-draftfolder" (format "+%s" + (file-name-nondirectory temp-folder)) + (if (stringp mh-comp-formfile) + (list "-form" mh-comp-formfile))) + (setq new (mm-make-temp-file "comp.")) + (rename-file (concat temp-folder "/" "1") new t) + (delete-file (concat temp-folder "/" ".mh_sequences")) + (delete-directory temp-folder) + new)) + (defun mh-read-draft (use initial-contents delete-contents-file) "Read draft file into a draft buffer and make that buffer the current one. @@ -1069,7 +1078,8 @@ The versions of MH-E, Emacs, and MH are shown." (defun mh-insert-x-face () "Append X-Face, Face or X-Image-URL field to header. If the field already exists, this function does nothing." - (when (and (file-exists-p mh-x-face-file) + (when (and (stringp mh-x-face-file) + (file-exists-p mh-x-face-file) (file-readable-p mh-x-face-file)) (save-excursion (unless (or (mh-position-on-field "X-Face") diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index eaa05720f43..920fef81dd4 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 8.5+bzr +;; Version: 8.6 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -127,7 +127,7 @@ ;; Try to keep variables local to a single file. Provide accessors if ;; variables are shared. Use this section as a last resort. -(defconst mh-version "8.5+bzr" "Version number of MH-E.") +(defconst mh-version "8.6" "Version number of MH-E.") ;; Variants -- 2.39.2