From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#39543: 28.0.50; Add completion to gnus-summary-save-parts from mime parts in the message Date: Thu, 20 Feb 2020 08:31:48 -0800 Message-ID: <87h7zl8bkb.fsf@ericabrahamsen.net> References: <87r1z2kzqk.fsf@ericabrahamsen.net> <87r1yp5s03.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68261"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 39543@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 20 17:32:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4okF-000Hb7-54 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Feb 2020 17:32:11 +0100 Original-Received: from localhost ([::1]:45638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4okE-0002BJ-7x for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Feb 2020 11:32:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58802) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4ok7-0002Ay-3a for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 11:32:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4ok5-0003uB-Vd for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 11:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4ok5-0003u6-S4 for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 11:32:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4ok5-00061P-OK for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 11:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Feb 2020 16:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39543 X-GNU-PR-Package: emacs Original-Received: via spool by 39543-submit@debbugs.gnu.org id=B39543.158221631922988 (code B ref 39543); Thu, 20 Feb 2020 16:32:01 +0000 Original-Received: (at 39543) by debbugs.gnu.org; 20 Feb 2020 16:31:59 +0000 Original-Received: from localhost ([127.0.0.1]:45720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4ok2-0005yK-Ey for submit@debbugs.gnu.org; Thu, 20 Feb 2020 11:31:58 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:47746 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4ok0-0005tQ-Nf for 39543@debbugs.gnu.org; Thu, 20 Feb 2020 11:31:57 -0500 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 1BE58FA9B0; Thu, 20 Feb 2020 16:31:50 +0000 (UTC) In-Reply-To: <87r1yp5s03.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 20 Feb 2020 14:05:00 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176299 Archived-At: On 02/20/20 14:05 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >>> As gnus-summary-save-parts (X m) is invoked on the article, it could >>> offer completion based on what mime parts are present in the article. > > Sounds like a good idea, but is probably not practical, since it would > mean that Gnus would have to retrieve all the process-marked articles > first to do the prompting. If there's only a single article in the > list, then it would be fine. Well I did say it was a "dumb" version :) I hadn't considered the case of multiple articles. Just for the sake of argument: if we're expecting to save parts from some of the process-marked articles, aren't we going to need to fetch them all, anyway? >> I've attached a "dumb" version of what that could look like. >> >> Two notes: >> >> 1. This would obsolete `gnus-summary-save-parts-default-mime'. >> Personally I think that's totally fine: between completion and >> a history variable, I don't see any use for a default >> value. > > I think that variable is useful. In practice, people are interested in > saving only certain types (images for some, pdfs for others), and being > able to hit RET to do just that is nice. This is particularly the case > when using the command over a large set of messages (typically, all the > messages in the summary buffer). I still think that combining "the mimetype we saved last time" with "what's actually present and saveable" mostly obviates any generally preferred mimetype. But I don't feel strongly about this at all, and there's no great need to remove that variable. >> 2. If we go this route, it would be nice to extend it so that, for >> instance, if _any_ image/ media types are present, we also manually >> add a "image/*" entry to the completion collection. Or for maximum >> OCD, only add that "image/*" entry if there are more than one image/ >> type handles present. Matches are not required, so you could always >> just type in your own regexp, anyway. > > Adding foo/* variants if several different foo/s are in there would be nice. > >> + (list (completing-read "Save parts of type: " >> + (gnus-eval-in-buffer-window gnus-article-buffer >> + (delete-dups >> + (mapcar (lambda (h) (mm-handle-media-type (cdr h))) >> + gnus-article-mime-handle-alist))) >> + nil nil nil 'gnus-summary-save-parts-type-history) > > This only deals with types in the current article? The message may not > even be selected, so (in addition to not working on sets of articles), > it would not work if the user hasn't selected an article? Right, like I said this was more a proof of concept than a working solution. If you think there's a practical improvement to be made in here, I'd be happy to work on it. Eric