From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#27084: 26.0.50; gnus-summary-toggle-header can fail to hide headers Date: Fri, 26 May 2017 14:51:45 +0200 Message-ID: <87poevpyqm.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1495803191 17201 195.159.176.226 (26 May 2017 12:53:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 May 2017 12:53:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 27084@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 26 14:53:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEEjq-0004Ky-Sq for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 May 2017 14:53:07 +0200 Original-Received: from localhost ([::1]:36605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEEjw-0005aj-B9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 May 2017 08:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEEjp-0005a9-Ci for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:53:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEEjm-00072I-7G for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:53:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEEjm-00072E-39 for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dEEjl-0003S1-QA for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 May 2017 12:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149580312313200 (code B ref -1); Fri, 26 May 2017 12:53:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 May 2017 12:52:03 +0000 Original-Received: from localhost ([127.0.0.1]:38743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEEip-0003Qq-9F for submit@debbugs.gnu.org; Fri, 26 May 2017 08:52:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEEin-0003QI-BC for submit@debbugs.gnu.org; Fri, 26 May 2017 08:52:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEEih-0006ob-8X for submit@debbugs.gnu.org; Fri, 26 May 2017 08:51:56 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEEih-0006oV-5Y for submit@debbugs.gnu.org; Fri, 26 May 2017 08:51:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEEif-00042W-TC for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:51:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEEic-0006nS-Rx for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:51:53 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:53998) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEEic-0006ma-GY for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 08:51:50 -0400 Original-Received: from rosalinde ([83.135.3.240]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LyA2L-1e2C2R0wXF-015d9S for ; Fri, 26 May 2017 14:51:46 +0200 X-Provags-ID: V03:K0:cSyLEdnv4m2M4CWGaz026IJT4dqqPNOEUpjCjZhJ908jO8oYZUs BbyfEtDkwgY6CQA/8pl1KfxEgLfAebvQJByoZFNuz4TDgIgzscjutN/wKja0SOylLqOH3GU Ul2C3o6c2I6MvlyZl1qLtaH5vP1OMM/rO/56AgdjbpMuaHYYomT6N9VgW12MYO/lqoV5NQM uOtw0teUXb8zRgnwdqhfQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ezGtOlpIZB4=:+QIjCOPzEGF73b4+HBpOzf 2XEwCFOaoe2aN9Qa+kHwK48tVcROYS4kW2UI24o5kRJb/9UwOFHCLfVGaeunB/Z2tv3Z832eV naaoCtzezbuOS1F60NCGb3NH+vhsE9Xc4L5j9NC+lmc8Qw9J/nXmXMVUG2n7bx/n6H+hJEHcQ u+oQ80ckRqSMnovtt9AOq6pqQh335yna+CRrONQBMjqSB8l0dhtGuS9aMwkRF3VMjAonuwM6a huTnNhUYgt1/aBcLoUFPEVJx6UG0H/BWdgZ3KCKFe/y8+rbOQxLfIF8/gPQQZVnHV+6PJI4w/ KxMyD50xpBZTI52u1FAZ/outr+KVAmH3WjprZ9nhdWQix950RvxPmXyz8xZ/1mpQ9JmMkj2DV SKPWkUctmvCoC65dbtn42i3lLkVaWbz40MOFGh7n/D8DWyYhhJIBKLVKcfHBadnwp1h3p20Ea or3m/S4eejLl/wCXEisnoXeMPWTyRQ/b4PcuxDfNiUcbrxhNk4gJQpjW/azLjEiFVjmwDJLrW 4uk5Unc0FqxnIEw7jV0S4PHIEdQnQp6gZ/NT4iXZ2pkRrezAdcGbg0vFz6wfznfwFP9UILm5Q /99R3ogcWTvIVq3QGQSW2axVgLWg1ip10cNtnXUtts1wbDrIWy64NWlZoxg7rR4yAwf5Zczc0 ni4/vB1VwjmzBOl0E30ZjrqiRn4c8WF3EFzF7CUjC5QFWbd2uvcs5on04YGG0ul0sacB8uO/q Poats8MYuZqbGvyndk/8O/IIjAXuBtaPRegb4CEzhkj7yTI9R3+wyOQqCpc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:132885 Archived-At: --=-=-= Content-Type: text/plain The command `gnus-summary-toggle-header' correctly shows all headers of an article in an Emacs bug report ephemeral group, but incorrectly fails to rehide the headers that are hidden by default. To reproduce: 0. emacs -Q 1. C-h f gnus-re TAB (to load Gnus, making the next command available). 2. M-x gnus-read-ephemeral-emacs-bug-group RET 27008 RET (or any bug number). 3. SPC (to display the first article, which hides some headers). 4. t (invokes `gnus-summary-toggle-header', displaying all headers of the article). 5. Typing `t' again should now rehide the headers that were not shown in step 3, but => nothing happens, i.e., all headers remain visible. The problem seems to be that after step 4, the first line of the *Article* buffer contains a header like this: >From unknown Fri May 26 08:24:49 2017 and gnus-summary-toggle-header tests for hidden headers by looking for a colon before the first space in that line; since the test fails, it treats the headers as hidden, so it doesn't hide them again. This problem also happens with other "foreign" Gnus groups; I didn't test all types but I see it e.g. with directory groups (`G d' in the Gnus *Group* buffer) and the Gnus help group (`G h'). If in all such groups the first header line is like the above but the second header line satisfies the test (it does in the cases I looked at, but I don't know if that's always so), then the patch below is probably the simplest fix. In GNU Emacs 26.0.50 (build 24, x86_64-pc-linux-gnu, GTK+ Version 3.22.8) of 2017-05-24 built on rosalinde Repository revision: bba9917299e3628e40462a762f2a14bb8df193f0 Windowing system distributor 'The X.Org Foundation', version 11.0.11901000 --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: gnus-summary-toggle-header patch diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 9bdd0c66f5..819b56e531 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9776,6 +9776,7 @@ gnus-summary-toggle-header (with-current-buffer gnus-article-buffer (widen) (article-narrow-to-head) + (forward-line) (let* ((inhibit-read-only t) (inhibit-point-motion-hooks t) (hidden (if (numberp arg) --=-=-=--