> > +(defun notmuch-show-view-part (message-id nth &optional filename 
> > content-type )
> > +  (notmuch-with-temp-part-buffer message-id nth
> > +    ;; set mm-inlined-types to nil to force an external viewer
> > +    (let ((handle (mm-make-handle (current-buffer) (list content-type)))
> > +         (mm-inlined-types nil))
> > +      ;; We override mm-save-part as notmuch-show-save-part is better
> > +      ;; since it offers the filename
> > +      (flet ((mm-save-part (&rest args) (ignore)))
> > +           (or (mm-display-part handle)
> > +               (notmuch-show-save-part message-id nth filename 
> > content-type))))))
> > 
> > Is that a reasonable solution? 
> 
> It's *probably* safe to depend on the result of mm-display-part, but
> you can avoid the question altogether by simply calling
> notmuch-show-save-part from your flet mm-save-part.  E.g.,
> 
> (flet ((mm-save-part (&rest args) (notmuch-show-save-part 
>                                    message-id nth filename content-type)))
>   (mm-display-part handle))

Unfortunately that does not work since mm-display-part has a local
variable "filename".  I could copy the variables to some notmuch
prefixed variables but maybe there is some obvious "quoting" to avoid
the problem? (I can't easily check now as the gnu site is closed for the
day.)

Best wishes

Mark
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to