From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: MH-E patch to support nmh 1.5 Date: Mon, 29 Sep 2014 22:27:15 -0700 Organization: Newt Software Message-ID: <87r3ytu18s.fsf@olgas.newt.com> References: <21240.1411964502@allegro.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412054872 30030 80.91.229.3 (30 Sep 2014 05:27:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2014 05:27:52 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 07:27:47 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XYpyS-000605-Io for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 07:27:44 +0200 Original-Received: from localhost ([::1]:40690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYpyS-0001Dd-6Z for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 01:27:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYpyL-0001DS-93 for emacs-devel@gnu.org; Tue, 30 Sep 2014 01:27:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYpyG-0006UQ-FL for emacs-devel@gnu.org; Tue, 30 Sep 2014 01:27:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYpyG-0006Tg-5r for emacs-devel@gnu.org; Tue, 30 Sep 2014 01:27:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XYpy9-0005qn-Gr for emacs-devel@gnu.org; Tue, 30 Sep 2014 07:27:25 +0200 Original-Received: from c-24-6-53-16.hsd1.ca.comcast.net ([24.6.53.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 07:27:25 +0200 Original-Received: from wohler by c-24-6-53-16.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 07:27:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 198 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-6-53-16.hsd1.ca.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:yqoCx6l7Wijw+cIHuSHM7YGokFg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174826 Archived-At: I have committed this change to the emacs-24 branch along with a few other documentation changes to accompany a forthcoming MH-E 8.6 release. I merged the changes back into trunk. Mike Kupfer writes: > Attached is a Bazaar bundle for emacs-24, to fix MH-E to work with > nmh-1.5 and above. This is my first Emacs submission, so apologies in > advance for any rookie mistakes. > > mike > > # Bazaar merge directive format 2 (Bazaar 0.90) > # revision_id: m.kupfer@acm.org-20140929040526-o9l4xz8v0cgv964w > # target_branch: bzr://bzr.savannah.gnu.org/emacs/emacs-24/ > # testament_sha1: dae0aa9c4d55efb8fd1f70ddff82aa23c47c1f04 > # timestamp: 2014-09-28 21:05:58 -0700 > # base_revision_id: monnier@iro.umontreal.ca-20140927162553-\ > # hjq3w3mbdp5jwa4s > # > # Begin patch > > === modified file 'lisp/mh-e/ChangeLog' > --- lisp/mh-e/ChangeLog 2014-03-17 00:50:05 +0000 > +++ lisp/mh-e/ChangeLog 2014-09-29 04:05:26 +0000 > @@ -1,3 +1,19 @@ > +2014-09-28 Mike Kupfer > + > + * mh-comp.el (mh-bare-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. > + > +2014-09-26 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. > + (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 > > === modified file 'lisp/mh-e/mh-comp.el' > --- lisp/mh-e/mh-comp.el 2014-01-01 07:43:34 +0000 > +++ lisp/mh-e/mh-comp.el 2014-09-29 04:05:26 +0000 > @@ -411,6 +411,7 @@ > (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 @@ > ;; 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 @@ > (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 @@ > (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 @@ > (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 @@ > (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") > > # Begin bundle > IyBCYXphYXI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