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: Mon, 10 Feb 2020 11:29:23 -0800 Message-ID: <87r1z2kzqk.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11654"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 39543@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 10 20:30:13 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 1j1El3-0002vW-E0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 20:30:13 +0100 Original-Received: from localhost ([::1]:37786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1El2-00062k-0t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 14:30:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46987) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Ekt-00062J-T1 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:30:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Eks-0001ll-Np for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1Eks-0001lO-Km for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1Eks-0001cg-EZ for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Feb 2020 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39543 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15813629726182 (code B ref -1); Mon, 10 Feb 2020 19:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Feb 2020 19:29:32 +0000 Original-Received: from localhost ([127.0.0.1]:55423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1EkO-0001be-33 for submit@debbugs.gnu.org; Mon, 10 Feb 2020 14:29:32 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:57993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1EkL-0001bW-Vj for submit@debbugs.gnu.org; Mon, 10 Feb 2020 14:29:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45698) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1EkK-00060c-Q5 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:29:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1EkJ-0000xp-Me for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:29:28 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:48060 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1EkJ-0000wf-IP for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 14:29:27 -0500 Original-Received: from localhost (unknown [205.175.106.48]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 46438FA12C for ; Mon, 10 Feb 2020 19:29:25 +0000 (UTC) In-Reply-To: (Filipp Gunbin's message of "Mon, 10 Feb 2020 16:19:13 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:175893 Archived-At: --=-=-= Content-Type: text/plain Filipp Gunbin 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. 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. 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. Let's see if anyone has any comments. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gnus-save-mime-completion.diff diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a47e657623..39d9ad5057 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -12508,10 +12508,12 @@ gnus-summary-save-parts "Save parts matching TYPE to DIR. If REVERSE, save parts that do not match TYPE." (interactive - (list (read-string "Save parts of type: " - (or (car gnus-summary-save-parts-type-history) - gnus-summary-save-parts-default-mime) - 'gnus-summary-save-parts-type-history) + (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) (setq gnus-summary-save-parts-last-directory (read-directory-name "Save to directory: " gnus-summary-save-parts-last-directory --=-=-=--