* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
@ 2024-04-26 3:32 James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 4:34 ` Eric Abrahamsen
0 siblings, 1 reply; 10+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-26 3:32 UTC (permalink / raw)
To: 70579; +Cc: Eric Abrahamsen
- (Preferably starting with an empty drafts folder) Compose a message
and save it.
- Open the drafts group, press e on the message and then kill the new
buffer; then (incidentally, if you now do '/ N' then this bug does not
arise) delete the message (B DEL)
- Press q
- The message count is wrong (but can be corrected with M-g)
cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2024-03-19 built on
user-Inspiron-15-5518
Repository revision: 88355de6022458c3e890cc6d5da60d6f35fe8868
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LANG: en_IN
value of $XMODIFIERS: @im=ibus
locale-coding-system: iso-latin-1-unix
Major mode: Summary
Minor modes in effect:
buffer-face-mode: t
hl-line-mode: t
display-time-mode: t
desktop-environment-mode: t
server-mode: t
recentf-mode: t
erc-track-mode: t
erc-ring-mode: t
erc-netsplit-mode: t
erc-menu-mode: t
erc-match-mode: t
erc-log-mode: t
erc-list-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
erc-move-to-prompt-mode: t
erc-readonly-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-stamp-mode: t
erc-autojoin-mode: t
midnight-mode: t
icomplete-mode: t
fido-mode: t
erc-networks-mode: t
display-battery-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
~/.emacs.d/lisp/lexic hides /home/user/.emacs.d/elpa/lexic-0.0.1/lexic
/home/user/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /home/user/code/emacs-master/lisp/bind-key
/home/user/.emacs.d/elpa/transient-20231205.1848/transient hides /home/user/code/emacs-master/lisp/transient
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-jump hides /home/user/code/emacs-master/lisp/use-package/use-package-jump
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-ensure hides /home/user/code/emacs-master/lisp/use-package/use-package-ensure
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-lint hides /home/user/code/emacs-master/lisp/use-package/use-package-lint
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-core hides /home/user/code/emacs-master/lisp/use-package/use-package-core
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package hides /home/user/code/emacs-master/lisp/use-package/use-package
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-delight hides /home/user/code/emacs-master/lisp/use-package/use-package-delight
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-bind-key hides /home/user/code/emacs-master/lisp/use-package/use-package-bind-key
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-diminish hides /home/user/code/emacs-master/lisp/use-package/use-package-diminish
/home/user/.emacs.d/elpa/ox-odt-9.6.620/ox-odt hides /home/user/code/emacs-master/lisp/org/ox-odt
~/code/tramp/lisp/tramp-uu hides /home/user/code/emacs-master/lisp/net/tramp-uu
~/code/tramp/lisp/tramp-rclone hides /home/user/code/emacs-master/lisp/net/tramp-rclone
~/code/tramp/lisp/tramp-gvfs hides /home/user/code/emacs-master/lisp/net/tramp-gvfs
~/code/tramp/lisp/tramp-integration hides /home/user/code/emacs-master/lisp/net/tramp-integration
~/code/tramp/lisp/tramp-container hides /home/user/code/emacs-master/lisp/net/tramp-container
~/code/tramp/lisp/tramp-sh hides /home/user/code/emacs-master/lisp/net/tramp-sh
~/code/tramp/lisp/tramp-sshfs hides /home/user/code/emacs-master/lisp/net/tramp-sshfs
~/code/tramp/lisp/tramp hides /home/user/code/emacs-master/lisp/net/tramp
~/code/tramp/lisp/tramp-sudoedit hides /home/user/code/emacs-master/lisp/net/tramp-sudoedit
~/code/tramp/lisp/tramp-message hides /home/user/code/emacs-master/lisp/net/tramp-message
~/code/tramp/lisp/tramp-androidsu hides /home/user/code/emacs-master/lisp/net/tramp-androidsu
~/code/tramp/lisp/trampver hides /home/user/code/emacs-master/lisp/net/trampver
~/code/tramp/lisp/tramp-archive hides /home/user/code/emacs-master/lisp/net/tramp-archive
~/code/tramp/lisp/tramp-fuse hides /home/user/code/emacs-master/lisp/net/tramp-fuse
~/code/tramp/lisp/tramp-adb hides /home/user/code/emacs-master/lisp/net/tramp-adb
~/code/tramp/lisp/tramp-crypt hides /home/user/code/emacs-master/lisp/net/tramp-crypt
~/code/tramp/lisp/tramp-compat hides /home/user/code/emacs-master/lisp/net/tramp-compat
~/code/tramp/lisp/tramp-cmds hides /home/user/code/emacs-master/lisp/net/tramp-cmds
~/code/tramp/lisp/tramp-cache hides /home/user/code/emacs-master/lisp/net/tramp-cache
~/code/tramp/lisp/tramp-ftp hides /home/user/code/emacs-master/lisp/net/tramp-ftp
~/code/tramp/lisp/tramp-smb hides /home/user/code/emacs-master/lisp/net/tramp-smb
~/code/tramp/lisp/tramp-loaddefs hides /home/user/code/emacs-master/lisp/net/tramp-loaddefs
Features:
(shadow emacsbug qp bbdb-message proced mpv tq org-timer org-clock
org-indent reddigg ht request promise promise-rejection-tracking
promise-finally promise-done promise-es6-extensions promise-core
ind-util quail rect pcmpl-unix tramp-adb deeper-blue-theme package-vc
ffap ellama cus-start spinner ellama-autoloads llm-gpt4all llm-ollama
llm-gemini llm-fake ert llm-openai llm-vertex llm-provider-utils
llm-request llm llm-autoloads warnings spinner-autoloads loaddefs-gen
tar-mode arc-mode archive-mode lisp-mnt org-element org-persist org-id
org-refile avl-tree oc-basic ol-w3m ol-mhe ol-irc ol-info ol-gnus
nnselect ol-eww ol-docview doc-view filenotify jka-compr image-mode exif
ol-bibtex bibtex ol-bbdb org org-macro org-pcomplete org-list
org-footnote org-faces org-entities noutline outline org-version
ob-shell ob-dot ob-R ob-python ob ob-tangle org-src ob-ref ob-lob
ob-table ob-exp ob-comint ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol org-fold org-fold-core org-keys oc org-loaddefs org-compat
org-macs sh-script smie executable etags fileloop info-look lpr debug
backtrace magit-base magit-section dash tabify imenu man em-rebind
em-smart em-tramp pulse xref wgrep find-dired grep bug-reference
find-func shortdoc comp-common help-fns radix-tree apropos tramp-cmds
tramp-cache time-stamp tramp-sh dired-aux em-unix em-term term ehelp
em-script em-prompt em-pred em-ls em-hist em-glob em-extpipe
em-elecslash em-cmpl em-dirs em-basic em-banner em-alias esh-mode
esh-var eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util vc-hg vc-git diff-mode vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs vc-dir ewoc sort gnus-cite smiley mail-extr
gnus-async gnus-bcklg face-remap gnus-ml hl-line disp-table nnrss
mm-archive nnatom nnfeed utf-7 epa-file nnagent nnml cursor-sensor
nndraft nnmh nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache gnus-sum gnus-group gnus-undo bbdb-gnus bbdb-mua bbdb-com crm
bbdb bbdb-site timezone auth-source-xoauth2 auth-source-pass smtpmail
gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo
gnus-spec gnus-int gnus-range message sendmail yank-media dired
dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win cl-print
display-line-numbers timer-list hippie-exp shr-color color textsec
uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check
gnutls network-stream url-http mail-parse rfc2231 rfc2047 rfc2045
ietf-drums url-gw nsm url-cache url-auth mule-util eww-history-ext
derived eww-history-ext-dyn eww url-queue shr pixel-fill kinsoku
url-file svg dom puny mm-url gnus nnheader gnus-util mail-utils range
mm-util mail-prsvr thingatpt compile text-property-search python project
treesit inheritenv buffer-env misearch multi-isearch vc-backup log-view
pcvs-util vc vc-dispatcher diff time diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs keychain-environment exwm-ns cus-edit pp icons
tramp trampver tramp-integration files-x tramp-message tramp-compat xdg
parse-time iso8601 tramp-loaddefs rx native-complete shell edmacro
desktop-environment exwm-systemtray xcb-systemtray xcb-xembed exwm
exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor
xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb
xcb-xproto xcb-types xcb-debug kmacro server cl-extra help-mode advice
recentf tree-widget erc-track erc-ring erc-netsplit erc-menu erc-match
erc-log erc-list erc-goodies erc-pcomplete time-date pcomplete comint
ansi-osc ansi-color ring erc-button erc-fill erc-stamp wid-edit erc-join
midnight icomplete erc format-spec erc-backend erc-networks erc-common
erc-compat compat erc-loaddefs battery dbus xml cus-load use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core
base32-autoloads bash-completion-autoloads buffer-env-autoloads
comint-mime-autoloads company-autoloads consult-gh-embark-autoloads
coterm-autoloads daemons-autoloads detached-autoloads docker-autoloads
aio-autoloads dumb-jump-autoloads eat-autoloads eglot-java-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
enwc-autoloads exwm-firefox-core-autoloads exwm-ns-autoloads finder-inf
fedi-autoloads firefox-javascript-repl-autoloads forge-autoloads
closql-autoloads emacsql-autoloads ghub-autoloads gnus-mock-autoloads
inheritenv-autoloads keychain-environment-autoloads lexic-autoloads
pcase markdown-mode-autoloads mpv-autoloads native-complete-autoloads
org-mime-autoloads org-pdfview-autoloads org-present-autoloads
org-remark-autoloads osm-autoloads ox-odt-autoloads pdf-tools-autoloads
popup-autoloads python-view-data-autoloads csv-mode-autoloads
pythonic-autoloads realgud-ipdb-autoloads realgud-autoloads
realgud-recursive-autoloads loc-changes-autoloads
load-relative-autoloads reddigg-autoloads ht-autoloads promise-autoloads
request-autoloads restclient-autoloads s-autoloads test-simple-autoloads
transient-autoloads treepy-autoloads vc-backup-autoloads wgrep-autoloads
info yaml-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process emacs)
Memory information:
((conses 16 3067174 456353) (symbols 48 57687 14)
(strings 32 499786 28268) (string-bytes 1 42406989)
(vectors 16 181322) (vector-slots 8 2511916 350646)
(floats 8 643 10877) (intervals 56 257891 9877) (buffers 992 107))
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-04-26 3:32 bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-04-26 4:34 ` Eric Abrahamsen
2024-05-09 7:19 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2024-04-26 4:34 UTC (permalink / raw)
To: 70579; +Cc: jimjoe
James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
> - (Preferably starting with an empty drafts folder) Compose a message
> and save it.
> - Open the drafts group, press e on the message and then kill the new
> buffer; then (incidentally, if you now do '/ N' then this bug does not
> arise) delete the message (B DEL)
> - Press q
> - The message count is wrong (but can be corrected with M-g)
>
> cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
Thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-04-26 4:34 ` Eric Abrahamsen
@ 2024-05-09 7:19 ` Eli Zaretskii
2024-05-10 4:00 ` Eric Abrahamsen
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-05-09 7:19 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: 70579, jimjoe
Ping! Eric, can we make some progress here?
> Cc: jimjoe@gmx.net
> From: Eric Abrahamsen <eric@ericabrahamsen.net>
> Date: Thu, 25 Apr 2024 21:34:45 -0700
>
> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
> > - (Preferably starting with an empty drafts folder) Compose a message
> > and save it.
> > - Open the drafts group, press e on the message and then kill the new
> > buffer; then (incidentally, if you now do '/ N' then this bug does not
> > arise) delete the message (B DEL)
> > - Press q
> > - The message count is wrong (but can be corrected with M-g)
> >
> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
>
> Thanks!
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-09 7:19 ` Eli Zaretskii
@ 2024-05-10 4:00 ` Eric Abrahamsen
2024-05-10 4:14 ` Eric Abrahamsen
0 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2024-05-10 4:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 70579, jimjoe
Eli Zaretskii <eliz@gnu.org> writes:
> Ping! Eric, can we make some progress here?
>
>> Cc: jimjoe@gmx.net
>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Thu, 25 Apr 2024 21:34:45 -0700
>>
>> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
>> text editors" <bug-gnu-emacs@gnu.org> writes:
>>
>> > - (Preferably starting with an empty drafts folder) Compose a message
>> > and save it.
>> > - Open the drafts group, press e on the message and then kill the new
>> > buffer; then (incidentally, if you now do '/ N' then this bug does not
>> > arise) delete the message (B DEL)
>> > - Press q
>> > - The message count is wrong (but can be corrected with M-g)
>> >
>> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
I've made some progress here -- the root of the problem seems to be
that, when we hit "e" in the draft summary buffer to resume editing a
draft, Gnus "jumps ahead" in message numbers. Basically what "editing"
actually means is that the old draft is deleted, and a new draft is
started, but the new draft has a article number that's the previous
draft's number + 2, and the "draft" group's active number is also
inflated (for instance (12 . 14) when it should be (12 . 13)). I was
also able to get it to jump three numbers in some cases.
From this point, *any* normal usage will end up correcting the error:
using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as
you noted any of the commands that lead to refreshing the unread count.
But if you don't use any of those commands, you'll see the inflated
active/unread count when you get back to the *Group* buffer (the "B DEL"
isn't necessary for the recipe, and in fact at that stage the message
under point has already been deleted).
That's as far as I've gotten, and I'll keep working on why the article
number starts off inflated. But in the meantime, the solution is "don't
do that".
Eric
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 4:00 ` Eric Abrahamsen
@ 2024-05-10 4:14 ` Eric Abrahamsen
2024-05-10 6:23 ` Eric Abrahamsen
2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 10+ messages in thread
From: Eric Abrahamsen @ 2024-05-10 4:14 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 70579, jimjoe
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Ping! Eric, can we make some progress here?
>>
>>> Cc: jimjoe@gmx.net
>>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>>> Date: Thu, 25 Apr 2024 21:34:45 -0700
>>>
>>> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
>>> text editors" <bug-gnu-emacs@gnu.org> writes:
>>>
>>> > - (Preferably starting with an empty drafts folder) Compose a message
>>> > and save it.
>>> > - Open the drafts group, press e on the message and then kill the new
>>> > buffer; then (incidentally, if you now do '/ N' then this bug does not
>>> > arise) delete the message (B DEL)
>>> > - Press q
>>> > - The message count is wrong (but can be corrected with M-g)
>>> >
>>> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
>
> I've made some progress here -- the root of the problem seems to be
> that, when we hit "e" in the draft summary buffer to resume editing a
> draft, Gnus "jumps ahead" in message numbers. Basically what "editing"
> actually means is that the old draft is deleted, and a new draft is
> started, but the new draft has a article number that's the previous
> draft's number + 2, and the "draft" group's active number is also
> inflated (for instance (12 . 14) when it should be (12 . 13)). I was
> also able to get it to jump three numbers in some cases.
>
>>From this point, *any* normal usage will end up correcting the error:
> using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as
> you noted any of the commands that lead to refreshing the unread count.
> But if you don't use any of those commands, you'll see the inflated
> active/unread count when you get back to the *Group* buffer (the "B DEL"
> isn't necessary for the recipe, and in fact at that stage the message
> under point has already been deleted).
>
> That's as far as I've gotten, and I'll keep working on why the article
> number starts off inflated. But in the meantime, the solution is "don't
> do that".
Sorry, that sounded a bit unfriendly, when I was the one who asked you
to submit the bug report! An hour or two of chasing Gnus function calls
will do that to you...
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 4:14 ` Eric Abrahamsen
@ 2024-05-10 6:23 ` Eric Abrahamsen
2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 10+ messages in thread
From: Eric Abrahamsen @ 2024-05-10 6:23 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 70579, jimjoe
[-- Attachment #1: Type: text/plain, Size: 4596 bytes --]
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>> Ping! Eric, can we make some progress here?
>>>
>>>> Cc: jimjoe@gmx.net
>>>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>>>> Date: Thu, 25 Apr 2024 21:34:45 -0700
>>>>
>>>> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
>>>> text editors" <bug-gnu-emacs@gnu.org> writes:
>>>>
>>>> > - (Preferably starting with an empty drafts folder) Compose a message
>>>> > and save it.
>>>> > - Open the drafts group, press e on the message and then kill the new
>>>> > buffer; then (incidentally, if you now do '/ N' then this bug does not
>>>> > arise) delete the message (B DEL)
>>>> > - Press q
>>>> > - The message count is wrong (but can be corrected with M-g)
>>>> >
>>>> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
>>
>> I've made some progress here -- the root of the problem seems to be
>> that, when we hit "e" in the draft summary buffer to resume editing a
>> draft, Gnus "jumps ahead" in message numbers. Basically what "editing"
>> actually means is that the old draft is deleted, and a new draft is
>> started, but the new draft has a article number that's the previous
>> draft's number + 2, and the "draft" group's active number is also
>> inflated (for instance (12 . 14) when it should be (12 . 13)). I was
>> also able to get it to jump three numbers in some cases.
>>
>>>>From this point, *any* normal usage will end up correcting the error:
>> using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as
>> you noted any of the commands that lead to refreshing the unread count.
>> But if you don't use any of those commands, you'll see the inflated
>> active/unread count when you get back to the *Group* buffer (the "B DEL"
>> isn't necessary for the recipe, and in fact at that stage the message
>> under point has already been deleted).
>>
>> That's as far as I've gotten, and I'll keep working on why the article
>> number starts off inflated. But in the meantime, the solution is "don't
>> do that".
>
> Sorry, that sounded a bit unfriendly, when I was the one who asked you
> to submit the bug report! An hour or two of chasing Gnus function calls
> will do that to you...
Okay, I found two things, one the proximate cause of this bug, another
"probably wrong" adjacent issue.
The main problem is that `gnus-draft-setup' both calls `message-mode'
(which calls `message-set-auto-save-file-name'), and then directly calls
`message-set-auto-save-file-name' itself. Without getting into horrible
details, that functions shouldn't be called twice, because it generates
an extra numerical file name, which ends up inflating the active value
of the drafts group.
I've attached a patch that removes the second call. If you feel
comfortable applying and testing patches, I hope you'll try it. In my
experiments it fixes the problem.
The patch also semi-addresses the second issue. When saving a draft,
message-mode only buries the buffer, it doesn't delete it. If you go
back and start editing the draft, `gnus-draft-check-draft-articles' is
supposed to see if a there's already a buffer visiting the draft file,
and return you to that buffer instead of creating a new one. But it only
does that if the buffer is modified, which it isn't if you've
saved/buried the draft.
I don't see why that should mean that you need a whole new buffer for
editing the message, and the fact that there are now two "copies" of the
message buffer causes further problems with the inflating article
numbers (why I could sometimes see three or even four "jumps").
The patch removes the check for modification, and in my brief testing
behaves the way I would expect it to.
That whole part of the code is weird:
(let ((buffers (buffer-list))
file buffs buff)
(save-current-buffer
(while (and articles
(not buff))
(setq file (nndraft-article-filename (pop articles))
buffs buffers)
(while buffs
(set-buffer (setq buff (pop buffs)))
(if (and buffer-file-name
(equal (file-remote-p file)
(file-remote-p buffer-file-name))
(string-equal (file-truename buffer-file-name)
(file-truename file))
; (buffer-modified-p)
)
(setq buffs nil)
(setq buff nil)))))
That seems like a very long way of writing `find-buffer-visiting'. Maybe
the remote check should be carried over, but otherwise this seems very
replaceable.
Anyway, please let me know if you can check the patch.
Eric
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-draft-fixes.diff --]
[-- Type: text/x-patch, Size: 928 bytes --]
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 1fc2b33fffb..406ff705f3d 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -262,8 +262,7 @@ gnus-draft-setup
(setq ga
(message-fetch-field gnus-draft-meta-information-header)))
(insert mail-header-separator)
- (forward-line 1)
- (message-set-auto-save-file-name))))
+ (forward-line 1))))
(gnus-backlog-remove-article group narticle)
(when (and ga
(ignore-errors (setq ga (car (read-from-string ga)))))
@@ -303,8 +302,7 @@ gnus-draft-check-draft-articles
(equal (file-remote-p file)
(file-remote-p buffer-file-name))
(string-equal (file-truename buffer-file-name)
- (file-truename file))
- (buffer-modified-p))
+ (file-truename file)))
(setq buffs nil)
(setq buff nil)))))
(when buff
^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 4:14 ` Eric Abrahamsen
2024-05-10 6:23 ` Eric Abrahamsen
@ 2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 11:58 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 15:49 ` Eric Abrahamsen
1 sibling, 2 replies; 10+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-05-10 11:01 UTC (permalink / raw)
To: 70579; +Cc: Eric Abrahamsen, Eli Zaretskii
Eric Abrahamsen wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Ping! Eric, can we make some progress here?
>>
>>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>>> Date: Thu, 25 Apr 2024 21:34:45 -0700
>>>
>>> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
>>> text editors" <bug-gnu-emacs@gnu.org> writes:
>>>
>>> > - (Preferably starting with an empty drafts folder) Compose a message
>>> > and save it.
>>> > - Open the drafts group, press e on the message and then kill the new
>>> > buffer; then (incidentally, if you now do '/ N' then this bug does not
>>> > arise) delete the message (B DEL)
>>> > - Press q
>>> > - The message count is wrong (but can be corrected with M-g)
>>> >
>>> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.net")
>
> I've made some progress here -- the root of the problem seems to be
> that, when we hit "e" in the draft summary buffer to resume editing a
> draft, Gnus "jumps ahead" in message numbers. Basically what "editing"
> actually means is that the old draft is deleted, and a new draft is
> started, but the new draft has a article number that's the previous
> draft's number + 2, and the "draft" group's active number is also
> inflated (for instance (12 . 14) when it should be (12 . 13)). I was
> also able to get it to jump three numbers in some cases.
>
> From this point, *any* normal usage will end up correcting the error:
> using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as
> you noted any of the commands that lead to refreshing the unread count.
> But if you don't use any of those commands, you'll see the inflated
> active/unread count when you get back to the *Group* buffer (the "B DEL"
> isn't necessary for the recipe, and in fact at that stage the message
> under point has already been deleted).
>
> That's as far as I've gotten, and I'll keep working on why the article
> number starts off inflated. But in the meantime, the solution is "don't
> do that".
Of course. I was only hoping that this would shed some light on the
other unread-count problems.... IMO this is low-severity.
> Sorry, that sounded a bit unfriendly, when I was the one who asked you
> to submit the bug report! An hour or two of chasing Gnus function calls
> will do that to you...
A more-than-reasonable trade-off of expressiveness for the ultimate
cause. 🙂
>>> I've made some progress here -- the root of the problem seems to be
>>> that, when we hit "e" in the draft summary buffer to resume editing a
>>> draft, Gnus "jumps ahead" in message numbers. Basically what "editing"
>>> actually means is that the old draft is deleted, and a new draft is
>>> started, but the new draft has a article number that's the previous
>>> draft's number + 2, and the "draft" group's active number is also
>>> inflated (for instance (12 . 14) when it should be (12 . 13)). I was
>>> also able to get it to jump three numbers in some cases.
>>>
>>>>>From this point, *any* normal usage will end up correcting the error:
>>> using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as
>>> you noted any of the commands that lead to refreshing the unread count.
>>> But if you don't use any of those commands, you'll see the inflated
>>> active/unread count when you get back to the *Group* buffer (the "B DEL"
>>> isn't necessary for the recipe, and in fact at that stage the message
>>> under point has already been deleted).
>>>
>>> That's as far as I've gotten, and I'll keep working on why the article
>>> number starts off inflated. But in the meantime, the solution is "don't
>>> do that".
>>
>> Sorry, that sounded a bit unfriendly, when I was the one who asked you
>> to submit the bug report! An hour or two of chasing Gnus function calls
>> will do that to you...
>
> Okay, I found two things, one the proximate cause of this bug, another
> "probably wrong" adjacent issue.
>
> The main problem is that `gnus-draft-setup' both calls `message-mode'
> (which calls `message-set-auto-save-file-name'), and then directly calls
> `message-set-auto-save-file-name' itself. Without getting into horrible
> details, that functions shouldn't be called twice, because it generates
> an extra numerical file name, which ends up inflating the active value
> of the drafts group.
>
> I've attached a patch that removes the second call. If you feel
> comfortable applying and testing patches, I hope you'll try it. In my
> experiments it fixes the problem.
>
> The patch also semi-addresses the second issue. When saving a draft,
> message-mode only buries the buffer, it doesn't delete it. If you go
> back and start editing the draft, `gnus-draft-check-draft-articles' is
> supposed to see if a there's already a buffer visiting the draft file,
> and return you to that buffer instead of creating a new one. But it only
> does that if the buffer is modified, which it isn't if you've
> saved/buried the draft.
>
> I don't see why that should mean that you need a whole new buffer for
> editing the message
I can see a possible use case: you might want two versions of a draft
message, one being a 'root' (or 'base') version.
> , and the fact that there are now two "copies" of the
> message buffer causes further problems with the inflating article
> numbers (why I could sometimes see three or even four "jumps").
>
> The patch removes the check for modification
If my guess above is correct, this should be avoided.
> Anyway, please let me know if you can check the patch.
So I checked only the first hunk, and it worked, but seems to have
caused another problem: If I now open the group and view an existing
draft with RET, and then 'q', the message disappears - in both the
count, and if the group is reopened. M-g reverts things back to normal.
There's also a small hiccup with its working: 'B DEL' in the recipe
above does not work (i.e. it's not deleted - is it related to it already
being marked with 'G' at that point?), unless I 'q', re-enter and retry.
Regards,
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-05-10 11:58 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 12:37 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 15:49 ` Eric Abrahamsen
1 sibling, 1 reply; 10+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-05-10 11:58 UTC (permalink / raw)
To: 70579; +Cc: Eric Abrahamsen, Eli Zaretskii
James Thomas wrote:
> So I checked only the first hunk, and it worked, but seems to have
> caused another problem: If I now open the group and view an existing
> draft with RET, and then 'q', the message disappears - in both the
> count, and if the group is reopened. M-g reverts things back to normal.
How silly of me! That is because, well, it is not unread anymore.
> There's also a small hiccup with its working: 'B DEL' in the recipe
> above does not work (i.e. it's not deleted - is it related to it already
> being marked with 'G' at that point?), unless I 'q', re-enter and retry.
This issue remains.
Regards,
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 11:58 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-05-10 12:37 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 10+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-05-10 12:37 UTC (permalink / raw)
To: 70579; +Cc: Eric Abrahamsen, Eli Zaretskii
James Thomas wrote:
>> There's also a small hiccup with its working: 'B DEL' in the recipe
>> above does not work (i.e. it's not deleted - is it related to it already
>> being marked with 'G' at that point?), unless I 'q', re-enter and retry.
>
> This issue remains.
I'm mistaken about this too. I missed your explanation:
Eric Abrahamsen wrote:
> (the "B DEL" isn't necessary for the recipe, and in fact at that stage
> the message under point has already been deleted).
Regards,
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer
2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 11:58 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-05-10 15:49 ` Eric Abrahamsen
1 sibling, 0 replies; 10+ messages in thread
From: Eric Abrahamsen @ 2024-05-10 15:49 UTC (permalink / raw)
To: 70579
James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
[...]
> Of course. I was only hoping that this would shed some light on the
> other unread-count problems.... IMO this is low-severity.
That was my hope too, bummer that it's its own bug. But still worth fixing.
[...]
>> I don't see why that should mean that you need a whole new buffer for
>> editing the message
>
> I can see a possible use case: you might want two versions of a draft
> message, one being a 'root' (or 'base') version.
>
>> , and the fact that there are now two "copies" of the
>> message buffer causes further problems with the inflating article
>> numbers (why I could sometimes see three or even four "jumps").
>>
>> The patch removes the check for modification
>
> If my guess above is correct, this should be avoided.
Hmm, I guess so, though I wonder how many people are making use of the
ability to have two copies, vs how many are confused by it. But
I suppose it ain't broke, so I shouldn't fix it. I do think I'll update
the code to use `find-buffer-visiting', though.
>> Anyway, please let me know if you can check the patch.
[...]
>>> There's also a small hiccup with its working: 'B DEL' in the recipe
>>> above does not work (i.e. it's not deleted - is it related to it already
>>> being marked with 'G' at that point?), unless I 'q', re-enter and retry.
>>
>> This issue remains.
>
> I'm mistaken about this too. I missed your explanation:
>
> Eric Abrahamsen wrote:
>
>> (the "B DEL" isn't necessary for the recipe, and in fact at that stage
>> the message under point has already been deleted).
The UX is fairly confusing, but it makes more sense if you remember that
"edit" is actually just "delete-and-create". And if you use "C-c C-k" as
intended :)
Okay, there may be more bugs here, but I'll put this much in and close
the report; please open a new report if you find more.
Thanks,
Eric
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-05-10 15:49 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-26 3:32 bug#70579: 30.0.50; gnus: Wrong unread count in the Group buffer James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 4:34 ` Eric Abrahamsen
2024-05-09 7:19 ` Eli Zaretskii
2024-05-10 4:00 ` Eric Abrahamsen
2024-05-10 4:14 ` Eric Abrahamsen
2024-05-10 6:23 ` Eric Abrahamsen
2024-05-10 11:01 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 11:58 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 12:37 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 15:49 ` Eric Abrahamsen
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).