unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: notmuch <notmuch@notmuchmail.org>
Subject: [emacs] getting the text part of the body programmatically
Date: Tue, 07 May 2024 09:39:42 +0200	[thread overview]
Message-ID: <m2seyu9ikh.fsf@mac-03220211.irisa.fr> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 746 bytes --]

Hello,

The emacs interface to notmuch is great in helping me collect messages
from a public mailing list for a newsletter. I’m trying to automate more
of it, and I wonder if there is a way to get the text of the message
body programmatically in notmuch-show-mode. This is what I am doing
currently:

(defun as/notmuch-get-body ()
  (let* ((msg (notmuch-show-get-message-properties))
         (part (notmuch-show-get-part-properties)))
    (notmuch-get-bodypart-text msg part nil)))

It works, but I first have to put the cursor in the part for the
`notmuch-show-get-part-properties' to work. Is there a way to get the
text part of the body without moving the cursor (i.e., when it is still
in the headers)?

Thanks,

Alan

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



                 reply	other threads:[~2024-05-07  7:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2seyu9ikh.fsf@mac-03220211.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).