unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45269: Incorrect Gnus summary line number after toggle-thread and limiting
@ 2020-12-16 13:24 Pankaj Jangid
  2020-12-16 22:34 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Pankaj Jangid @ 2020-12-16 13:24 UTC (permalink / raw)
  To: 45269

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

Tags: patch

Set summary line format to display line number. Something like this,

(setq gnus-summary-line-format
      "%4P %U%R%z %-16&user-date; %(%[%4L:%*%-23,23f%]%) %B%s\n"

This will display line number in the first column.

Start Gnus and enter any group with few emails in it (better if there
are threads in it).

Invoke T-T (gnus-summary-toggle-threads) or any of the limiting
functions like /-/ (gnus-summary-limit-to-subject). These calls invoke
gnus-summary-prepare function.

And every time gnus-summary-prepare is invoked it starts increamenting
line-number from the previous max.

The result is that, on each refresh the line number keep on
increasing. And showing incorrect values.

I have moved these two lines from gnus-summary-read-group-1 to
gnus-summary-prepare function.

    (when (boundp 'gnus-pick-line-number)
      (setq gnus-pick-line-number 0))

This fixes the issue. Unless there are side-effects that I am unaware
of.

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
 of 2020-12-16 built on lt
Repository revision: fda9a2bbfd3adcce046c03bee72ba848c61a3e29
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --prefix=/home/pankaj/.local'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-summary-line-number-fix.patch --]
[-- Type: text/patch, Size: 875 bytes --]

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9488b32487..16152e252a 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -4100,8 +4100,6 @@ gnus-summary-read-group-1
      ;; The group was successfully selected.
      (t
       (gnus-set-global-variables)
-      (when (boundp 'gnus-pick-line-number)
-	(setq gnus-pick-line-number 0))
       (when (boundp 'spam-install-hooks)
 	(spam-initialize))
       ;; Save the active value in effect when the group was entered.
@@ -4226,6 +4224,8 @@ gnus-summary-prepare
 	  gnus-newsgroup-data-reverse nil)
     (gnus-run-hooks 'gnus-summary-generate-hook)
     ;; Generate the buffer, either with threads or without.
+    (when (boundp 'gnus-pick-line-number)
+      (setq gnus-pick-line-number 0))
     (when gnus-newsgroup-headers
       (gnus-summary-prepare-threads
        (if gnus-show-threads

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

* bug#45269: Incorrect Gnus summary line number after toggle-thread and limiting
  2020-12-16 13:24 bug#45269: Incorrect Gnus summary line number after toggle-thread and limiting Pankaj Jangid
@ 2020-12-16 22:34 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-16 22:34 UTC (permalink / raw)
  To: 45269

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> I have moved these two lines from gnus-summary-read-group-1 to
> gnus-summary-prepare function.
>
>     (when (boundp 'gnus-pick-line-number)
>       (setq gnus-pick-line-number 0))
>
> This fixes the issue. Unless there are side-effects that I am unaware
> of.

Looks good to me; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-12-16 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:24 bug#45269: Incorrect Gnus summary line number after toggle-thread and limiting Pankaj Jangid
2020-12-16 22:34 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).