From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Gnus: Indicate undownloaded parts in MIME button Date: Sat, 16 May 2020 10:52:04 +0200 Message-ID: <87sgg0feiz.fsf@gnu.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="96937"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 16 12:54:30 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jZuSc-000P6r-3A for ged-emacs-devel@m.gmane-mx.org; Sat, 16 May 2020 12:54:30 +0200 Original-Received: from localhost ([::1]:54100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZuSb-0004xC-4a for ged-emacs-devel@m.gmane-mx.org; Sat, 16 May 2020 06:54:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZuRv-0004Pg-8J for emacs-devel@gnu.org; Sat, 16 May 2020 06:53:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40082) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZuRu-0007iF-VW for emacs-devel@gnu.org; Sat, 16 May 2020 06:53:46 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:43899) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jZuRu-0006KT-Ns for emacs-devel@gnu.org; Sat, 16 May 2020 06:53:46 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 7F77B27C0054 for ; Sat, 16 May 2020 06:53:46 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 16 May 2020 06:53:46 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddttddgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesthdtredttd ertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhg qeenucggtffrrghtthgvrhhnpeetvdfgfedvhfeiffeuledvvdffuddvtefhjeekheelhf ehudetheelteejtedtheenucfkphepkeegrddufedvrdduuddtrddukeejnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvsh hmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedq thhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from thinkpad-t440p (p54846ebb.dip0.t-ipconnect.de [84.132.110.187]) by mail.messagingengine.com (Postfix) with ESMTPA id D9F883066376 for ; Sat, 16 May 2020 06:53:45 -0400 (EDT) Resent-To: emacs-devel@gnu.org Resent-From: Tassilo Horn Resent-Date: Sat, 16 May 2020 12:53:44 +0200 Resent-Message-ID: <87ftc0f8w7.fsf@fastmail.fm> Mail-Followup-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250474 Archived-At: Hi all, right now it is possible to fetch only some parts of an article by default as controlled by `nnimap-fetch-partial-articles'. I had set it to "text/" and then wondered why it seemed all attachments are broken. Well, I haven't been aware of the fact that one has to invoke `gnus-summary-show-complete-article' before being able to view/download them. Obviously, that was a usage error (I somehow assumed Gnus would download the missing parts as soon as I act on them). But that there's no indication that a part hasn't been downloaded is still a bit annoying. So I propose the following patch which makes the MIME buttons of empty parts read like [ --- image/png (undownloaded, A C to fetch.)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (the underlined part is the addition) and also mentions the binding in the help-echo. I'm no Gnus expert, so could someone have a look at that? One limitation I'm aware of is that it doesn't differentiate between "part intentionally not downloaded" and "broken zero-byte part" so it would indicate the former also for the latter, and A C would result in the very same button again. (IMHO, that's not too bad...) --8<---------------cut here---------------start------------->8--- modified lisp/gnus/gnus-art.el @@ -5833,6 +5833,7 @@ gnus-insert-mime-button "" "...")) (gnus-tmp-length (with-current-buffer (mm-handle-buffer handle) (buffer-size))) + (help-echo "mouse-2: toggle the MIME part; down-mouse-3: more options") gnus-tmp-type-long b e) (when (string-match ".*/" gnus-tmp-name) (setq gnus-tmp-name (replace-match "" t t gnus-tmp-name))) @@ -5841,6 +5842,16 @@ gnus-insert-mime-button (concat "; " gnus-tmp-name)))) (unless (equal gnus-tmp-description "") (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long))) + (when (= 0 gnus-tmp-length) + (setq gnus-tmp-type-long + (concat + gnus-tmp-type-long + (substitute-command-keys + (concat "\\ (undownloaded, " + "\\[gnus-summary-show-complete-article] to fetch.)")))) + (setq help-echo + (concat "Type \\[gnus-summary-show-complete-article] " + "to download complete article. "))) (setq b (point)) (gnus-eval-format gnus-mime-button-line-format gnus-mime-button-line-format-alist @@ -5859,8 +5870,7 @@ gnus-insert-mime-button 'keymap gnus-mime-button-map 'face gnus-article-button-face 'follow-link t - 'help-echo - "mouse-2: toggle the MIME part; down-mouse-3: more options"))) + 'help-echo help-echo))) (defvar gnus-displaying-mime nil) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo