bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27084: 26.0.50; gnus-summary-toggle-header can fail to hide headers


From: Stephen Berman
Subject: bug#27084: 26.0.50; gnus-summary-toggle-header can fail to hide headers
Date: Fri, 26 May 2017 14:51:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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


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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]