From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8MyaJUDRd2L7BwAAbAwnHQ (envelope-from ) for ; Sun, 08 May 2022 16:18:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0Mq3JUDRd2IWOwEAauVa8A (envelope-from ) for ; Sun, 08 May 2022 16:18:40 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 52D01261E3 for ; Sun, 8 May 2022 16:18:39 +0200 (CEST) Received: from localhost ([::1]:55010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnhk6-0000Vd-Ra for larch@yhetil.org; Sun, 08 May 2022 10:18:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnhjO-0000VF-Fg for emacs-orgmode@gnu.org; Sun, 08 May 2022 10:17:55 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:42637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnhjM-00020b-4m for emacs-orgmode@gnu.org; Sun, 08 May 2022 10:17:53 -0400 Received: by mail-oi1-x236.google.com with SMTP id w194so11491997oie.9 for ; Sun, 08 May 2022 07:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=0l/C9jS63HUdYeJhPjycwCA+pIcH3MuJvfvXSif/hOw=; b=kJkwnGsxvadel5ikB4li35tEG8cnygYipwYLDGpMgYq7JkrVQBZJolE58zVwPkO23A 1pD+mVKbD7d9Y0ecs7PUZ+2pd4rnuwU0dQ67xUJp4v2CHT2fms76gbV92+GITFYOG1xu Hxv+lA6aMx6Vt3G0YFpPU7JPpl59vJ8GWKpF4Dbu7gtqsd7k55FmXzGNbguNVv20KGMp EzVrBfQZ6KN3RWE43yXhpzrgUSd7BPo0uSTcGH1Rg53C3mjMEqZs13WdRh+aELOCo/VT 3CI06gjIevEawFjbJiG9szRUCJ8EfWEYZn9JMnaxDnBXpEfYj9H2es16zIVsBWTycYeM VEWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=0l/C9jS63HUdYeJhPjycwCA+pIcH3MuJvfvXSif/hOw=; b=WyyBtRb2NNQh2J5CkPmaG+XspAxdIzkhIQNw3hZsOLS7qbSJ2sBd4qR04HkYV8DVqi Kecf9+siGQzrxbFTb7/v44br80kAUFTwZh3RgEmDJimedySDlR5a3G62bFCsTHI6oiR4 1SSovcI38XU2RhjiKODQeh+i5szQaE4XqcQxB/xPfK0ODbhdZT+ecuRKj8DsmNmRBbuZ 4Mmj+DPVJzE3bTzzGIdThyOSauNlE7Ln2A2MIdS4kmHOLicjV45hzQdGu0cYctw29wte AJ8CQX7tqcWFM1Ubv0QDIDdkByy64jKQMoQ9jp+vfhlCDimKdrBQXvk8LD7Wt4zlkzFo fFig== X-Gm-Message-State: AOAM5312uBul+I3/X2KLsiM3x59ywzkiKnZnMGaetuUOAENC/8lhooQS 0RQXaWaJ0qnYgwFF7iZ96nM= X-Google-Smtp-Source: ABdhPJw14CJfjvPNt4eD+mQMEd/RVnVNyd4O+lDeqW5d6fV7VvdYyqy2DSZLSsoitpxCfcsKmTYG1A== X-Received: by 2002:a05:6808:f05:b0:326:887e:291a with SMTP id m5-20020a0568080f0500b00326887e291amr6804886oiw.121.1652019470892; Sun, 08 May 2022 07:17:50 -0700 (PDT) Received: from localhost ([66.154.104.4]) by smtp.gmail.com with ESMTPSA id x47-20020a056830246f00b0060603221236sm3721299otr.6.2022.05.08.07.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 07:17:50 -0700 (PDT) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [PATCH] org-attach: Attach current Gnus article parts In-Reply-To: <87a6bsp397.fsf@posteo.net> References: <87y1zdwh1k.fsf@posteo.net> <87pmkoqk9j.fsf@localhost> <87a6bsp397.fsf@posteo.net> Date: Sun, 08 May 2022 22:18:33 +0800 Message-ID: <87czgoqf9i.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=yantar92@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652019520; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0l/C9jS63HUdYeJhPjycwCA+pIcH3MuJvfvXSif/hOw=; b=oo1oXxJWfp+pm8TLWsuv47klgOyt+tKCZ80bBwf3nQc4QARx38047VL/4CP/9g6pG+xYYE kmSGhbg8uH9G2iNOxpX58MKlKF4rWSK374W2t7f35zF7aU9dAvvYfr27y4XrGhof8K6ryD nMA0942mooLehUvcSeUOvqGw7X05gKXNAeS5m6sOtvBsx/4e07boGmLhGTAaBfUJv5cw+J DW3NYAV88d9hHBdmukzcZ7xrrV3hlJnoxqyJ3My3MDDwZhSdvd3Tx9xyiRt950vHY0y/k7 EMg6MYZj9Bx8a5giCXitoGWEhI9/fdX2yHOTYZHYqAm3+erLk6V33Asdxhdsuw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652019520; a=rsa-sha256; cv=none; b=ROgnlzBvCfF0AuBq6m7nTGETLLCvkkf6CPLDEDKbmNEKXoK2usw7a9QCVhYaSlSt/B2uhj m046vKa6RxKtuTJB2XPtcfPPhtoMLIOi4ffTZGcWkaHdNt7+WferNEU1a2qSKUGe3X1hfv +TH63pvmUEikPkBRNw7psazoqZTgOA49ZTUTF6JFrAU75ZsWeFUYS5re4C+XTC5RiIQfmi raB2w4+ILwFHt13jOC3+/trK4dY3RtuQVxehPzDJytDbFIkX79RxAaKJUXmaWaU1C7dCDQ QGLTjFvhrVCAmBe5nyoCZQWfrPeZ9NM/EMJ+cjYxi2J8DH9JNtDXS3e2asQ6BQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kJkwnGsx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.81 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kJkwnGsx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 52D01261E3 X-Spam-Score: -5.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3f8tKb2gzkoh Juan Manuel Mac=C3=ADas writes: > What I don't quite understand is why it wouldn't be appropriate to add a > new entry with the new feature to the org-attach menu. Thinking about it more, new feature in org-attach menu should actually be ok. My initial logic was that we cannot easily select attach method for entries in the attach menu. However, anything other than 'cp method is meaningless when saving article attachments. > Well, as I said, I have chosen Gnus because it is part of GNU Emacs. In > any case, if anyone wants to write a patch with a more general solution, > I'd encourage them. I think that would be an interesting feature for > org-attach. I only use Gnus and unfortunately I'm not familiar with > other mail reader libraries (I could try to do something more "agnostic" > from message-mode, when I have some more time...). I think that a good example implementation is from notmuch.el. It does not use anything specific to notmuch, just built-in mm-*.el from gnus: (defun notmuch-save-attachments (mm-handle &optional queryp) (notmuch-foreach-mime-part (lambda (p) (let ((disposition (mm-handle-disposition p))) (and (listp disposition) (or (equal (car disposition) "attachment") (and (equal (car disposition) "inline") (assq 'filename disposition))) (or (not queryp) (y-or-n-p (concat "Save '" (cdr (assq 'filename disposition)) "' "))) (mm-save-part p)))) mm-handle)) (defun notmuch-foreach-mime-part (function mm-handle) (cond ((stringp (car mm-handle)) (dolist (part (cdr mm-handle)) (notmuch-foreach-mime-part function part))) ((bufferp (car mm-handle)) (funcall function mm-handle)) (t (dolist (part mm-handle) (notmuch-foreach-mime-part function part))))) Best, Ihor