all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27084: 26.0.50; gnus-summary-toggle-header can fail to hide headers
@ 2017-05-26 12:51 Stephen Berman
  2017-07-20  7:17 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Berman @ 2017-05-26 12:51 UTC (permalink / raw)
  To: 27084

[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]

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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-summary-toggle-header patch --]
[-- Type: text/x-patch, Size: 422 bytes --]

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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-20  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-26 12:51 bug#27084: 26.0.50; gnus-summary-toggle-header can fail to hide headers Stephen Berman
2017-07-20  7:17 ` Katsumi Yamaoka
2017-07-20  8:44   ` Stephen Berman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.