Hi, (for example) cron sends me programs' outputs with the head- ers: | MIME-Version: 1.0 | Content-Type: text/plain; charset=UTF-8 I want to copy the output to a new buffer and then do some stuff there. O b (gnus-summary-save-article-body-file) will a) save the article body "washed", i. e. for example word-wrapped & Co. and b) prepend "X-Gnus-Coding-System: -*- coding: utf-8; -*-" (?). C-o (gnus-summary-save-article-mail) will a) save the head- ers as well and b) not decode the body (which is probably not a problem for "text/plain; charset=UTF-8", but still). (O f (gnus-summary-save-article-file) seems to be doing the same as O b, o (gnus-summary-save-article) the same as C-o.) Both commands have the disadvantage of saving the article to a file which I have to then visit, edit, save, delete in- stead of just creating a new buffer. How can I copy the "raw", but decoded article body to a new buffer? TIA, Tim _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Tim Landscheidt <tim@tim-landscheidt.de> writes: > How can I copy the "raw", but decoded article body to a new > buffer? `C-u C-u g' and then `C-x C-w' the buffer to a file? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Lars Ingebrigtsen <larsi@gnus.org> wrote: >> How can I copy the "raw", but decoded article body to a new >> buffer? > `C-u C-u g' and then `C-x C-w' the buffer to a file? (I have used C-u g thousands of times, but was never aware of C-u C-u g; thanks :-).) 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? Tim _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
On Sun, 24 Nov 2019 15:59:31 +0000 Tim Landscheidt 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") -- Štěpán _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Š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
I wrote: > […] > 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".) Two more issues related to that: - "(gnus-summary-show-article '(16))" will trigger gnus-select-article-hook, so to call the former in the latter, I had to wrap that in "(let (gnus-select-article-hook) […])". Is there a better/re- commended way to solve that? - gnus-summary-show-article will switch to the *Summary* buffer, so in "(gnus-with-article-buffer (gnus-summary-show-article '(16)) (something-else))" something-else will be executed in the *Summary* buffer, therefore I had to wrap that in another gnus-with-article-buffer form. However, when executed in the *Article* buffer, C-u C-u g will stay there. Is this a bug? Tim _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english