From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#44981: 28.0.50; Restore nnimap-split-download-body? Date: Fri, 04 Dec 2020 10:39:41 -0800 Message-ID: <87pn3pmn4i.fsf@ericabrahamsen.net> References: <87y2iip3ky.fsf@ericabrahamsen.net> <878sag4i4f.fsf@gnus.org> <87v9djsqxl.fsf@ericabrahamsen.net> <87k0tzz4wf.fsf@gnus.org> <87k0ty92ge.fsf@ericabrahamsen.net> <87zh2tyhmv.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16417"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44981@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 04 21:41:26 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klHtO-0004BC-Dp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 21:41:26 +0100 Original-Received: from localhost ([::1]:45400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klHtN-0000xx-9J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 15:41:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klFzx-0003pP-WE for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 13:40:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1klFzu-0002lo-MK for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 13:40:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1klFzu-0007aE-Gb for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 13:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Dec 2020 18:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44981 X-GNU-PR-Package: emacs Original-Received: via spool by 44981-submit@debbugs.gnu.org id=B44981.160710719229130 (code B ref 44981); Fri, 04 Dec 2020 18:40:02 +0000 Original-Received: (at 44981) by debbugs.gnu.org; 4 Dec 2020 18:39:52 +0000 Original-Received: from localhost ([127.0.0.1]:45767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klFzk-0007Zm-5p for submit@debbugs.gnu.org; Fri, 04 Dec 2020 13:39:52 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:44646 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klFzh-0007ZZ-3s for 44981@debbugs.gnu.org; Fri, 04 Dec 2020 13:39:50 -0500 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id D03D0FA094; Fri, 4 Dec 2020 18:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1607107183; bh=o4MefSYqkMP/XtFQ7ZsdkKkVVDVRzBoYClFS9fsGjns=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PwA0jdO4pKiNxATqCoz7lh1183+TgbDbnZZ4lXDWsrLkqAINBApKlTs0MTZXcyOn5 Excrq6Fp8ev9ya63TlNvSTsxFZ3hIFZN7VOaUPAwixCzjgBtFmMoEOrAPLIzCu265z HE/4ytbfnATNPnojp5SQ3osXkq22iPQHEdP3ZQSM= In-Reply-To: <87zh2tyhmv.fsf@tcd.ie> (Basil L. Contovounesios's message of "Fri, 04 Dec 2020 10:45:12 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195006 Archived-At: "Basil L. Contovounesios" writes: > Thanks for cleaning this up, Eric. Could someone please look into the > following byte-compilation warning? > > In spam-setup-widening: > gnus/spam.el:1234:11: Warning: =E2=80=98nnimap-split-download-body-defa= ult=E2=80=99 is an > obsolete variable (as of 28.1); use =E2=80=98nnimap-split-download-= body=E2=80=99 instead. > > I was thinking of the following change: > > diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el > index 96a7da2313..8634fa680d 100644 > --- a/lisp/gnus/spam.el > +++ b/lisp/gnus/spam.el > @@ -44,12 +44,9 @@ > ;;; for the definitions of group content classification and spam process= ors > (require 'gnus) >=20=20 > -(eval-when-compile (require 'hashcash)) > - > -;; for nnimap-split-download-body-default > -(eval-when-compile (require 'nnimap)) > - > -(eval-when-compile (require 'cl-lib)) > +(eval-when-compile > + (require 'cl-lib) > + (require 'hashcash)) >=20=20 > ;; autoload query-dig > (autoload 'query-dig "dig") > @@ -1230,8 +1227,9 @@ spam-generic-score >=20=20 > ;;; set up IMAP widening if it's necessary > (defun spam-setup-widening () > + (defvar nnimap-split-download-body) > (when (spam-widening-needed-p) > - (setq nnimap-split-download-body-default t))) > + (setq nnimap-split-download-body t))) >=20=20 > (defun spam-widening-needed-p (&optional force-symbols) > (let (found) > > > But Ted explicitly changed spam-setup-widening in 2003 to use > nnimap-split-download-body-default instead of > nnimap-split-download-body, to avoid modifying a user option. > > I don't know what spam-setup-widening is meant to do, and by extension I > don't know what TRT to do here is. Either way, loading nnimap in > eval-when-compile "for a variable" is definitely dubious. Ideas? I should have known it wouldn't be this simple! It looks like widening is used if the spam backend in use does statistical "learning", e.g. a Bayesian system that you can train on spam/ham data sets. In that case the backend needs access to the full message text in order to train properly. For local mail, all that's needed is to "widen" the message buffer so that the body is available for training, not just the headers. For IMAP the message body isn't present, so "widening" takes on the additional meaning of "download the message body and widen to it". I'm not sure why spam.el would need to work on the default value of `nnimap-split-download-body'. If spam.el determines that widening is needed, it's going to download message bodies across the board anyway. The only reason to preserve the user's own customization would be if the user later unloaded spam.el -- then it should restore the previous value. But how often would that actually be useful? In principle, TRT would be to have spam.el let-bind a variable around the splitting process. But I don't think the code is set up that way: all the spam.el stuff happens "inside" the splitting process, not around it. Eric