unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Re: bug#49380: 27.1; is mm-inline-message supported outside Gnus?
       [not found] <87sg0u6wcb.fsf@tethera.net>
@ 2021-07-04 15:03 ` Lars Ingebrigtsen
  2021-07-04 16:49   ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-04 15:03 UTC (permalink / raw)
  To: David Bremner; +Cc: 49380, notmuch

David Bremner <david@tethera.net> writes:

> notmuch-show-mode relies on various mm-* functions to display message
> parts. This is problematic for "message/rfc822" parts, since
> mm-inline-message ends up calling (gnus-article-prepare-display) which
> resets the buffer major-mode to gnus-article-mode since
> notmuch-show-mode is not a derived mode of gnus-article-mode. This
> breaks a few things from a notmuch internals / user point of view.  I
> can forcibly reset the major-mode, but that has it's own problems. I
> would welcome suggestions for workarounds, or clarification of the
> extent to which the functions in mm-view.el are expected to be usable
> outside gnus.

Yeah, it's confusing.  `mm-inline-message' is really an "internal" Gnus
function, while most of the other mm functions are more general.

Disentangling that mess is daunting, but for that function in
particular, I guess it wouldn't be that difficult to rewrite it to avoid
doing anything Gnus-ish unless we're in Gnus...  On the other hand, it's
a function to display a complete message, which leaves you with a buffer
that's pretty pointless unless you have a mail reader to interact with
it afterwards.

So perhaps it should just be renamed and moved to Gnus?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#49380: 27.1; is mm-inline-message supported outside Gnus?
  2021-07-04 15:03 ` bug#49380: 27.1; is mm-inline-message supported outside Gnus? Lars Ingebrigtsen
@ 2021-07-04 16:49   ` David Bremner
  2021-07-05 13:24     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-07-04 16:49 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 49380, notmuch

Lars Ingebrigtsen <larsi@gnus.org> writes:

>
> Yeah, it's confusing.  `mm-inline-message' is really an "internal" Gnus
> function, while most of the other mm functions are more general.
>
> Disentangling that mess is daunting, but for that function in
> particular, I guess it wouldn't be that difficult to rewrite it to avoid
> doing anything Gnus-ish unless we're in Gnus...  On the other hand, it's
> a function to display a complete message, which leaves you with a buffer
> that's pretty pointless unless you have a mail reader to interact with
> it afterwards.

I should have been more precise. I'm calling it indirectly via
mm-display-part, which is useful in the case where someone attaches a
message/rfc822 part to their message. In principle notmuch can (and in
the general case does) render the part directly, but in certain odd
fall-back cases it is handy to give a visual representation of the part
in the buffer without parsing etc.. ourselves.  So the user does have a
mail reader, namely notmuch. In fact I can almost make it work by
forcing the buffer back into notmuch-show-mode after calling
mm-display-part, but that has some side-effects I'd prefer to avoid.

Thanks for thinking about my (weird?) use-cases,

David





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#49380: 27.1; is mm-inline-message supported outside Gnus?
  2021-07-04 16:49   ` David Bremner
@ 2021-07-05 13:24     ` Lars Ingebrigtsen
  2021-07-06 11:37       ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-05 13:24 UTC (permalink / raw)
  To: David Bremner; +Cc: 49380, notmuch

David Bremner <david@tethera.net> writes:

> I should have been more precise. I'm calling it indirectly via
> mm-display-part, which is useful in the case where someone attaches a
> message/rfc822 part to their message. In principle notmuch can (and in
> the general case does) render the part directly, but in certain odd
> fall-back cases it is handy to give a visual representation of the part
> in the buffer without parsing etc.. ourselves.  So the user does have a
> mail reader, namely notmuch. In fact I can almost make it work by
> forcing the buffer back into notmuch-show-mode after calling
> mm-display-part, but that has some side-effects I'd prefer to avoid.

Yes, that was what I was thinking about -- the rendered embedded message
can't be easily interacted with without the mail reader being able to
hook into the rendering.  I mean, it's a kinda semi-recursive thing: You
want to be able to use (some of) the mail reader's commands to respond
to the embedded message.  Which is why `mm-inline-message' calls the
Gnus functions here.

But perhaps the function should be rewritten to call a (say)
`mm-inline-message-setup-function', bound by the caller?  Then both Gnus
and notmuch could use the function.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#49380: 27.1; is mm-inline-message supported outside Gnus?
  2021-07-05 13:24     ` Lars Ingebrigtsen
@ 2021-07-06 11:37       ` David Bremner
  2021-07-06 14:34         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-07-06 11:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 49380, notmuch

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But perhaps the function should be rewritten to call a (say)
> `mm-inline-message-setup-function', bound by the caller?  Then both Gnus
> and notmuch could use the function.

That makes sense to me, with the (perhaps obvious) caveat that calling
without binding the setup function should cleanly do the display
(perhaps with less fontification) and return.

Cheers,

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#49380: 27.1; is mm-inline-message supported outside Gnus?
  2021-07-06 11:37       ` David Bremner
@ 2021-07-06 14:34         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-06 14:34 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch, 49380

David Bremner <david@tethera.net> writes:

> That makes sense to me, with the (perhaps obvious) caveat that calling
> without binding the setup function should cleanly do the display
> (perhaps with less fontification) and return.

Yup.  I've now done the refactoring, so there should be no user-visible
changes for Gnus usage, and it should basically work outside of Gnus, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-06 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87sg0u6wcb.fsf@tethera.net>
2021-07-04 15:03 ` bug#49380: 27.1; is mm-inline-message supported outside Gnus? Lars Ingebrigtsen
2021-07-04 16:49   ` David Bremner
2021-07-05 13:24     ` Lars Ingebrigtsen
2021-07-06 11:37       ` David Bremner
2021-07-06 14:34         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).