aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mh-e
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mh-e')
-rw-r--r--lisp/mh-e/ChangeLog18
-rw-r--r--lisp/mh-e/mh-comp.el50
-rw-r--r--lisp/mh-e/mh-e.el4
3 files changed, 50 insertions, 22 deletions
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 @@
12014-09-30 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.6.
4
5 * mh-e.el (Version, mh-version): Update for release 8.6.
6
72014-09-30 Mike Kupfer <m.kupfer@acm.org>
8
9 * mh-comp.el (mh-insert-x-face): Ensure that mh-x-face-file is a
10 string before trying to use it (closes SF #474).
11 (mh-bare-components): New function to create a temporary initial
12 components file; replaces mh-find-components. Improve the temp
13 folder and file names as per a suggestion from Bill Wohler. Also
14 address XEmacs compatibility issues: use mm-make-temp-file instead
15 of make-temp-file, and only pass one argument to delete-directory.
16 (mh-edit-again, mh-send-sub): Use mh-bare-components instead of
17 mh-find-components (partially closes SF #468).
18
12014-03-16 Bill Wohler <wohler@newt.com> 192014-03-16 Bill Wohler <wohler@newt.com>
2 20
3 * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list 21 * 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'."
411 (interactive (list (mh-get-msg-num t))) 411 (interactive (list (mh-get-msg-num t)))
412 (let* ((from-folder mh-current-folder) 412 (let* ((from-folder mh-current-folder)
413 (config (current-window-configuration)) 413 (config (current-window-configuration))
414 (components-file (mh-bare-components))
414 (draft 415 (draft
415 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder)) 416 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
416 (pop-to-buffer (find-file-noselect (mh-msg-filename message)) 417 (pop-to-buffer (find-file-noselect (mh-msg-filename message))
@@ -467,7 +468,8 @@ See also `mh-send'."
467 ;; Text field, that's an easy case 468 ;; Text field, that's an easy case
468 (t 469 (t
469 (mh-modify-header-field field value)))))) 470 (mh-modify-header-field field value))))))
470 (mh-components-to-list (mh-find-components))) 471 (mh-components-to-list components-file))
472 (delete-file components-file)
471 (goto-char (point-min)) 473 (goto-char (point-min))
472 (save-buffer) 474 (save-buffer)
473 (mh-compose-and-send-mail 475 (mh-compose-and-send-mail
@@ -885,22 +887,6 @@ Optional argument BUFFER can be used to specify the buffer."
885 (t 887 (t
886 nil)))) 888 nil))))
887 889
888(defun mh-find-components ()
889 "Return the path to the components file."
890 (let (components)
891 (cond
892 ((file-exists-p
893 (setq components
894 (expand-file-name mh-comp-formfile mh-user-path)))
895 components)
896 ((file-exists-p
897 (setq components
898 (expand-file-name mh-comp-formfile mh-lib)))
899 components)
900 (t
901 (error "Can't find %s in %s or %s"
902 mh-comp-formfile mh-user-path mh-lib)))))
903
904(defun mh-send-sub (to cc subject config) 890(defun mh-send-sub (to cc subject config)
905 "Do the real work of composing and sending a letter. 891 "Do the real work of composing and sending a letter.
906Expects the TO, CC, and SUBJECT fields as arguments. 892Expects the TO, CC, and SUBJECT fields as arguments.
@@ -910,8 +896,8 @@ CONFIG is the window configuration before sending mail."
910 (message "Composing a message...") 896 (message "Composing a message...")
911 (let ((draft (mh-read-draft 897 (let ((draft (mh-read-draft
912 "message" 898 "message"
913 (mh-find-components) 899 (mh-bare-components)
914 nil))) 900 t)))
915 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc) 901 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
916 (goto-char (point-max)) 902 (goto-char (point-max))
917 (mh-compose-and-send-mail draft "" folder msg-num 903 (mh-compose-and-send-mail draft "" folder msg-num
@@ -920,6 +906,29 @@ CONFIG is the window configuration before sending mail."
920 (mh-letter-mode-message) 906 (mh-letter-mode-message)
921 (mh-letter-adjust-point)))) 907 (mh-letter-adjust-point))))
922 908
909(defun mh-bare-components ()
910 "Generate a temporary, clean components file and return its path."
911 ;; Let comp(1) create the skeleton for us. This is particularly
912 ;; important with nmh-1.5, because its default "components" needs
913 ;; some processing before it can be used. Unfortunately, comp(1)
914 ;; doesn't have a -build option. So, to avoid the possibility of
915 ;; clobbering an existing draft, create a temporary directory and
916 ;; use it as the drafts folder. Then copy the skeleton to a regular
917 ;; temp file, and return the regular temp file.
918 (let (new
919 (temp-folder (mm-make-temp-file
920 (concat mh-user-path "draftfolder.") t)))
921 (mh-exec-cmd "comp" "-nowhatnowproc"
922 "-draftfolder" (format "+%s"
923 (file-name-nondirectory temp-folder))
924 (if (stringp mh-comp-formfile)
925 (list "-form" mh-comp-formfile)))
926 (setq new (mm-make-temp-file "comp."))
927 (rename-file (concat temp-folder "/" "1") new t)
928 (delete-file (concat temp-folder "/" ".mh_sequences"))
929 (delete-directory temp-folder)
930 new))
931
923(defun mh-read-draft (use initial-contents delete-contents-file) 932(defun mh-read-draft (use initial-contents delete-contents-file)
924 "Read draft file into a draft buffer and make that buffer the current one. 933 "Read draft file into a draft buffer and make that buffer the current one.
925 934
@@ -1069,7 +1078,8 @@ The versions of MH-E, Emacs, and MH are shown."
1069(defun mh-insert-x-face () 1078(defun mh-insert-x-face ()
1070 "Append X-Face, Face or X-Image-URL field to header. 1079 "Append X-Face, Face or X-Image-URL field to header.
1071If the field already exists, this function does nothing." 1080If the field already exists, this function does nothing."
1072 (when (and (file-exists-p mh-x-face-file) 1081 (when (and (stringp mh-x-face-file)
1082 (file-exists-p mh-x-face-file)
1073 (file-readable-p mh-x-face-file)) 1083 (file-readable-p mh-x-face-file))
1074 (save-excursion 1084 (save-excursion
1075 (unless (or (mh-position-on-field "X-Face") 1085 (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 @@
5 5
6;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
7;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
8;; Version: 8.5+bzr 8;; Version: 8.6
9;; Keywords: mail 9;; Keywords: mail
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -127,7 +127,7 @@
127;; Try to keep variables local to a single file. Provide accessors if 127;; Try to keep variables local to a single file. Provide accessors if
128;; variables are shared. Use this section as a last resort. 128;; variables are shared. Use this section as a last resort.
129 129
130(defconst mh-version "8.5+bzr" "Version number of MH-E.") 130(defconst mh-version "8.6" "Version number of MH-E.")
131 131
132;; Variants 132;; Variants
133 133