Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, info-gnus-english@gnu.org
Subject: Re: How to copy "raw", but decoded article body to a new buffer?
Date: Sun, 24 Nov 2019 22:29:35 +0000	[thread overview]
Message-ID: <87v9r87vsg.fsf@passepartout.tim-landscheidt.de> (raw)
In-Reply-To: <87lfs5q8ej.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Sun, 24 Nov 2019 22:19:48 +0100")

Štěpán Němec <stepnem@gmail.com> wrote:

>> That works fine when I type C-u C-u g, however when I run

>> | M-: (gnus-summary-show-article 16) RET

>> I get prompted "View as charset:" which somewhat defeats the
>> purpose of automation.

>> Any advice for that?

> (gnus-summary-show-article 16) ≊ C-u 16 g

> C-u C-u g ≊ (gnus-summary-show-article '(16))

> Cf. (info "(elisp)Prefix Command Arguments")

Ah!  With that, something like:

| (defun tl-ab2nb nil
|   (interactive)
|   (gnus-summary-show-article '(16))
|   (gnus-summary-select-article-buffer)
|   (article-goto-body)
|   (copy-to-buffer (generate-new-buffer "article body") (point) (point-max)))

works nicely.  (Only nitpick: Gnus adds a trailing newline,
i. e. the function above applied to a mail generated by
"echo echo Test | at now" produces a buffer with
"Test\n\n".)

Thanks,
Tim

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  reply	other threads:[~2019-11-24 22:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 11:35 Tim Landscheidt
2019-11-23 12:08 ` Lars Ingebrigtsen
2019-11-24 15:59   ` Tim Landscheidt
2019-11-24 21:19     ` Štěpán Němec
2019-11-24 22:29       ` Tim Landscheidt [this message]
2019-12-02  8:08         ` Tim Landscheidt

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

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

  git send-email \
    --in-reply-to=87v9r87vsg.fsf@passepartout.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=info-gnus-english@gnu.org \
    --cc=larsi@gnus.org \
    --cc=stepnem@gmail.com \
    /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.
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 NNTP newsgroup(s).