From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#34387: 26.1; Gnus: handle empty message parts Date: Fri, 15 Feb 2019 07:50:14 +0900 Organization: Emacsen advocacy group Message-ID: References: <87ef8igwdw.fsf@poincare.umons.ac.be> <87ftstea3o.fsf@poincare.umons.ac.be> <874l97bnvv.fsf@poincare.umons.ac.be> <87h8d6o8lx.fsf@poincare.umons.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="187862"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-cygwin) Cc: 34387@debbugs.gnu.org To: Christophe.Troestler@umons.ac.be Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 14 23:51:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guPqY-000mjG-NT for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 23:51:10 +0100 Original-Received: from localhost ([127.0.0.1]:56287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPqX-000152-LH for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 17:51:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPqR-00014m-08 for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 17:51:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guPqQ-0006Ga-5Z for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 17:51:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49187) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guPqQ-0006GS-1S for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 17:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1guPqP-0007lY-N2 for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 17:51:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87ef8igwdw.fsf@poincare.umons.ac.be> Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Feb 2019 22:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34387 X-GNU-PR-Package: emacs Original-Received: via spool by 34387-submit@debbugs.gnu.org id=B34387.155018463229814 (code B ref 34387); Thu, 14 Feb 2019 22:51:01 +0000 Original-Received: (at 34387) by debbugs.gnu.org; 14 Feb 2019 22:50:32 +0000 Original-Received: from localhost ([127.0.0.1]:48468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPpu-0007km-NR for submit@debbugs.gnu.org; Thu, 14 Feb 2019 17:50:31 -0500 Original-Received: from insect.birch.relay.mailchannels.net ([23.83.209.93]:18505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPpq-0007ka-Mo for 34387@debbugs.gnu.org; Thu, 14 Feb 2019 17:50:27 -0500 X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7209E502E8E; Thu, 14 Feb 2019 22:50:24 +0000 (UTC) Original-Received: from hampton.hostforweb.net (unknown [100.96.29.126]) (Authenticated sender: tih5qno0ow) by relay.mailchannels.net (Postfix) with ESMTPA id C37A5504215; Thu, 14 Feb 2019 22:50:20 +0000 (UTC) X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from hampton.hostforweb.net (hampton.hostforweb.net [172.245.115.217]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 14 Feb 2019 22:50:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net X-MailChannels-Auth-Id: tih5qno0ow X-Fumbling-Imminent: 1e75dcd81cd5bdad_1550184621158_366289495 X-MC-Loop-Signature: 1550184621158:1605252021 X-MC-Ingress-Time: 1550184621158 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:60000 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1guPpd-004RQC-Fc; Thu, 14 Feb 2019 16:50:14 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:Uoh8rJrL3C3DN/ZBBv/IgQq8cqM= X-OutGoing-Spam-Status: No, score=-0.2 X-AuthUser: yamaoka@hampton.hostforweb.net 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155427 Archived-At: On Thu, 14 Feb 2019 13:30:34 +0100, Christophe Troestler wrote: > The point is to delete all trailing whitespace coming from the > conversion of HTML to text. Without this, some emails (such as the > one attached) are hard to read because the lines end with so many > whitespaces that they take several lines on the screen (filled with > spaces). The following does what I want (and does not trigger the > bug, thanks to the narrowing). > (define-advice mm-shr (:around (oldfn &rest handle) delete-trailing-whitespace) > "Delete leading and trailing whitespace in Gnus article buffer." > (when (derived-mode-p 'gnus-article-mode) > (save-restriction > (narrow-to-region (point) (point)) > (apply oldfn handle) > (delete-trailing-whitespace)))) I see. But, sorry, I meant to do first was: (define-advice mm-shr (:around (oldfn &rest handle) delete-trailing-whitespace) "Delete leading and trailing whitespace in Gnus article buffer." (if (derived-mode-p 'gnus-article-mode) (save-restriction (narrow-to-region (point) (point)) (apply oldfn handle) (delete-trailing-whitespace)) (apply oldfn handle))) That is, not to do the whitespace deletion when mm-shr is used in other than Gnus as it might require whitespace. Anyway the (when ...) way makes mm-shr work only in the Gnus article buffer. :-p Regards,