* Re: small change suggested for mh-mm-save-part
[not found] ` <17907.1226075080@maps>
@ 2008-11-10 23:09 ` Reiner Steib
2008-11-12 11:55 ` Stephen Eglen
0 siblings, 1 reply; 2+ messages in thread
From: Reiner Steib @ 2008-11-10 23:09 UTC (permalink / raw)
To: ding; +Cc: mh-e-devel, Stephen Eglen
On Fri, Nov 07 2008, Stephen Eglen wrote:
> Dear Bill,
>
> Thanks for your comments, I was able to upload an item of the
> sourceforge site this afternoon. [...]
>
> https://sourceforge.net/tracker/index.php?func=detail&aid=2235022&group_id=13357&atid=313357
>
> I'll write to Reiner now.
Here's the code from Stephen's mail:
----------------------------------------------------------------------
;; The two lines following the three line comment are new. When
;; saving an attachment in MH-E, you are prompted for a filename.
;; With this change, you can give a directory name, and then the
;; attachment is stored in that directory, using the default name of
;; the attachment. This mirrors what happens when you save a file
;; using C-x C-w and supply a directory name.
(defun mh-mm-save-part (handle)
"Write HANDLE to a file."
(let ((name (mail-content-type-get (mm-handle-type handle) 'name))
(filename (mail-content-type-get
(mm-handle-disposition handle) 'filename))
file)
(when filename
(setq filename (file-name-nondirectory filename)))
(setq file (read-file-name "Save MIME part to: "
(or mm-default-directory
default-directory)
nil nil (or filename name "")))
(setq mm-default-directory (file-name-directory file))
;; If user entered a directory, assume that is the directory where
;; the attachment should be saved, with the default filename
;; provided in the attachment.
(when (and (file-directory-p file) filename)
(setq file (concat (file-name-as-directory file) filename)))
(and (or (not (file-exists-p file))
(yes-or-no-p (format "File %s already exists; overwrite? "
file)))
(mm-save-part-to-file handle file))))
----------------------------------------------------------------------
Stephen, MH-E's copy `mh-mm-save-part' (`lisp/mh-e/mh-gnus.el') isn't
the same as the current version `mm-save-part' in
`lisp/gnus/mm-decode.el'. Could you please provide a patch ("diff -u"
preferred) against `lisp/gnus/mm-decode.el', please?
Bill, wouldn't it make more sense to add a proper check in
`mh-mm-save-part' and simply use `mm-save-part' if Gnus is new enough.
This would avoid divergent versions. (E.g. check (fboundp
'mm-complicated-handles) or the Gnus version.)
> Bill Wohler <wohler@newt.com> wrote:
>
>> Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk> wrote:
>>
>> > Would it be okay if I committed the following extra lines to
>> > mh-mm-save-part in the CVS Emacs repository? They are the two lines
>> > following the long comment, which doesn't need to go in, but I put it
>> > there so you can see what it does.
>>
>> Hi Stephen,
>>
>> This looks like a good change. It is, however, in an awkward location
>> and time.
>>
>> 1. There is an Emacs code freeze.
>>
>> 2. I'd want the Emacs release to have a released version of MH-E.
>>
>> 3. Ordinarily, we would have dropped this function when we stop
>> supporting Emacs 21. Since this change is not present in the current
>> version of Gnus in Emacs 23, 5.13, we would then lose this
>> functionality.
>>
>> One scenario is to submit this patch at [1] and encourage Reiner to
>> incorporate this patch in the developmental version of Gnus. It could
>> then be incorporated after Emacs 23 is released. Although this is the
>> most likely scenario, this means that we'll have to support
>> mh-mm-save-part until we drop support of Emacs 23 :-(.
>>
>> Another scenario, assuming we have time (the Kepler launch is March 5 so
>> this is a grand assumption), is to add this change to both Gnus 5.13 and
>> Emacs 23, creating an MH-E 8.2 release, so that we would only have to
>> support mh-mm-save-part until we drop support of Emacs 22.
>>
>> In any event, I'd like to get Reiner's opinion before we proceed.
>>
>> 1. http://sourceforge.net/tracker/?group_id=13357&atid=313357
>>
>> --
>> Bill Wohler <wohler@newt.com> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 2+ messages in thread