From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Apr 2024 21:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 70134@debbugs.gnu.org Cc: Eric Abrahamsen , larsi@gnus.org, Alex Bochannek X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17120078734474 (code B ref -1); Mon, 01 Apr 2024 21:45:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2024 21:44:33 +0000 Received: from localhost ([127.0.0.1]:51881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrPSC-0001A6-Gg for submit@debbugs.gnu.org; Mon, 01 Apr 2024 17:44:33 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrPS7-00019o-Lc for submit@debbugs.gnu.org; Mon, 01 Apr 2024 17:44:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrPRx-0006zw-Va for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 17:44:18 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrPRv-0004qR-7e for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 17:44:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1712007851; x=1712267051; bh=z5oaDUxN0JigaxzeIr/fqZjKAVQexc1sm44A7A0SNcw=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=HU0tAClsxwv6/GLQFRaE1XED2MESdnj5j+QFUDLgitM5AeSEEMnuQGCwPDoDVO33D sD5Rtacfz4EjYKjK4btVr5bVO0g6yuFx/q3ezSi+BiCEOA8W+HTs4JEqdmho4V1BcC bLaSimxGegnccrvEZf4AReBJs6I7CTmTlIdsuVBR0tucN25E/pa2iOKpSK0i5Mk7Zl wGSW3l1XMxIYtX72XdqYaEUaVgSvSaYqxMF+6C14QgAKW8amXgsWH4rifMHD1NpK28 v7joT/UkgICC/HlgSt2lkoDAiKZOi0JsCXvTLtmLtRDeybfO05+xhZZ5mMN81K94QK 8cjMd8L0rUQrQ== Date: Mon, 01 Apr 2024 21:44:04 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87edbovjvj.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c" Received-SPF: pass client-ip=185.70.43.23; envelope-from=kuba@kubajecminek.cz; helo=mail-4323.proton.ch X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tags: patch Hello, I'm attaching a patch that enhances user experience when adding Gnus scores interactively based on date header. This patch does multiple things: 1. `char-to-type' variable is renamed to `char-to-types' and we allow it to be mapped to multiple types. This is useful because date header supports all these types for scoring - '<, '>, 'r, 'after, ' [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: kubajecminek.cz] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: kubajecminek.cz] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) This is a multi-part message in MIME format. --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Hello, I'm attaching a patch that enhances user experience when adding Gnus scores interactively based on date header. This patch does multiple things: 1. `char-to-type' variable is renamed to `char-to-types' and we allow it to be mapped to multiple types. This is useful because date header supports all these types for scoring - '<, '>, 'r, 'after, 'before, 'at but only the last three were previously offered to the user when using interactive scoring. 2. `gnus-summary-score-entry' now provides sensible defaults for each date scoring type - if we're scoring based on integer value ('<, '>) we offer number of days between now and entry at point (revised version of what was introduced in bug#61002) and if we're scoring based on string value ('after, 'before, 'at, 'r) we provide valid date string. 3. If the user scores articles based on date strings ('before, 'after, 'at, 'r), `gnus-summary-score-entry' will no longer cast the type to the integer type. 4. `gnus-score-date' catches 'r type as well. I'm also Cc'ing Alex who was the original author of '< '> date scoring types. Please let me know what you think. 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-23 built on kuba-ThinkPad-T14-Gen-3 Repository revision: 7e32e8392ab77f9df08a1f11831cbba2242d721f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12201001 System Description: Ubuntu 22.04.4 LTS --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c Content-Type: text/patch; name=0001-Show-all-date-options-when-adding-Gnus-scores-interactively.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-Show-all-date-options-when-adding-Gnus-scores-interactively.patch RnJvbSA2NDY1OWQ2NWMzYjQzOTYwYmMwMzQ3ZDViZTAzNWVjNjQ3NzliMGFkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogPT9VVEYtOD9xP0pha3ViPTIwSmU9QzQ9OERtPUMzPUFEbmVr Pz0gPGt1YmFAa3ViYWplY21pbmVrLmN6Pg0KRGF0ZTogU2F0LCAzMCBNYXIgMjAyNCAwMDozNDow NyArMDEwMA0KU3ViamVjdDogW1BBVENIXSBTaG93IGFsbCBkYXRlIG9wdGlvbnMgd2hlbiBhZGRp bmcgR251cyBzY29yZXMgaW50ZXJhY3RpdmVseQ0KDQoqIGxpc3AvZ251cy9nbnVzLXNjb3JlLmVs IChnbnVzLXN1bW1hcnktaW5jcmVhc2Utc2NvcmUpOiBSZW5hbWUNCidjaGFyLXRvLXR5cGUnIHZh cmlhYmxlIHRvICdjaGFyLXRvLXR5cGVzJyBhbmQgYWxsb3cgbXVsdGlwbGUgdHlwZXMNCmZvciBl YWNoIGNoYXIuDQoNCiogbGlzcC9nbnVzL2dudXMtc2NvcmUuZWwgKGdudXMtc3VtbWFyeS1zY29y ZS1lbnRyeSk6IFByb3ZpZGUgYmV0dGVyDQpkZWZhdWx0IHZhbHVlcyBmb3IgZWFjaCBzY29yaW5n IHR5cGUgYW5kIGNhc3QgJ21hdGNoJyB0byBudW1iZXIgb25seQ0KaWYgbmVjZXNzYXJ5Lg0KLS0t DQogbGlzcC9nbnVzL2dudXMtc2NvcmUuZWwgfCA1NSArKysrKysrKysrKysrKysrKysrKy0tLS0t LS0tLS0tLS0tLS0tLS0tLQ0KIDEgZmlsZSBjaGFuZ2VkLCAyNyBpbnNlcnRpb25zKCspLCAyOCBk ZWxldGlvbnMoLSkNCg0KZGlmZiAtLWdpdCBhL2xpc3AvZ251cy9nbnVzLXNjb3JlLmVsIGIvbGlz cC9nbnVzL2dudXMtc2NvcmUuZWwNCmluZGV4IDQ3OWI3NDk2Y2YxLi5kNzM0NjU4MWYyZiAxMDA2 NDQNCi0tLSBhL2xpc3AvZ251cy9nbnVzLXNjb3JlLmVsDQorKysgYi9saXNwL2dudXMvZ251cy1z Y29yZS5lbA0KQEAgLTU5MywxOCArNTkzLDE4IEBAIGN1cnJlbnQgc2NvcmUgZmlsZS4iDQogCSAg ICAoP2QgImRhdGUiIG5pbCBuaWwgZGF0ZSkNCiAJICAgICg/ZiAiZm9sbG93dXAiIG5pbCBuaWwg c3RyaW5nKQ0KIAkgICAgKD90ICJ0aHJlYWQiICJtZXNzYWdlLWlkIiBuaWwgc3RyaW5nKSkpDQot CSAoY2hhci10by10eXBlDQorCSAoY2hhci10by10eXBlcw0KIAkgICcoKD9zIHMgInN1YnN0cmlu ZyIgc3RyaW5nKQ0KIAkgICAgKD9lIGUgImV4YWN0IHN0cmluZyIgc3RyaW5nKQ0KIAkgICAgKD9m IGYgImZ1enp5IHN0cmluZyIgc3RyaW5nKQ0KLQkgICAgKD9yIHIgInJlZ2V4cCBzdHJpbmciIHN0 cmluZykNCisJICAgICg/ciByICJyZWdleHAgc3RyaW5nIiBzdHJpbmcgZGF0ZSkNCiAJICAgICg/ eiBzICJzdWJzdHJpbmciIGJvZHktc3RyaW5nKQ0KIAkgICAgKD9wIHIgInJlZ2V4cCBzdHJpbmci IGJvZHktc3RyaW5nKQ0KIAkgICAgKD9iIGJlZm9yZSAiYmVmb3JlIGRhdGUiIGRhdGUpDQogCSAg ICAoP2EgYWZ0ZXIgImFmdGVyIGRhdGUiIGRhdGUpDQogCSAgICAoP24gYXQgInRoaXMgZGF0ZSIg ZGF0ZSkNCi0JICAgICg/PCA8ICJsZXNzIHRoYW4gbnVtYmVyIiBudW1iZXIpDQotCSAgICAoPz4g PiAiZ3JlYXRlciB0aGFuIG51bWJlciIgbnVtYmVyKQ0KKwkgICAgKD88IDwgImxlc3MgdGhhbiBu dW1iZXIiIG51bWJlciBkYXRlKQ0KKwkgICAgKD8+ID4gImdyZWF0ZXIgdGhhbiBudW1iZXIiIG51 bWJlciBkYXRlKQ0KIAkgICAgKD89ID0gImVxdWFsIHRvIG51bWJlciIgbnVtYmVyKSkpDQogCSAo Y3VycmVudC1zY29yZS1maWxlIGdudXMtY3VycmVudC1zY29yZS1maWxlKQ0KIAkgKGNoYXItdG8t cGVybQ0KQEAgLTY1MiwxMCArNjUyLDkgQEAgY3VycmVudCBzY29yZSBmaWxlLiINCiAJICAobGV0 ICgobGVnYWwtdHlwZXMNCiAJCSAoZGVscSBuaWwNCiAJCSAgICAgICAobWFwY2FyIChsYW1iZGEg KHMpDQotCQkJCSAoaWYgKGVxIChudGggNCBlbnRyeSkNCi0JCQkJCSAobnRoIDMgcykpDQorCQkJ CSAoaWYgKG1lbWJlciAobnRoIDQgZW50cnkpIChjZGRkciBzKSkNCiAJCQkJICAgICBzIG5pbCkp DQotCQkJICAgICAgIGNoYXItdG8tdHlwZSkpKSkNCisJCQkgICAgICAgY2hhci10by10eXBlcykp KSkNCiAgICAgICAgICAgICAoc2V0cSBoZWFkZXItc3RyaW5nDQogICAgICAgICAgICAgICAgICAg KGZvcm1hdCAiJXMgaGVhZGVyIGAlcycgd2l0aCBtYXRjaCB0eXBlICglcz8pOiAiDQogCQkJICAo aWYgaW5jcmVhc2UgIkluY3JlYXNlIiAiTG93ZXIiKQ0KQEAgLTg3NSwxMCArODc0LDE4IEBAIElm IG9wdGlvbmFsIGFyZ3VtZW50IGBFWFRSQScgaXMgbm9uLW5pbCwgaXQncyBhIG5vbi1zdGFuZGFy ZCBvdmVydmlldyBoZWFkZXIuIg0KICAgKHdoZW4gKGVxIHR5cGUgdCkNCiAgICAgKHNldHEgdHlw ZSAncikpDQogICA7OyBTaW1wbGlmeSBtYXRjaGVzLi4uDQotICAoY29uZCAoKG9yIChlcSB0eXBl ICdyKSAoZXEgdHlwZSAncykgKGVxIHR5cGUgbmlsKSkNCisgIChjb25kICgob3IgKGFuZCAoZXEg dHlwZSAncikgKG5vdCAoc3RyaW5nPSBoZWFkZXIgImRhdGUiKSkpIChlcSB0eXBlICdzKSAoZXEg dHlwZSBuaWwpKQ0KIAkgKHNldHEgbWF0Y2ggKGlmIG1hdGNoIChnbnVzLXNpbXBsaWZ5LXN1Ympl Y3QtcmUgbWF0Y2gpICIiKSkpDQogCSgoZXEgdHlwZSAnZikNCi0JIChzZXRxIG1hdGNoIChnbnVz LXNpbXBsaWZ5LXN1YmplY3QtZnV6enkgbWF0Y2gpKSkpDQorCSAoc2V0cSBtYXRjaCAoZ251cy1z aW1wbGlmeS1zdWJqZWN0LWZ1enp5IG1hdGNoKSkpDQorICAgICAgICA7OyBQcm92aWRlIGJldHRl ciBkZWZhdWx0IHZhbHVlcyBpZiB3ZSdyZSBzY29yaW5nIG9uIGRhdGUgaGVhZGVyDQorICAgICAg ICAoKHN0cmluZz0gaGVhZGVyICJkYXRlIikNCisgICAgICAgICAoc2V0cSBtYXRjaCAoaWYgKG9y IChlcSB0eXBlICc8KSAoZXEgdHlwZSAnPikpDQorICAgICAgICAgICAgICAgICAgICAgICAgIChm b3JtYXQtc2Vjb25kcyAiJWQiDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAodGltZS1zdWJ0cmFjdA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChjdXJyZW50LXRpbWUpDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGdudXMtZGF0ZS1nZXQtdGltZSBtYXRjaCkpKQ0KKyAgICAgICAgICAgICAgICAg ICAgICAgKHN1YnN0cmluZy1uby1wcm9wZXJ0aWVzIChnbnVzLWRhdGUtaXNvODYwMSBtYXRjaCkp KSkpKQ0KICAgKGxldCAoKHNjb3JlIChnbnVzLXNjb3JlLWRlbHRhLWRlZmF1bHQgc2NvcmUpKQ0K IAkoaGVhZGVyIChkb3duY2FzZSBoZWFkZXIpKQ0KIAluZXcpDQpAQCAtODkzLDE0ICs5MDAsOSBA QCBJZiBvcHRpb25hbCBhcmd1bWVudCBgRVhUUkEnIGlzIG5vbi1uaWwsIGl0J3MgYSBub24tc3Rh bmRhcmQgb3ZlcnZpZXcgaGVhZGVyLiINCiAJCQkJICh0ICJwZXJtYW5lbnQiKSkNCiAJCQkgICBo ZWFkZXINCiAJCQkgICAoaWYgKDwgc2NvcmUgMCkgImxvd2VyIiAicmFpc2UiKSkNCi0gICAgICAg ICAgICAgICAgICAgKGNvbmQgKChudW1iZXJwIG1hdGNoKSAoaW50LXRvLXN0cmluZyBtYXRjaCkp DQotICAgICAgICAgICAgICAgICAgICAgICAgICgoc3RyaW5nPSBoZWFkZXIgImRhdGUiKQ0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgKGludC10by1zdHJpbmcNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAoLQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoLyAoY2FyICh0aW1l LWNvbnZlcnQgKGN1cnJlbnQtdGltZSkgMSkpIDg2NDAwKQ0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoLyAoY2FyICh0aW1lLWNvbnZlcnQgKGdudXMtZGF0ZS1nZXQtdGltZSBtYXRjaCkg MSkpDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg2NDAwKSkpKQ0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAodCBtYXRjaCkpKSkpDQorCQkgICAoaWYgKG51bWJlcnAgbWF0Y2gp DQorCQkgICAgICAgKGludC10by1zdHJpbmcgbWF0Y2gpDQorCQkgICAgIG1hdGNoKSkpKQ0KIA0K ICAgICA7OyBJZiB0aGlzIGlzIGFuIGludGVnZXIgY29tcGFyaXNvbiwgd2UgdHJhbnNmb3JtIGZy b20gc3RyaW5nIHRvIGludC4NCiAgICAgKGlmIChlcSAobnRoIDIgKGFzc29jIGhlYWRlciBnbnVz LWhlYWRlci1pbmRleCkpICdnbnVzLXNjb3JlLWludGVnZXIpDQpAQCAtOTA5LDE2ICs5MTEsMTMg QEAgSWYgb3B0aW9uYWwgYXJndW1lbnQgYEVYVFJBJyBpcyBub24tbmlsLCBpdCdzIGEgbm9uLXN0 YW5kYXJkIG92ZXJ2aWV3IGhlYWRlci4iDQogICAgICAgKHNldC10ZXh0LXByb3BlcnRpZXMgMCAo bGVuZ3RoIG1hdGNoKSBuaWwgbWF0Y2gpKQ0KIA0KICAgICA7OyBNb2RpZnkgbWF0Y2ggYW5kIHR5 cGUgZm9yIGFydGljbGUgYWdlIHNjb3JpbmcuDQotICAgIChpZiAoc3RyaW5nPSAiZGF0ZSIgKG50 aCAwIChhc3NvYyBoZWFkZXIgZ251cy1oZWFkZXItaW5kZXgpKSkNCi0JKGxldCAoKGFnZSAoc3Ry aW5nLXRvLW51bWJlciBtYXRjaCkpKQ0KLQkgIChpZiAob3IgKDwgYWdlIDApDQotCQkgIChzdHJp bmc9ICIwIiBtYXRjaCkpDQotCSAgICAgICh1c2VyLWVycm9yICJBcnRpY2xlIGFnZSBtdXN0IGJl IGEgcG9zaXRpdmUgbnVtYmVyIikpDQotCSAgKHNldHEgbWF0Y2ggYWdlDQotCQl0eXBlIChjb25k ICgoZXEgdHlwZSAnYWZ0ZXIpDQotCQkJICAgICc8KQ0KLQkJCSAgICgoZXEgdHlwZSAnYmVmb3Jl KQ0KLQkJCSAgICAnPikpKSkpDQorICAgICh3aGVuIChhbmQgKHN0cmluZz0gImRhdGUiIChudGgg MCAoYXNzb2MgaGVhZGVyIGdudXMtaGVhZGVyLWluZGV4KSkpDQorICAgICAgICAgICAgICAgKG9y IChlcSB0eXBlICc8KSAoZXEgdHlwZSAnPikpKQ0KKyAgICAgIChsZXQgKChhZ2UgKHN0cmluZy10 by1udW1iZXIgbWF0Y2gpKSkNCisgICAgICAgIChpZiAob3IgKDwgYWdlIDApDQorICAgICAgICAg ICAgICAgIChzdHJpbmc9ICIwIiBtYXRjaCkpDQorICAgICAgICAgICAgKHVzZXItZXJyb3IgIkFy dGljbGUgYWdlIG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIiKSkNCisgICAgICAgIChzZXRxIG1h dGNoIGFnZSkpKQ0KIA0KICAgICAodW5sZXNzIChlcSBkYXRlICdub3cpDQogICAgICAgOzsgQWRk IHRoZSBzY29yZSBlbnRyeSB0byB0aGUgc2NvcmUgZmlsZS4NCkBAIC0xODA2LDcgKzE4MDUsNyBA QCBzY29yZSBpbiBgZ251cy1uZXdzZ3JvdXAtc2NvcmVkJyBieSBTQ09SRS4iDQogCSAgICgoZXEg dHlwZSAnYXQpDQogCSAgICAoc2V0cSBtYXRjaC1mdW5jICdzdHJpbmc9DQogCQkgIG1hdGNoIChn bnVzLWRhdGUtaXNvODYwMSAobnRoIDAga2lsbCkpKSkNCi0JICAgKChlcSB0eXBlICdyZWdleHAp DQorCSAgICgob3IgKGVxIHR5cGUgJ3JlZ2V4cCkgKGVxIHR5cGUgJ3IpKQ0KIAkgICAgKHNldHEg bWF0Y2gtZnVuYyAnc3RyaW5nLW1hdGNoDQogCQkgIG1hdGNoIChudGggMCBraWxsKSkpDQogCSAg ICh0IChlcnJvciAiSW52YWxpZCBtYXRjaCB0eXBlOiAlcyIgdHlwZSkpKQ0KLS0gDQoyLjM5LjMg KEFwcGxlIEdpdC0xNDUpDQoNCg== --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c-- From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2024 07:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: eric@ericabrahamsen.net, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Cc: 70134@debbugs.gnu.org, larsi@gnus.org, alex@bochannek.com Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171299514126175 (code B ref 70134); Sat, 13 Apr 2024 07:59:03 +0000 Received: (at 70134) by debbugs.gnu.org; 13 Apr 2024 07:59:01 +0000 Received: from localhost ([127.0.0.1]:60045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvYHr-0006nt-1R for submit@debbugs.gnu.org; Sat, 13 Apr 2024 03:59:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvYHo-0006mW-OB for 70134@debbugs.gnu.org; Sat, 13 Apr 2024 03:58:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvYHX-0006ET-C9; Sat, 13 Apr 2024 03:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=K8D0R7WPrUGkclXSOchtj9guqLOkr42dE3ICDJ+yxeM=; b=paEKAu/gVnHKfFMFg44K aDO5QG9G+RNovrOO34TGQTvxplpS+zttAwe6IybnEOFPgigoXyvSvWBUWMDiKloOMMmKfAxfMAa99 0P/BnvuXqkH3vNiUtYdd5Y702UF+tS8g6ok350pc/5MHDQ5b+k2/GsuCeemrlmxg2l/yYP13BrLO0 raWl23KETq/VdxwIIeoeA7DI7hP10O8AI3rpXy4aeEz1ToScgBilawWv3onhrLTPGJv1Om7icRBDx N5+kPT+lWhQbp+cnakJTLL6jXSbq1jRsZYI6u9xeDvL9vW/pzcNzO00BFlf0Tc3/ACKJQo5lt+wWA Im9mmSWVZvoOrA==; Date: Sat, 13 Apr 2024 10:58:37 +0300 Message-Id: <86bk6dr8wi.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87edbovjvj.fsf@kubajecminek.cz> (bug-gnu-emacs@gnu.org) References: <87edbovjvj.fsf@kubajecminek.cz> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Eric, any comments? > Cc: Eric Abrahamsen , larsi@gnus.org, > Alex Bochannek > Date: Mon, 01 Apr 2024 21:44:04 +0000 > From: Jakub Ječmínek via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Hello, I'm attaching a patch that enhances user experience when adding > Gnus scores interactively based on date header. This patch does multiple > things: > > 1. `char-to-type' variable is renamed to `char-to-types' and we allow it > to be mapped to multiple types. This is useful because date header > supports all these types for scoring - '<, '>, 'r, 'after, 'before, 'at > but only the last three were previously offered to the user when using > interactive scoring. > > 2. `gnus-summary-score-entry' now provides sensible defaults for each > date scoring type - if we're scoring based on integer value ('<, '>) we > offer number of days between now and entry at point (revised version of > what was introduced in bug#61002) and if we're scoring based on string > value ('after, 'before, 'at, 'r) we provide valid date string. > > 3. If the user scores articles based on date strings ('before, 'after, > 'at, 'r), `gnus-summary-score-entry' will no longer cast the type to the > integer type. > > 4. `gnus-score-date' catches 'r type as well. > > I'm also Cc'ing Alex who was the original author of '< '> date scoring > types. Please let me know what you think. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 03:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 70134@debbugs.gnu.org, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , larsi@gnus.org, alex@bochannek.com Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17137568091016 (code B ref 70134); Mon, 22 Apr 2024 03:34:02 +0000 Received: (at 70134) by debbugs.gnu.org; 22 Apr 2024 03:33:29 +0000 Received: from localhost ([127.0.0.1]:45327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rykQq-0000GK-Po for submit@debbugs.gnu.org; Sun, 21 Apr 2024 23:33:29 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:46288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rykQm-0000Fy-3R for 70134@debbugs.gnu.org; Sun, 21 Apr 2024 23:33:27 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 606E8FA059; Mon, 22 Apr 2024 03:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1713756782; bh=BfvARgAS2fYDswh3D4Szqjjstnt8mI2s+dK9kaVz3x4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pqCFim5KyiTkZLsNRJBKqDjt9uQ2spHeU8Pf4Da9/dGCJo5wQI191ammsn8vu4m+f M5M3TxHmmqcE3WyEv0QLLfvhDrV7BJ3irdtllakphnyoYuk3DZZNqHWOR7ZoAdMiWY r0j9RYY4nFw9F8H8U9dm5pISognIM46Z2dQRKV4w= From: Eric Abrahamsen In-Reply-To: <86bk6dr8wi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Apr 2024 10:58:37 +0300") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> Date: Sun, 21 Apr 2024 20:33:00 -0700 Message-ID: <87jzkqjclv.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > Ping! Eric, any comments? I have no comments! I don't know the scoring code, and fifteen minutes of looking at the patch and its surroundings has left me none the wiser. I don't know what it means to add multiple types to each char; I don't know what a "type" is in this context. Jakub, do you think you could enlighten me within a short paragraph or so? I'm also okay with just chucking it in, and letting people in gnus.general know that things have changed. There are a few hardcore scoring users there. Thanks, Eric From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Apr 2024 22:53:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: 70134@debbugs.gnu.org, kuba@kubajecminek.cz, eliz@gnu.org, larsi@gnus.org, alex@bochannek.com Reply-To: rms@gnu.org Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171399916820033 (code B ref 70134); Wed, 24 Apr 2024 22:53:08 +0000 Received: (at 70134) by debbugs.gnu.org; 24 Apr 2024 22:52:48 +0000 Received: from localhost ([127.0.0.1]:60217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzlTk-0005CB-8e for submit@debbugs.gnu.org; Wed, 24 Apr 2024 18:52:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzlTc-00059y-Cb for 70134@debbugs.gnu.org; Wed, 24 Apr 2024 18:52:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzlTB-0006lX-Hj; Wed, 24 Apr 2024 18:52:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=yhMFrkJW9IKZZzYjG3QWQUjULUvRHe3czAhBWJMkAxs=; b=R/t+q53GHAan VM5c22oH08rO2PtzOeDx2efHIJiJXeTZg9mpKZKGm3iKhDd54zQc+vMRAZPxZRgxbDulWv9UKteab f/Di5csh+40xx6B+CAtA7MH7eOuDx8xgYfoB9FvzcOyMffmwDt7fJwZOEtbr0XgpBVOWqHF1S8IVj 9yT+DG7HcIQ8arNrirfRgavj7PYu5tmqCp4NvL/7TusSiFB72FolRsYo1mhsQg9rPO0LLqW0ALCBA 2JpwEELMcLQ0M2o0OEKzpvhNUwyWg3FG8krakBf2i4YbgyA0VSFrigWb09yugPbstQq450CgFVTA2 SP36ojH6TQt3R+UIuE34Rg==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rzlTA-00006L-Rf; Wed, 24 Apr 2024 18:52:04 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman In-Reply-To: <87jzkqjclv.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Sun, 21 Apr 2024 20:33:00 -0700) References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> Message-Id: Date: Wed, 24 Apr 2024 18:52:04 -0400 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I have no comments! I don't know the scoring code, and fifteen minutes > of looking at the patch and its surroundings has left me none the wiser. This suggests to me that that code may need better comments to explain its overall structure. Do you think so? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Apr 2024 23:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Richard Stallman Cc: Eric Abrahamsen , 70134@debbugs.gnu.org, eliz@gnu.org, larsi@gnus.org, kuba@kubajecminek.cz Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171400014631255 (code B ref 70134); Wed, 24 Apr 2024 23:10:04 +0000 Received: (at 70134) by debbugs.gnu.org; 24 Apr 2024 23:09:06 +0000 Received: from localhost ([127.0.0.1]:60221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzljd-00087u-Ac for submit@debbugs.gnu.org; Wed, 24 Apr 2024 19:09:06 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:38443 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzljX-00086E-7j for 70134@debbugs.gnu.org; Wed, 24 Apr 2024 19:09:03 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4VPvmk27Bkz3qHtd; Wed, 24 Apr 2024 16:08:38 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: (Richard Stallman's message of "Wed, 24 Apr 2024 18:52:04 -0400") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> Date: Wed, 24 Apr 2024 16:08:37 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Richard Stallman writes: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > I have no comments! I don't know the scoring code, and fifteen minutes > > of looking at the patch and its surroundings has left me none the wiser. > > This suggests to me that that code may need better comments to explain > its overall structure. Do you think so? As Jakub mentioned, I am the author of that part of the Gnus scoring code. I have not had a chance to look at the proposed patch, but I agree that some explanations would be useful. I can look it over this weekend. -- Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 May 2024 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: Eric Abrahamsen , 70134@debbugs.gnu.org, eliz@gnu.org, larsi@gnus.org, Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171459172121572 (code B ref 70134); Wed, 01 May 2024 19:29:02 +0000 Received: (at 70134) by debbugs.gnu.org; 1 May 2024 19:28:41 +0000 Received: from localhost ([127.0.0.1]:39009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2Fd9-0005bs-Tq for submit@debbugs.gnu.org; Wed, 01 May 2024 15:28:41 -0400 Received: from mail-4022.proton.ch ([185.70.40.22]:35313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2Fcu-0005bj-9n for 70134@debbugs.gnu.org; Wed, 01 May 2024 15:28:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1714591676; x=1714850876; bh=U2wObvG/lAjW45jY9Qp95dxXwtL6a2JrGXIVqx0MitU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=b8lLZDKDrCYxokCWmkjzH8ENtVUx6OS+JmisFpp021hx3LZhGtL6RhBNUgwaWSE5H 8QQT1WEKQ9Uq0SUBnvbkMa0RIqfjWLsFIKkvmG90KIJ53aowmjOaL4s64rNDipC2PA MbceKliO/9A27y7pgweEY4EdTzVLx2EsJ7PyM8KDyOVvuqXHCquSkb0qv+GWcQLRWS b26n6c5MHCi9FUyrw/sS78sNP565qDdMfrMYfJaExt90ofXZNzGYa3aLY3Hqbuye+/ 9KQiXRny3qvWhmVOzD8iE4/KeUw/vTre6rWhF3Vkr340f7adUPUgjYJm3ZXOA80DzL 8zW3LHiKbig3Q== Date: Wed, 01 May 2024 19:27:44 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87le4tz61f.fsf@kubajecminek.cz> In-Reply-To: References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: ffb0c12bb6e164709e0ac3ac00ff683eef3e1e9e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) "Eric Abrahamsen" writes: > I have no comments! I don't know the scoring code, and fifteen minutes > of looking at the patch and its surroundings has left me none the wiser. > I don't know what it means to add multiple types to each char; I don't > know what a "type" is in this context. Jakub, do you think you could > enlighten me within a short paragraph or so? I'm also okay with just > chucking it in, and letting people in gnus.general know that things have > changed. There are a few hardcore scoring users there. Sure, please let me know if need more context. If you hit 'I' or 'L' on any article (in the Summary buffer) then Gnus will walk you through the scoring process. Gnus first asks you which header you're scoring on and presents you a bunch of characters (each character represents one header: d - date, b - body, etc.). If you choose date, for example, then Gnus asks you for 'match type' which is basically a handler which will decide whether to lower/increase the score. Which scoring types are presented depends on which header you're scoring on but current implementation allows to bind only one character to one type. But since Alex implemented integer scoring (currently bound to `number' type) to date, I think we should extend it and present this option to the user. "Alex Bochannek" writes: > As Jakub mentioned, I am the author of that part of the Gnus scoring > code. I have not had a chance to look at the proposed patch, but I agree > that some explanations would be useful. I can look it over this weekend. Thank you, your review is appreciated. Please do you happen to remember why you used this form (string=3D "date" (nth 0 (assoc header gnus-header-index))) instead of this (string=3D header "date") Thanks! Best --=20 Kuba Je=C4=8Dm=C3=ADnek (http://kubajecminek.cz) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2024 02:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Cc: Eric Abrahamsen , 70134@debbugs.gnu.org, eliz@gnu.org, larsi@gnus.org, Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171505046311223 (code B ref 70134); Tue, 07 May 2024 02:55:02 +0000 Received: (at 70134) by debbugs.gnu.org; 7 May 2024 02:54:23 +0000 Received: from localhost ([127.0.0.1]:41659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4AyD-0002uw-BO for submit@debbugs.gnu.org; Mon, 06 May 2024 22:54:23 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:49285 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4Axx-0002ud-CW for 70134@debbugs.gnu.org; Mon, 06 May 2024 22:54:20 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4VYNBm5Kxrz3q40m; Mon, 6 May 2024 19:53:36 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: <87le4tz61f.fsf@kubajecminek.cz> ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?="'s message of "Wed, 01 May 2024 19:27:44 +0000") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> Date: Mon, 06 May 2024 19:53:35 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jakub, I finally had some time to look at these changes, apologies for the delay. Jakub Je=C4=8Dm=C3=ADnek writes: > "Alex Bochannek" writes: >> As Jakub mentioned, I am the author of that part of the Gnus scoring >> code. I have not had a chance to look at the proposed patch, but I agree >> that some explanations would be useful. I can look it over this weekend. > > Thank you, your review is appreciated. Please do you happen to remember I like the approach and tested them out. The legal-types change in gnus-summary-increase-score is straightforward and makes sense to me. I have one stylistic comment: (nthcdr 3 s) seems to be easier to read to me than (cdddr s), but I have no strong opinions on that. > why you used this form > > (string=3D "date" (nth 0 (assoc header gnus-header-index))) > > instead of this > > (string=3D header "date") My suspicion is that this started out as a copy of the integer comparison right above that code and I never cleaned it up. Yes, feel free to simplify, I don't remember any good reason why it needs to pick apart a list. It also seems perfectly fine to remove the (eq type 'after) etc. stuff, it's not necessary anymore. The rest of the changes in gnus-summary-score-entry look good. I think some more help text or additional documentation about the defaults would be useful. It gets a bit confusing what you are prompted for. Having said that, I like the idea of pulling a default date from the current message, it just surprised me. I also think I might have found a bug in how the dates are written out to the SCORE file. I interactively increased the score in the order of <, r, n, b, and n as you can see below. Only the b, a, and n entries get converted to the list format with the un-evaluated gnus-time after another entry is written. Meaning the second and third entry below, the "before" and "at," looked just like the topmost "at" entry before the following entry was written. ("date" ("20240501" nil nil at) (#("20240502" 0 1 (gnus-time (26163 14832))) nil nil before) (#("20240503T145117" 0 1 (gnus-time (26165 23637))) nil nil at) (".*T031840" nil nil r) (2 nil nil <) > Thanks! Hope this is useful! --=20 Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 May 2024 19:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: Eric Abrahamsen , 70134@debbugs.gnu.org, eliz@gnu.org, larsi@gnus.org, Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17152821541975 (code B ref 70134); Thu, 09 May 2024 19:16:01 +0000 Received: (at 70134) by debbugs.gnu.org; 9 May 2024 19:15:54 +0000 Received: from localhost ([127.0.0.1]:40794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s59FB-0000Vn-7r for submit@debbugs.gnu.org; Thu, 09 May 2024 15:15:53 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:62245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s59F9-0000Vh-0n for 70134@debbugs.gnu.org; Thu, 09 May 2024 15:15:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1715282146; x=1715541346; bh=AHWaDzYpveyJ+K+yDeZW4PMowfOTGA150wt7rgl9gcg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=V/ue1oGlUVEFdAt4njkpneodpcfhwYLBRYCBvK5E4UncIcUZ54wXrHmq7xy4d7wha v0yB0DIp8NWWmSmTLyuAtEMPSPcRph2P3D5qRf9H26blsWejKO/hW6hkdbhmsTAZ9Y 2qfK1vX/yDGtM3tqrN5u3U/UB5pMM8t3wGwtfQx0pAl8OV7mZnTA+5+89BACCQOgDI UbWVEFIwmtgx8QOvSl7EEmbQ80e2bhuyXeC/Hf/eP0mtJLh+3He7MS2Zm1JdkSxrPW y7/uZO1EKCon4uSDGoF3YSFy/QVBRs+wo7fSVnBAZmP4YWjaIfQ7Er+X4qvhXI8E4G Y3d5QksFhApmg== Date: Thu, 09 May 2024 19:15:41 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87bk5eu78m.fsf@kubajecminek.cz> In-Reply-To: References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: e22e678d79b47ebb12249123ed9c1ba7afeba335 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Alex Bochannek" writes: > I finally had some time to look at these changes, apologies for the > delay. Thank you very much for your time and all your comments. > I like the approach and tested them out. The legal-types change in > gnus-summary-increase-score is straightforward and makes sense to me. I > have one stylistic comment: (nthcdr 3 s) seems to be easier to read to > me than (cdddr s), but I have no strong opinions on that. Thank you, I used (nthcdr 3 s) instead. > My suspicion is that this started out as a copy of the integer > comparison right above that code and I never cleaned it up. Yes, feel > free to simplify, I don't remember any good reason why it needs to pick > apart a list. It also seems perfectly fine to remove the (eq type > 'after) etc. stuff, it's not necessary anymore. I've adjusted only the age scoring part (not the integer comparison) because I did not studied that part of the code and there's still possibility that it is needed somehow. > The rest of the changes in gnus-summary-score-entry look good. I think > some more help text or additional documentation about the defaults would > be useful. It gets a bit confusing what you are prompted for. Having > said that, I like the idea of pulling a default date from the current > message, it just surprised me. I've added a comment explaining the changes I made to the date prompt. If you feel like the code needs more comments, please pinpoint where and I will add them. > I also think I might have found a bug in how the dates are written out > to the SCORE file. I interactively increased the score in the order of > <, r, n, b, and n as you can see below. Only the b, a, and n entries get > converted to the list format with the un-evaluated gnus-time after > another entry is written. Meaning the second and third entry below, the > "before" and "at," looked just like the topmost "at" entry before the > following entry was written. I've found the reason why it happens and found a solution. The problem is in the `gnus-date-get-time' macro. This macro accepts a single argument - date - and returns a different one - time - with text property added. However, this macro is written in such way that it modifies the input argument as well. We can fix it by adding `copy-sequence= ' function to the let form. > Hope this is useful! Very helpful yes. I've also noticed that the change I proposed - moving the part of the code which modifies match variable to the beginning of the `gnus-summary-score-entry' function is a bad idea because we're modifying input argument to the function. It would mean that if the user called the function non interactively (without prompt): (gnus-summary-score-entry "date" "55" '< 1000 nil) then it would change "55" to different number based on article age. I've moved that code back where it was. I attach the patch below. Thank you, Best >From 22c8bcc0b52b70baf9931d168a07fd69dbbd1e8c Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D Date: Thu, 9 May 2024 20:33:58 +0200 Subject: [PATCH] Show all date options when adding Gnus scores interactivel= y * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename 'char-to-type' variable to 'char-to-types' and bind all legal types for date header. * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better default values for each scoring type and cast 'match' to number only if necessary. --- lisp/gnus/gnus-score.el | 46 ++++++++++++++++++++--------------------- lisp/gnus/gnus-util.el | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 479b7496cf1..4e9e0083424 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -593,18 +593,18 @@ gnus-summary-increase-score =09 (?d "date" nil nil date) =09 (?f "followup" nil nil string) =09 (?t "thread" "message-id" nil string))) -=09 (char-to-type +=09 (char-to-types =09 '((?s s "substring" string) =09 (?e e "exact string" string) =09 (?f f "fuzzy string" string) -=09 (?r r "regexp string" string) +=09 (?r r "regexp string" string date) =09 (?z s "substring" body-string) =09 (?p r "regexp string" body-string) =09 (?b before "before date" date) =09 (?a after "after date" date) =09 (?n at "this date" date) -=09 (?< < "less than number" number) -=09 (?> > "greater than number" number) +=09 (?< < "less than number" number date) +=09 (?> > "greater than number" number date) =09 (?=3D =3D "equal to number" number))) =09 (current-score-file gnus-current-score-file) =09 (char-to-perm @@ -652,10 +652,9 @@ gnus-summary-increase-score =09 (let ((legal-types =09=09 (delq nil =09=09 (mapcar (lambda (s) -=09=09=09=09 (if (eq (nth 4 entry) -=09=09=09=09=09 (nth 3 s)) +=09=09=09=09 (if (member (nth 4 entry) (nthcdr 3 s)) =09=09=09=09 s nil)) -=09=09=09 char-to-type)))) +=09=09=09 char-to-types)))) (setq header-string (format "%s header `%s' with match type (%s?): " =09=09=09 (if increase "Increase" "Lower") @@ -894,12 +893,16 @@ gnus-summary-score-entry =09=09=09 header =09=09=09 (if (< score 0) "lower" "raise")) (cond ((numberp match) (int-to-string match)) + ;; Provide better defaults if we're scoring on da= te header ((string=3D header "date") - (int-to-string - (- - (/ (car (time-convert (current-time) 1)) 86400= ) - (/ (car (time-convert (gnus-date-get-time matc= h) 1)) - 86400)))) + (if (or (eq type '<) (eq type '>)) + ;; Determine the time difference in days bet= ween today + ;; and the article's date + (format-seconds "%d" + (time-subtract + (current-time) + (gnus-date-get-time match))= ) + (gnus-date-iso8601 match))) (t match))))) =20 ;; If this is an integer comparison, we transform from string to int. @@ -909,16 +912,13 @@ gnus-summary-score-entry (set-text-properties 0 (length match) nil match)) =20 ;; Modify match and type for article age scoring. - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) -=09(let ((age (string-to-number match))) -=09 (if (or (< age 0) -=09=09 (string=3D "0" match)) -=09 (user-error "Article age must be a positive number")) -=09 (setq match age -=09=09type (cond ((eq type 'after) -=09=09=09 '<) -=09=09=09 ((eq type 'before) -=09=09=09 '>))))) + (when (and (string=3D header "date") + (or (eq type '<) (eq type '>))) + (let ((age (string-to-number match))) + (if (or (< age 0) + (string=3D "0" match)) + (user-error "Article age must be a positive number")) + (setq match age))) =20 (unless (eq date 'now) ;; Add the score entry to the score file. @@ -1806,7 +1806,7 @@ gnus-score-date =09 ((eq type 'at) =09 (setq match-func 'string=3D =09=09 match (gnus-date-iso8601 (nth 0 kill)))) -=09 ((eq type 'regexp) +=09 ((or (eq type 'regexp) (eq type 'r)) =09 (setq match-func 'string-match =09=09 match (nth 0 kill))) =09 (t (error "Invalid match type: %s" type))) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 0b0a9bbfc1d..6097f517be0 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -377,7 +377,7 @@ gnus-date-get-time "Convert DATE string to Emacs time. Cache the result as a text property stored in DATE." ;; Either return the cached value... - `(let ((d ,date)) + `(let ((d (copy-sequence ,date))) (if (equal "" d) =09 0 (or (get-text-property 0 'gnus-time d) --=20 2.34.1 --=20 Kuba Je=C4=8Dm=C3=ADnek (http://kubajecminek.cz) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2024 00:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: 70134@debbugs.gnu.org, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , eliz@gnu.org, larsi@gnus.org, Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171529918313447 (code B ref 70134); Fri, 10 May 2024 00:00:01 +0000 Received: (at 70134) by debbugs.gnu.org; 9 May 2024 23:59:43 +0000 Received: from localhost ([127.0.0.1]:41417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Dfr-0003Up-8T for submit@debbugs.gnu.org; Thu, 09 May 2024 19:59:43 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:54926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Dfn-0003Uh-Q7 for 70134@debbugs.gnu.org; Thu, 09 May 2024 19:59:42 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id D216BFA09E; Thu, 9 May 2024 23:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1715299175; bh=pRqbSo7vqBPHZxtDDDonj2eR34G6gXvB+niECXloykc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AQaGsJ+Urq8pb9vJlMJZeM9A4m6fjGmlUGy2mxZVTxLYoP2CLBSP3rU0LOpY9z+c/ wEUIWDpsnG1wzK64I9wLper/fQQLN9dxom+Y6lHJcthGCWd6Kxc0pxOEYIjyXQx/fH IxzEk/MKxdCvpELszCgkjQFIrVms9k0Z1BXkKTws= From: Eric Abrahamsen In-Reply-To: <87bk5eu78m.fsf@kubajecminek.cz> ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\""'s message of "Thu, 09 May 2024 19:15:41 +0000") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> Date: Thu, 09 May 2024 16:59:33 -0700 Message-ID: <87bk5esfiy.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Jakub Je=C4=8Dm=C3=ADnek via "Bug reports for GNU Emacs, the Swiss army kni= fe of text editors" writes: > "Alex Bochannek" writes: > >> I finally had some time to look at these changes, apologies for the >> delay. > > Thank you very much for your time and all your comments. Thanks both to Alex for this response, and Jakub for your earlier explanation of what's going on. I'll try to add some more docstrings after this is resolved. >> I like the approach and tested them out. The legal-types change in >> gnus-summary-increase-score is straightforward and makes sense to me. I >> have one stylistic comment: (nthcdr 3 s) seems to be easier to read to >> me than (cdddr s), but I have no strong opinions on that. > > Thank you, I used (nthcdr 3 s) instead. > >> My suspicion is that this started out as a copy of the integer >> comparison right above that code and I never cleaned it up. Yes, feel >> free to simplify, I don't remember any good reason why it needs to pick >> apart a list. It also seems perfectly fine to remove the (eq type >> 'after) etc. stuff, it's not necessary anymore. > > I've adjusted only the age scoring part (not the integer comparison) > because I did not studied that part of the code and there's still > possibility that it is needed somehow. > >> The rest of the changes in gnus-summary-score-entry look good. I think >> some more help text or additional documentation about the defaults would >> be useful. It gets a bit confusing what you are prompted for. Having >> said that, I like the idea of pulling a default date from the current >> message, it just surprised me. > > I've added a comment explaining the changes I made to the date > prompt. If you feel like the code needs more comments, please pinpoint > where and I will add them. > >> I also think I might have found a bug in how the dates are written out >> to the SCORE file. I interactively increased the score in the order of >> <, r, n, b, and n as you can see below. Only the b, a, and n entries get >> converted to the list format with the un-evaluated gnus-time after >> another entry is written. Meaning the second and third entry below, the >> "before" and "at," looked just like the topmost "at" entry before the >> following entry was written. > > I've found the reason why it happens and found a solution. The problem > is in the `gnus-date-get-time' macro. This macro accepts a single > argument - date - and returns a different one - time - with text > property added. However, this macro is written in such way that it > modifies the input argument as well. We can fix it by adding `copy-sequen= ce' > function to the let form. This is grim, thanks for finding it. I'm inclined to fix this first in a stand-alone commit. >> Hope this is useful! > > Very helpful yes. > > I've also noticed that the change I proposed - moving the part of the > code which modifies match variable to the beginning of the > `gnus-summary-score-entry' function is a bad idea because we're > modifying input argument to the function. It would mean that if the user > called the function non interactively (without prompt): > > (gnus-summary-score-entry "date" "55" '< 1000 nil) > > then it would change "55" to different number based on article age. I've > moved that code back where it was. I attach the patch below. Alex has commit access to Emacs -- Alex would you please commit and close the bug once the two of you are happy with this? From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2024 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: 70134@debbugs.gnu.org, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , eliz@gnu.org, larsi@gnus.org, Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17153714916815 (code B ref 70134); Fri, 10 May 2024 20:05:02 +0000 Received: (at 70134) by debbugs.gnu.org; 10 May 2024 20:04:51 +0000 Received: from localhost ([127.0.0.1]:43861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WU6-0001lr-Eg for submit@debbugs.gnu.org; Fri, 10 May 2024 16:04:50 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:39178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WU4-0001lk-F6 for 70134@debbugs.gnu.org; Fri, 10 May 2024 16:04:49 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 43E38FA09E; Fri, 10 May 2024 20:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1715371481; bh=iB2neio6cAGz6isjwSFQ7QYQf13jC1vfGyHfrAixl/U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=o4PylDIFfzbvgFmEWGKHSfuNYFeP1qPcdaFmHVOze3tQDr0DY6DYGQX1Bm3Wlmh/I g30NXHRJxxQafHdjz56Dn5N3kxjNOBpKjnpNQQtUlm/sfwcTebEWyDFZK2NDtiXAKI I7rkr5NJL7Hdm+k7gEH184Z74dVI7f+b57FNoAFU= From: Eric Abrahamsen In-Reply-To: <87bk5esfiy.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 09 May 2024 16:59:33 -0700") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> Date: Fri, 10 May 2024 13:04:39 -0700 Message-ID: <87y18hph60.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Abrahamsen writes: > Jakub Je=C4=8Dm=C3=ADnek via "Bug reports for GNU Emacs, the Swiss army k= nife of > text editors" writes: > >> "Alex Bochannek" writes: >> >>> I finally had some time to look at these changes, apologies for the >>> delay. >> >> Thank you very much for your time and all your comments. > > Thanks both to Alex for this response, and Jakub for your earlier > explanation of what's going on. I'll try to add some more docstrings > after this is resolved. > >>> I like the approach and tested them out. The legal-types change in >>> gnus-summary-increase-score is straightforward and makes sense to me. I >>> have one stylistic comment: (nthcdr 3 s) seems to be easier to read to >>> me than (cdddr s), but I have no strong opinions on that. >> >> Thank you, I used (nthcdr 3 s) instead. >> >>> My suspicion is that this started out as a copy of the integer >>> comparison right above that code and I never cleaned it up. Yes, feel >>> free to simplify, I don't remember any good reason why it needs to pick >>> apart a list. It also seems perfectly fine to remove the (eq type >>> 'after) etc. stuff, it's not necessary anymore. >> >> I've adjusted only the age scoring part (not the integer comparison) >> because I did not studied that part of the code and there's still >> possibility that it is needed somehow. >> >>> The rest of the changes in gnus-summary-score-entry look good. I think >>> some more help text or additional documentation about the defaults would >>> be useful. It gets a bit confusing what you are prompted for. Having >>> said that, I like the idea of pulling a default date from the current >>> message, it just surprised me. >> >> I've added a comment explaining the changes I made to the date >> prompt. If you feel like the code needs more comments, please pinpoint >> where and I will add them. >> >>> I also think I might have found a bug in how the dates are written out >>> to the SCORE file. I interactively increased the score in the order of >>> <, r, n, b, and n as you can see below. Only the b, a, and n entries get >>> converted to the list format with the un-evaluated gnus-time after >>> another entry is written. Meaning the second and third entry below, the >>> "before" and "at," looked just like the topmost "at" entry before the >>> following entry was written. >> >> I've found the reason why it happens and found a solution. The problem >> is in the `gnus-date-get-time' macro. This macro accepts a single >> argument - date - and returns a different one - time - with text >> property added. However, this macro is written in such way that it >> modifies the input argument as well. We can fix it by adding `copy-seque= nce' >> function to the let form. > > This is grim, thanks for finding it. I'm inclined to fix this first in a > stand-alone commit. And sure enough, the modification of the string is the point -- it's a cache! From gnus-sum.el: ; Since this is called not only to sort the top-level threads, but ; also in recursive sorts to order the articles within a thread, each ; article will be processed many times. Thus it speeds things up ; quite a bit to use gnus-date-get-time, which caches the time value. (defun gnus-thread-latest-date (thread) "Return the highest article date in THREAD." (apply #'max (mapcar (lambda (header) (float-time (gnus-date-get-time (mail-header-date header)))) (flatten-tree thread)))) Can we strip properties around the call, maybe? From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2024 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17153734998380 (code B ref 70134); Fri, 10 May 2024 20:39:01 +0000 Received: (at 70134) by debbugs.gnu.org; 10 May 2024 20:38:19 +0000 Received: from localhost ([127.0.0.1]:44009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5X0U-0002B6-II for submit@debbugs.gnu.org; Fri, 10 May 2024 16:38:18 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:45829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5X0S-0002Ay-LW for 70134@debbugs.gnu.org; Fri, 10 May 2024 16:38:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1715373491; x=1715632691; bh=4rKN1qIvhbT1PEVt4Ah85UZKTGxrurxAojjLXCz1ncc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=f/oDs44+A9zs2RTQwfyfiRN04mZGGTZnwfpx8qLV2hae3aP6FMNfZ9UhYyrPAMdKX aeX7ey3s6ThhB/ljl+0swCXPw9nbzs9dlrb0pG3FUGYV/TYH+opfaG7RG3bA3GcjJM yScrFgxuIbYkJ3ZIGYq8zlQ+wL14k/uJzPPUhOH0ynt2R+IcI2PXhNgSRoPGdVJJ5I GXvJ7rtLIOvt36rRfdPeFgtDij3JrIFm+vFKz5ir17/hSyG+xKYoH1TgTPHdqhPo/v HCX0m4mNXInGGxiygjfzI15G8rBCdtTZYjXcML05miUYc9N07mqLkAWvr5q+RdfXz7 8vcBoI/QddXxA== Date: Fri, 10 May 2024 20:38:07 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: In-Reply-To: <87y18hph60.fsf@ericabrahamsen.net> References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 5cef0e1106041ecdda0bba9e980b701ce34d5f9e MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_tn4p0mFy6Cd68K08rsf6WBHeCBIWrGTdHfIKmBbBjyk" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --b1_tn4p0mFy6Cd68K08rsf6WBHeCBIWrGTdHfIKmBbBjyk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 QXBvbG9naWVzIGZvciB0aGUgZm9ybWF0dGluZywgSeKAmW0gd3JpdGluZyB0aGlzIHJlcGx5IGZy b20gbXkgcGhvbmUuCgo+IEFuZCBzdXJlIGVub3VnaCwgdGhlIG1vZGlmaWNhdGlvbiBvZiB0aGUg c3RyaW5nIGlzIHRoZSBwb2ludCAtLSBpdCdzIGEKPiBjYWNoZSEgRnJvbSBnbnVzLXN1bS5lbDoK Pgo+IDsgU2luY2UgdGhpcyBpcyBjYWxsZWQgbm90IG9ubHkgdG8gc29ydCB0aGUgdG9wLWxldmVs IHRocmVhZHMsIGJ1dAo+IDsgYWxzbyBpbiByZWN1cnNpdmUgc29ydHMgdG8gb3JkZXIgdGhlIGFy dGljbGVzIHdpdGhpbiBhIHRocmVhZCwgZWFjaAo+IDsgYXJ0aWNsZSB3aWxsIGJlIHByb2Nlc3Nl ZCBtYW55IHRpbWVzLiBUaHVzIGl0IHNwZWVkcyB0aGluZ3MgdXAKPiA7IHF1aXRlIGEgYml0IHRv IHVzZSBnbnVzLWRhdGUtZ2V0LXRpbWUsIHdoaWNoIGNhY2hlcyB0aGUgdGltZSB2YWx1ZS4KPiAo ZGVmdW4gZ251cy10aHJlYWQtbGF0ZXN0LWRhdGUgKHRocmVhZCkKPiAiUmV0dXJuIHRoZSBoaWdo ZXN0IGFydGljbGUgZGF0ZSBpbiBUSFJFQUQuIgo+IChhcHBseSAjJ21heAo+IChtYXBjYXIgKGxh bWJkYSAoaGVhZGVyKSAoZmxvYXQtdGltZQo+IChnbnVzLWRhdGUtZ2V0LXRpbWUKPiAobWFpbC1o ZWFkZXItZGF0ZSBoZWFkZXIpKSkpCj4gKGZsYXR0ZW4tdHJlZSB0aHJlYWQpKSkpCj4KPiBDYW4g d2Ugc3RyaXAgcHJvcGVydGllcyBhcm91bmQgdGhlIGNhbGwsIG1heWJlPwoKSSBkb27igJl0IHRo aW5rIHRoZXJl4oCZcyBuZWVkIHRvIGRvIHRoYXQuIFRoZSBjaGFuZ2UgdGhhdCBJIHByb3Bvc2Vk IGluIHRoZSBwYXRjaCBzaG91bGQgcmVtb3ZlIHRoZSB1bmludGVuZGVkIHNpZGUgZWZmZWN0IChh bmQgdGh1cyBmaXggdGhlIGJ1ZyBwb2ludGVkIGJ5IEFsZXgpIHdoaWxlIGtlZXBpbmcgdGhlIGNh Y2hpbmcgYmVoYXZpb3VyIGludGFjdCAo4oCYZ251cy10aHJlYWQtbGF0ZXN0LWRhdGXigJkgY29k ZSBhYm92ZSB3aWxsIHdvcmsgYXMgZXhwZWN0ZWQpLg== --b1_tn4p0mFy6Cd68K08rsf6WBHeCBIWrGTdHfIKmBbBjyk Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5PiAgIDxkaXYgZGlyPSJhdXRvIj5BcG9sb2dpZXMgZm9y IHRoZSBmb3JtYXR0aW5nLCBJ4oCZbSB3cml0aW5nIHRoaXMgcmVwbHkgZnJvbSBteSBwaG9uZS48 YnI+PC9kaXY+PGJsb2NrcXVvdGUgdHlwZT0iY2l0ZSIgY2xhc3M9InByb3Rvbm1haWxfcXVvdGUi IGRpcj0iYXV0byI+QW5kIHN1cmUgZW5vdWdoLCB0aGUgbW9kaWZpY2F0aW9uIG9mIHRoZSBzdHJp bmcgaXMgdGhlIHBvaW50IC0tIGl0J3MgYTxicj5jYWNoZSEgRnJvbSBnbnVzLXN1bS5lbDo8YnI+ PGJyPjsgU2luY2UgdGhpcyBpcyBjYWxsZWQgbm90IG9ubHkgdG8gc29ydCB0aGUgdG9wLWxldmVs IHRocmVhZHMsIGJ1dDxicj47IGFsc28gaW4gcmVjdXJzaXZlIHNvcnRzIHRvIG9yZGVyIHRoZSBh cnRpY2xlcyB3aXRoaW4gYSB0aHJlYWQsIGVhY2g8YnI+OyBhcnRpY2xlIHdpbGwgYmUgcHJvY2Vz c2VkIG1hbnkgdGltZXMuICBUaHVzIGl0IHNwZWVkcyB0aGluZ3MgdXA8YnI+OyBxdWl0ZSBhIGJp dCB0byB1c2UgZ251cy1kYXRlLWdldC10aW1lLCB3aGljaCBjYWNoZXMgdGhlIHRpbWUgdmFsdWUu PGJyPihkZWZ1biBnbnVzLXRocmVhZC1sYXRlc3QtZGF0ZSAodGhyZWFkKTxicj4gICJSZXR1cm4g dGhlIGhpZ2hlc3QgYXJ0aWNsZSBkYXRlIGluIFRIUkVBRC4iPGJyPiAgKGFwcGx5ICMnbWF4PGJy PgkgKG1hcGNhciAobGFtYmRhIChoZWFkZXIpIChmbG9hdC10aW1lPGJyPgkJCQkgICAoZ251cy1k YXRlLWdldC10aW1lPGJyPgkJCQkgICAgKG1haWwtaGVhZGVyLWRhdGUgaGVhZGVyKSkpKTxicj4J CSAoZmxhdHRlbi10cmVlIHRocmVhZCkpKSk8YnI+PGJyPkNhbiB3ZSBzdHJpcCBwcm9wZXJ0aWVz IGFyb3VuZCB0aGUgY2FsbCwgbWF5YmU/PC9ibG9ja3F1b3RlPkkgZG9u4oCZdCB0aGluayB0aGVy ZeKAmXMgbmVlZCB0byBkbyB0aGF0LiBUaGUgY2hhbmdlIHRoYXQgSSBwcm9wb3NlZCBpbiB0aGUg cGF0Y2ggc2hvdWxkIHJlbW92ZSB0aGUgdW5pbnRlbmRlZCBzaWRlIGVmZmVjdCAoYW5kIHRodXMg Zml4IHRoZSBidWcgcG9pbnRlZCBieSBBbGV4KSB3aGlsZSBrZWVwaW5nIHRoZSBjYWNoaW5nIGJl aGF2aW91ciBpbnRhY3QgKOKAmGdudXMtdGhyZWFkLWxhdGVzdC1kYXRl4oCZIGNvZGUgYWJvdmUg d2lsbCB3b3JrIGFzIGV4cGVjdGVkKS48L2JvZHk+PC9odG1sPg== --b1_tn4p0mFy6Cd68K08rsf6WBHeCBIWrGTdHfIKmBbBjyk-- From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively In-Reply-To: <87edbovjvj.fsf@kubajecminek.cz> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2024 21:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 70134@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171537649510294 (code B ref -1); Fri, 10 May 2024 21:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2024 21:28:15 +0000 Received: from localhost ([127.0.0.1]:44215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Xmo-0002fy-Ux for submit@debbugs.gnu.org; Fri, 10 May 2024 17:28:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:55660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Xmm-0002fq-Oh for submit@debbugs.gnu.org; Fri, 10 May 2024 17:28:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Xmn-0005Qo-46 for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 17:28:13 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5Xml-0002zd-Mb for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 17:28:12 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1s5Xmi-0000eO-JM for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 23:28:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Eric Abrahamsen Date: Fri, 10 May 2024 14:27:58 -0700 Message-ID: <87plttpdb5.fsf@ericabrahamsen.net> References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:UJT81cZw4F81f4iRHPF1sQxtkbw= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Apologies for the formatting, I’m writing this reply from my phone. > >> And sure enough, the modification of the string is the point -- it's a >> cache! From gnus-sum.el: >> >> ; Since this is called not only to sort the top-level threads, but >> ; also in recursive sorts to order the articles within a thread, each >> ; article will be processed many times. Thus it speeds things up >> ; quite a bit to use gnus-date-get-time, which caches the time value. >> (defun gnus-thread-latest-date (thread) >> "Return the highest article date in THREAD." >> (apply #'max >> (mapcar (lambda (header) (float-time >> (gnus-date-get-time >> (mail-header-date header)))) >> (flatten-tree thread)))) >> >> Can we strip properties around the call, maybe? > > I don’t think there’s need to do that. The change that I proposed in > the patch should remove the unintended side effect (and thus fix the > bug pointed by Alex) while keeping the caching behaviour intact > (‘gnus-thread-latest-date’ code above will work as expected). Okay, thanks. I won't mess with it, then. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 02:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Cc: Eric Abrahamsen , "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171565209618959 (code B ref 70134); Tue, 14 May 2024 02:02:01 +0000 Received: (at 70134) by debbugs.gnu.org; 14 May 2024 02:01:36 +0000 Received: from localhost ([127.0.0.1]:36163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6hU0-0004vi-8X for submit@debbugs.gnu.org; Mon, 13 May 2024 22:01:36 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:9022 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6hTv-0004va-9J for 70134@debbugs.gnu.org; Mon, 13 May 2024 22:01:34 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4Vdfgk2lLLz3ps31; Mon, 13 May 2024 19:00:02 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?="'s message of "Fri, 10 May 2024 20:38:07 +0000") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> Date: Mon, 13 May 2024 19:00:01 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jakub, I see that your changes to gnus-score.el have been committed, but not the one you proposed to gnus-util.el yet. Let me know if you need me to test anything! -- Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 14:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171569833723795 (code B ref 70134); Tue, 14 May 2024 14:53:01 +0000 Received: (at 70134) by debbugs.gnu.org; 14 May 2024 14:52:17 +0000 Received: from localhost ([127.0.0.1]:39787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6tVp-0006Bj-Ai for submit@debbugs.gnu.org; Tue, 14 May 2024 10:52:17 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:33294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6tVm-0006Bd-OA for 70134@debbugs.gnu.org; Tue, 14 May 2024 10:52:16 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 4304AFA396; Tue, 14 May 2024 14:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1715698327; bh=ZhOr0s4kc7IsqaTMRB+99t7rmWiOMgb8kJVJDtYZgSc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=p/q3vlI8n4Bc8FIBLnAmbN8T285R/UZeR9ZQ5JDuFsCGbYeiYtRSd24jqhBZ4+bvL YvJJ6cTy4M8t5rBRR60PIIJ0lRbPQGObZFmaKhvpDhT0/FcozCq66mj0ZtmyaDUKph Zpc9k+F0tCy+BvLlHz+AxQHYeYZzcB7GHQk4vGuc= From: Eric Abrahamsen In-Reply-To: (Alex Bochannek's message of "Mon, 13 May 2024 19:00:01 -0700") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> Date: Tue, 14 May 2024 07:52:06 -0700 Message-ID: <87h6f08mzt.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alex Bochannek writes: > Jakub, > > I see that your changes to gnus-score.el have been committed, but not > the one you proposed to gnus-util.el yet. Let me know if you need me to > test anything! The commit from February was a different issue in the same area -- nothing from this bug report has been committed yet. Thanks, Eric From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 18:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171571224713115 (code B ref 70134); Tue, 14 May 2024 18:45:01 +0000 Received: (at 70134) by debbugs.gnu.org; 14 May 2024 18:44:07 +0000 Received: from localhost ([127.0.0.1]:40825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6x8A-0003PS-Oo for submit@debbugs.gnu.org; Tue, 14 May 2024 14:44:07 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:56351 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6x84-0003Oy-Tm for 70134@debbugs.gnu.org; Tue, 14 May 2024 14:44:05 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4Vf4y367B9z3pvbD; Tue, 14 May 2024 11:43:55 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: <87h6f08mzt.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 14 May 2024 07:52:06 -0700") References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> <87h6f08mzt.fsf@ericabrahamsen.net> Date: Tue, 14 May 2024 11:43:54 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric, Eric Abrahamsen writes: > Alex Bochannek writes: > >> Jakub, >> >> I see that your changes to gnus-score.el have been committed, but not >> the one you proposed to gnus-util.el yet. Let me know if you need me to >> test anything! > > The commit from February was a different issue in the same area -- > nothing from this bug report has been committed yet. You are absolutely correct, of course, I mistook the log entry and changes in that commit for what we are discussing here. I have done some more testing with a fresh build and the most recent patch works as Jakub intends. I would like to suggest to add a change to (gnus) Summary Score Commands to include the new match types. Otherwise, I believe this patch is good to go. I don't think I have commit rights, by the way (usually larsi or eliz did them for me), but I would be more than happy to do so if someone can point me at instructions. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c5e4c885ccf..56f259db9a1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -20093,6 +20093,9 @@ Summary Score Commands @item date @table @kbd +@item r +Regexp matching. + @item b Before date. @@ -20101,6 +20104,12 @@ Summary Score Commands @item n This date. + +@item < +Less than days. + +@item > +Greater than days. @end table @item number -- Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 19:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: Eric Abrahamsen , "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171571665816900 (code B ref 70134); Tue, 14 May 2024 19:58:03 +0000 Received: (at 70134) by debbugs.gnu.org; 14 May 2024 19:57:38 +0000 Received: from localhost ([127.0.0.1]:41160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6yHI-0004OV-JZ for submit@debbugs.gnu.org; Tue, 14 May 2024 15:57:38 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:61469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6yHF-0004OF-Br for 70134@debbugs.gnu.org; Tue, 14 May 2024 15:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1715716646; x=1715975846; bh=E7fr/dJBuqY8oQlBc0htj1lWhvRymAKhoHSor/Wc03A=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=NvQLt1gur2hmScRBsGOFO4yVu15sRFeOGRx7S1JtmQX3eNt0cK6h6pZlFNDSl232+ Lnr84jqAjTDxMv8X13MZx06bQ1z+d9uj9DapPVa9+K4aPsw4xfFWG15H7NieFMSs5s 8ri1/9D4ZGCAAJCAs87jnpJyiZ9WCdRzVvEkHyMMJKaq27iZEBR0tZoeAwDc9oFPJb d5P/WH7ZqJqa2h9Me4j3dLQZNvNNmgXyKymfhn/MB//C9AN4unHyzBFaxnXqiSqv8Z s2FhXP8P6ngfw5JR74PuVGpPYTaVXolPSA2IR3FCbQV9PI69MSaOg2Ywy47AEIWD5n K2PBUVH7I0LTA== Date: Tue, 14 May 2024 19:57:20 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87zfssdv50.fsf@kubajecminek.cz> In-Reply-To: References: <87edbovjvj.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> <87h6f08mzt.fsf@ericabrahamsen.net> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 7a674d150a584ae7722ea407f69ece1f8f36de75 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Alex Bochannek" writes: > I have done some more testing with a fresh build and the most recent > patch works as Jakub intends. I would like to suggest to add a change to > (gnus) Summary Score Commands to include the new match types. Otherwise, > I believe this patch is good to go. Thank you very much! > diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi > index c5e4c885ccf..56f259db9a1 100644 > --- a/doc/misc/gnus.texi > +++ b/doc/misc/gnus.texi > @@ -20093,6 +20093,9 @@ Summary Score Commands > @item date > @table @kbd > > +@item r > +Regexp matching. > + > @item b > Before date. > > @@ -20101,6 +20104,12 @@ Summary Score Commands > > @item n > This date. > + > +@item < > +Less than days. > + > +@item > > +Greater than days. > @end table > > @item number > > > -- I've applied the patch and added co-authored-by message. >From d69cf006f2e42da61714a179eb48a345a082fcf9 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D Date: Thu, 9 May 2024 20:33:58 +0200 Subject: [PATCH] Show all date options when adding Gnus scores interactivel= y * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename 'char-to-type' variable to 'char-to-types' and bind all legal types for date header. * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better default values for each scoring type and cast 'match' to number only if necessary. Co-authored-by: Alex Bochannek --- doc/misc/gnus.texi | 9 ++++++++ lisp/gnus/gnus-score.el | 46 ++++++++++++++++++++--------------------- lisp/gnus/gnus-util.el | 2 +- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c5e4c885ccf..56f259db9a1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -20093,6 +20093,9 @@ Summary Score Commands @item date @table @kbd =20 +@item r +Regexp matching. + @item b Before date. =20 @@ -20101,6 +20104,12 @@ Summary Score Commands =20 @item n This date. + +@item < +Less than days. + +@item > +Greater than days. @end table =20 @item number diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 479b7496cf1..4e9e0083424 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -593,18 +593,18 @@ gnus-summary-increase-score =09 (?d "date" nil nil date) =09 (?f "followup" nil nil string) =09 (?t "thread" "message-id" nil string))) -=09 (char-to-type +=09 (char-to-types =09 '((?s s "substring" string) =09 (?e e "exact string" string) =09 (?f f "fuzzy string" string) -=09 (?r r "regexp string" string) +=09 (?r r "regexp string" string date) =09 (?z s "substring" body-string) =09 (?p r "regexp string" body-string) =09 (?b before "before date" date) =09 (?a after "after date" date) =09 (?n at "this date" date) -=09 (?< < "less than number" number) -=09 (?> > "greater than number" number) +=09 (?< < "less than number" number date) +=09 (?> > "greater than number" number date) =09 (?=3D =3D "equal to number" number))) =09 (current-score-file gnus-current-score-file) =09 (char-to-perm @@ -652,10 +652,9 @@ gnus-summary-increase-score =09 (let ((legal-types =09=09 (delq nil =09=09 (mapcar (lambda (s) -=09=09=09=09 (if (eq (nth 4 entry) -=09=09=09=09=09 (nth 3 s)) +=09=09=09=09 (if (member (nth 4 entry) (nthcdr 3 s)) =09=09=09=09 s nil)) -=09=09=09 char-to-type)))) +=09=09=09 char-to-types)))) (setq header-string (format "%s header `%s' with match type (%s?): " =09=09=09 (if increase "Increase" "Lower") @@ -894,12 +893,16 @@ gnus-summary-score-entry =09=09=09 header =09=09=09 (if (< score 0) "lower" "raise")) (cond ((numberp match) (int-to-string match)) + ;; Provide better defaults if we're scoring on da= te header ((string=3D header "date") - (int-to-string - (- - (/ (car (time-convert (current-time) 1)) 86400= ) - (/ (car (time-convert (gnus-date-get-time matc= h) 1)) - 86400)))) + (if (or (eq type '<) (eq type '>)) + ;; Determine the time difference in days bet= ween today + ;; and the article's date + (format-seconds "%d" + (time-subtract + (current-time) + (gnus-date-get-time match))= ) + (gnus-date-iso8601 match))) (t match))))) =20 ;; If this is an integer comparison, we transform from string to int. @@ -909,16 +912,13 @@ gnus-summary-score-entry (set-text-properties 0 (length match) nil match)) =20 ;; Modify match and type for article age scoring. - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) -=09(let ((age (string-to-number match))) -=09 (if (or (< age 0) -=09=09 (string=3D "0" match)) -=09 (user-error "Article age must be a positive number")) -=09 (setq match age -=09=09type (cond ((eq type 'after) -=09=09=09 '<) -=09=09=09 ((eq type 'before) -=09=09=09 '>))))) + (when (and (string=3D header "date") + (or (eq type '<) (eq type '>))) + (let ((age (string-to-number match))) + (if (or (< age 0) + (string=3D "0" match)) + (user-error "Article age must be a positive number")) + (setq match age))) =20 (unless (eq date 'now) ;; Add the score entry to the score file. @@ -1806,7 +1806,7 @@ gnus-score-date =09 ((eq type 'at) =09 (setq match-func 'string=3D =09=09 match (gnus-date-iso8601 (nth 0 kill)))) -=09 ((eq type 'regexp) +=09 ((or (eq type 'regexp) (eq type 'r)) =09 (setq match-func 'string-match =09=09 match (nth 0 kill))) =09 (t (error "Invalid match type: %s" type))) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 0b0a9bbfc1d..6097f517be0 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -377,7 +377,7 @@ gnus-date-get-time "Convert DATE string to Emacs time. Cache the result as a text property stored in DATE." ;; Either return the cached value... - `(let ((d ,date)) + `(let ((d (copy-sequence ,date))) (if (equal "" d) =09 0 (or (get-text-property 0 'gnus-time d) --=20 2.34.1 Best --=20 Kuba Je=C4=8Dm=C3=ADnek (http://kubajecminek.cz) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2024 14:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171586892727493 (code B ref 70134); Thu, 16 May 2024 14:16:01 +0000 Received: (at 70134) by debbugs.gnu.org; 16 May 2024 14:15:27 +0000 Received: from localhost ([127.0.0.1]:48977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7btG-00079N-Kn for submit@debbugs.gnu.org; Thu, 16 May 2024 10:15:27 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:42324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7btE-00079F-Sg for 70134@debbugs.gnu.org; Thu, 16 May 2024 10:15:25 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 86AF1FA01F; Thu, 16 May 2024 14:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1715868915; bh=HGYfsflVdsmqfCh2QEmG0hM7vSJwq2c9HpDMXH1SnEs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Aq0rPO7ImphlDFHC1wirHUH9onPxhVJuh6+dLTNhYFFxOZxx4bJC3m3iMBSKqkC1Q 40uflVEz2tknv0bzrnvSPHDJncOFylAjFuBTuJbg6GOBzESn4ZegORH4B/L4HRB7f1 wCdcDeVqlt8Yxkm64Zpu9vsz6+zbx4wHltrPN2No= From: Eric Abrahamsen In-Reply-To: <87zfssdv50.fsf@kubajecminek.cz> ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\""'s message of "Tue, 14 May 2024 19:57:20 +0000") References: <87edbovjvj.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> <87h6f08mzt.fsf@ericabrahamsen.net> <87zfssdv50.fsf@kubajecminek.cz> Date: Thu, 16 May 2024 07:15:14 -0700 Message-ID: <87ikzd7si5.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Jakub Je=C4=8Dm=C3=ADnek via "Bug reports for GNU Emacs, the Swiss army kni= fe of text editors" writes: > "Alex Bochannek" writes: >> I have done some more testing with a fresh build and the most recent >> patch works as Jakub intends. I would like to suggest to add a change to >> (gnus) Summary Score Commands to include the new match types. Otherwise, >> I believe this patch is good to go. > > Thank you very much! > >> diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi >> index c5e4c885ccf..56f259db9a1 100644 >> --- a/doc/misc/gnus.texi >> +++ b/doc/misc/gnus.texi >> @@ -20093,6 +20093,9 @@ Summary Score Commands >> @item date >> @table @kbd >> >> +@item r >> +Regexp matching. >> + >> @item b >> Before date. >> >> @@ -20101,6 +20104,12 @@ Summary Score Commands >> >> @item n >> This date. >> + >> +@item < >> +Less than days. >> + >> +@item > >> +Greater than days. >> @end table >> >> @item number >> >> >> -- > > I've applied the patch and added co-authored-by message. > > From d69cf006f2e42da61714a179eb48a345a082fcf9 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D > Date: Thu, 9 May 2024 20:33:58 +0200 > Subject: [PATCH] Show all date options when adding Gnus scores interactiv= ely > > * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename > 'char-to-type' variable to 'char-to-types' and bind all legal types > for date header. > > * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better > default values for each scoring type and cast 'match' to number only > if necessary. > > Co-authored-by: Alex Bochannek > --- > doc/misc/gnus.texi | 9 ++++++++ > lisp/gnus/gnus-score.el | 46 ++++++++++++++++++++--------------------- > lisp/gnus/gnus-util.el | 2 +- > 3 files changed, 33 insertions(+), 24 deletions(-) > > diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi > index c5e4c885ccf..56f259db9a1 100644 > --- a/doc/misc/gnus.texi > +++ b/doc/misc/gnus.texi > @@ -20093,6 +20093,9 @@ Summary Score Commands > @item date > @table @kbd >=20=20 > +@item r > +Regexp matching. > + > @item b > Before date. >=20=20 > @@ -20101,6 +20104,12 @@ Summary Score Commands >=20=20 > @item n > This date. > + > +@item < > +Less than days. > + > +@item > > +Greater than days. > @end table >=20=20 > @item number > diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el > index 479b7496cf1..4e9e0083424 100644 > --- a/lisp/gnus/gnus-score.el > +++ b/lisp/gnus/gnus-score.el > @@ -593,18 +593,18 @@ gnus-summary-increase-score > (?d "date" nil nil date) > (?f "followup" nil nil string) > (?t "thread" "message-id" nil string))) > - (char-to-type > + (char-to-types > '((?s s "substring" string) > (?e e "exact string" string) > (?f f "fuzzy string" string) > - (?r r "regexp string" string) > + (?r r "regexp string" string date) > (?z s "substring" body-string) > (?p r "regexp string" body-string) > (?b before "before date" date) > (?a after "after date" date) > (?n at "this date" date) > - (?< < "less than number" number) > - (?> > "greater than number" number) > + (?< < "less than number" number date) > + (?> > "greater than number" number date) > (?=3D =3D "equal to number" number))) > (current-score-file gnus-current-score-file) > (char-to-perm > @@ -652,10 +652,9 @@ gnus-summary-increase-score > (let ((legal-types > (delq nil > (mapcar (lambda (s) > - (if (eq (nth 4 entry) > - (nth 3 s)) > + (if (member (nth 4 entry) (nthcdr 3 s)) > s nil)) > - char-to-type)))) > + char-to-types)))) > (setq header-string > (format "%s header `%s' with match type (%s?): " > (if increase "Increase" "Lower") > @@ -894,12 +893,16 @@ gnus-summary-score-entry > header > (if (< score 0) "lower" "raise")) > (cond ((numberp match) (int-to-string match)) > + ;; Provide better defaults if we're scoring on = date header > ((string=3D header "date") > - (int-to-string > - (- > - (/ (car (time-convert (current-time) 1)) 864= 00) > - (/ (car (time-convert (gnus-date-get-time ma= tch) 1)) > - 86400)))) > + (if (or (eq type '<) (eq type '>)) > + ;; Determine the time difference in days b= etween today > + ;; and the article's date > + (format-seconds "%d" > + (time-subtract > + (current-time) > + (gnus-date-get-time match= ))) > + (gnus-date-iso8601 match))) > (t match))))) >=20=20 > ;; If this is an integer comparison, we transform from string to int. > @@ -909,16 +912,13 @@ gnus-summary-score-entry > (set-text-properties 0 (length match) nil match)) >=20=20 > ;; Modify match and type for article age scoring. > - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) > - (let ((age (string-to-number match))) > - (if (or (< age 0) > - (string=3D "0" match)) > - (user-error "Article age must be a positive number")) > - (setq match age > - type (cond ((eq type 'after) > - '<) > - ((eq type 'before) > - '>))))) > + (when (and (string=3D header "date") > + (or (eq type '<) (eq type '>))) > + (let ((age (string-to-number match))) > + (if (or (< age 0) > + (string=3D "0" match)) > + (user-error "Article age must be a positive number")) > + (setq match age))) >=20=20 > (unless (eq date 'now) > ;; Add the score entry to the score file. > @@ -1806,7 +1806,7 @@ gnus-score-date > ((eq type 'at) > (setq match-func 'string=3D > match (gnus-date-iso8601 (nth 0 kill)))) > - ((eq type 'regexp) > + ((or (eq type 'regexp) (eq type 'r)) > (setq match-func 'string-match > match (nth 0 kill))) > (t (error "Invalid match type: %s" type))) > diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el > index 0b0a9bbfc1d..6097f517be0 100644 > --- a/lisp/gnus/gnus-util.el > +++ b/lisp/gnus/gnus-util.el > @@ -377,7 +377,7 @@ gnus-date-get-time > "Convert DATE string to Emacs time. > Cache the result as a text property stored in DATE." > ;; Either return the cached value... > - `(let ((d ,date)) > + `(let ((d (copy-sequence ,date))) My previous message about this macro still stands, though -- this change would break other code's use of the macro as a "cache". Is there another way to resolve the problem? From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2024 19:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171588842211358 (code B ref 70134); Thu, 16 May 2024 19:41:02 +0000 Received: (at 70134) by debbugs.gnu.org; 16 May 2024 19:40:22 +0000 Received: from localhost ([127.0.0.1]:50588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7gxi-0002x8-2z for submit@debbugs.gnu.org; Thu, 16 May 2024 15:40:22 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:36135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7gxc-0002x1-5g for 70134@debbugs.gnu.org; Thu, 16 May 2024 15:40:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1715888407; x=1716147607; bh=YmWDdEdXhxKxwJknYwvIYE5qckUPVlE6//jDYiZ9Lwo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=jilybH0kWMN/HPnykWINkr6zmmCbdDjBpEQLybniAeOGQGx3iRvNoDayLzmlhl5qT O8MgJs67qQA4pFkHAnSiDdMv+ZkVI1hZ3TD+MAytJFesvDnc46rNVIEnnRwzqHqIWs 4vn3uvgQ3IoFoTzGlHU9k5aPl/unm6Vaqw5Eqp59M9W9AerAoEgyAeRNxeR0+u9LKS datY5LbvBDm2b1HFThunxNUfjRlGLRP1WpbxRYoLbcfkcScDVQLCe3lqWr0YsN0cBg DrPJS9D2GkBAiTaH+jXHIsg2dMbBtsqpt2GrTHTJ0JpTMpqwGw6kxhRZTF1plxVimc ZkTNFZqEmlg1g== Date: Thu, 16 May 2024 19:40:03 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <874jaxzgtr.fsf@kubajecminek.cz> In-Reply-To: <87ikzd7si5.fsf@ericabrahamsen.net> References: <87edbovjvj.fsf@kubajecminek.cz> <87bk5esfiy.fsf@ericabrahamsen.net> <87y18hph60.fsf@ericabrahamsen.net> <87h6f08mzt.fsf@ericabrahamsen.net> <87zfssdv50.fsf@kubajecminek.cz> <87ikzd7si5.fsf@ericabrahamsen.net> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: d5249c09dc5c721762efa3f589b9495b5fe67bbe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) "Eric Abrahamsen" writes: > My previous message about this macro still stands, though -- this change > would break other code's use of the macro as a "cache". Is there another > way to resolve the problem? Oh, shoot, I realized the mistake only when I wrote the ert tests as a response to this message. I stand corrected, I'm sorry. I have to think abo= ut other ways how to resolve the bug, though... I'm sending the patch without the macro change: >From e281f37263ca6b307df9ca124d7d3121d86a2b11 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D Date: Thu, 16 May 2024 21:38:01 +0200 Subject: [PATCH] Show all date options when adding Gnus scores interactivel= y * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename 'char-to-type' variable to 'char-to-types' and bind all legal types for date header. * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better default values for each scoring type and cast 'match' to number only if necessary. Co-authored-by: Alex Bochannek --- doc/misc/gnus.texi | 9 ++++++++ lisp/gnus/gnus-score.el | 46 ++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c5e4c885ccf..56f259db9a1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -20093,6 +20093,9 @@ Summary Score Commands @item date @table @kbd =20 +@item r +Regexp matching. + @item b Before date. =20 @@ -20101,6 +20104,12 @@ Summary Score Commands =20 @item n This date. + +@item < +Less than days. + +@item > +Greater than days. @end table =20 @item number diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 479b7496cf1..4e9e0083424 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -593,18 +593,18 @@ gnus-summary-increase-score =09 (?d "date" nil nil date) =09 (?f "followup" nil nil string) =09 (?t "thread" "message-id" nil string))) -=09 (char-to-type +=09 (char-to-types =09 '((?s s "substring" string) =09 (?e e "exact string" string) =09 (?f f "fuzzy string" string) -=09 (?r r "regexp string" string) +=09 (?r r "regexp string" string date) =09 (?z s "substring" body-string) =09 (?p r "regexp string" body-string) =09 (?b before "before date" date) =09 (?a after "after date" date) =09 (?n at "this date" date) -=09 (?< < "less than number" number) -=09 (?> > "greater than number" number) +=09 (?< < "less than number" number date) +=09 (?> > "greater than number" number date) =09 (?=3D =3D "equal to number" number))) =09 (current-score-file gnus-current-score-file) =09 (char-to-perm @@ -652,10 +652,9 @@ gnus-summary-increase-score =09 (let ((legal-types =09=09 (delq nil =09=09 (mapcar (lambda (s) -=09=09=09=09 (if (eq (nth 4 entry) -=09=09=09=09=09 (nth 3 s)) +=09=09=09=09 (if (member (nth 4 entry) (nthcdr 3 s)) =09=09=09=09 s nil)) -=09=09=09 char-to-type)))) +=09=09=09 char-to-types)))) (setq header-string (format "%s header `%s' with match type (%s?): " =09=09=09 (if increase "Increase" "Lower") @@ -894,12 +893,16 @@ gnus-summary-score-entry =09=09=09 header =09=09=09 (if (< score 0) "lower" "raise")) (cond ((numberp match) (int-to-string match)) + ;; Provide better defaults if we're scoring on da= te header ((string=3D header "date") - (int-to-string - (- - (/ (car (time-convert (current-time) 1)) 86400= ) - (/ (car (time-convert (gnus-date-get-time matc= h) 1)) - 86400)))) + (if (or (eq type '<) (eq type '>)) + ;; Determine the time difference in days bet= ween today + ;; and the article's date + (format-seconds "%d" + (time-subtract + (current-time) + (gnus-date-get-time match))= ) + (gnus-date-iso8601 match))) (t match))))) =20 ;; If this is an integer comparison, we transform from string to int. @@ -909,16 +912,13 @@ gnus-summary-score-entry (set-text-properties 0 (length match) nil match)) =20 ;; Modify match and type for article age scoring. - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) -=09(let ((age (string-to-number match))) -=09 (if (or (< age 0) -=09=09 (string=3D "0" match)) -=09 (user-error "Article age must be a positive number")) -=09 (setq match age -=09=09type (cond ((eq type 'after) -=09=09=09 '<) -=09=09=09 ((eq type 'before) -=09=09=09 '>))))) + (when (and (string=3D header "date") + (or (eq type '<) (eq type '>))) + (let ((age (string-to-number match))) + (if (or (< age 0) + (string=3D "0" match)) + (user-error "Article age must be a positive number")) + (setq match age))) =20 (unless (eq date 'now) ;; Add the score entry to the score file. @@ -1806,7 +1806,7 @@ gnus-score-date =09 ((eq type 'at) =09 (setq match-func 'string=3D =09=09 match (gnus-date-iso8601 (nth 0 kill)))) -=09 ((eq type 'regexp) +=09 ((or (eq type 'regexp) (eq type 'r)) =09 (setq match-func 'string-match =09=09 match (nth 0 kill))) =09 (t (error "Invalid match type: %s" type))) --=20 2.34.1 --=20 Kuba Je=C4=8Dm=C3=ADnek (http://kubajecminek.cz) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively References: <87edbovjvj.fsf@kubajecminek.cz> In-Reply-To: <87edbovjvj.fsf@kubajecminek.cz> Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 21:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17164136758082 (code B ref 70134); Wed, 22 May 2024 21:35:03 +0000 Received: (at 70134) by debbugs.gnu.org; 22 May 2024 21:34:35 +0000 Received: from localhost ([127.0.0.1]:58022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9tbW-00026I-NB for submit@debbugs.gnu.org; Wed, 22 May 2024 17:34:34 -0400 Received: from mail-4022.proton.ch ([185.70.40.22]:47643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9tbR-00025z-FH for 70134@debbugs.gnu.org; Wed, 22 May 2024 17:34:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1716413656; x=1716672856; bh=/Pc8cpdYc1BubWPAt9EzPIiTt9EB1IhTOPZ+bqehniw=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=HJmKHFjaCCi7ovqHbTX6mTCdn4h5OQFYTh1Y+gHGzD8wYmpcb+ZS8Lni1H0duBvbn TBMbBaZLiUmvaTfbXViii/IzuqHK8cC0zTQMbE6p6oPGPbcbS8Ai5H78vKyNP9gFGy HIWCBgVIDmZBRARDLKwlc3dbC/YoZixq6TzmCj2UAC428cL50NsmcNmpclNnl+bXIH kAScC9MVfDzcsODVbt9sdcJTVEmMSk9OKJbPOdWo/eexNHlxH/5MsuL4ijnJtIAcYT PYpUWbDWAicOXgmwVxnc4RJvauJm5wMGaooyIRMaSH0qYT3K5DXet/D+ML0w9HZ/n3 1IScUoL4OQcHg== Date: Wed, 22 May 2024 21:34:10 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87v835edkg.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 6cf90f443a26702957123c4e3d926358a2242eea MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Ping :). Is there anything else that needs to be resolved before this is installed? We can create different subtask for the bug that Alex pointed out. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 23:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Cc: Eric Abrahamsen , "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171642062012388 (code B ref 70134); Wed, 22 May 2024 23:31:01 +0000 Received: (at 70134) by debbugs.gnu.org; 22 May 2024 23:30:20 +0000 Received: from localhost ([127.0.0.1]:58103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9vPY-0003Dk-3z for submit@debbugs.gnu.org; Wed, 22 May 2024 19:30:20 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:55472 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9vPW-0003De-7A for 70134@debbugs.gnu.org; Wed, 22 May 2024 19:30:19 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4Vl6wc0k1pz3pdDn; Wed, 22 May 2024 16:30:08 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: <87v835edkg.fsf@kubajecminek.cz> ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?="'s message of "Wed, 22 May 2024 21:34:10 +0000") References: <87v835edkg.fsf@kubajecminek.cz> Date: Wed, 22 May 2024 16:30:07 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Jakub, Jakub Je=C4=8Dm=C3=ADnek writes: > Ping :). Is there anything else that needs to be resolved before this is > installed? We can create different subtask for the bug that Alex pointed > out. I did some testing again and the functionality you describe works perfectly fine. I still would prefer the bug I pointed out to be fixed before merging. My concern is that with the change applied, adding a new date-header scoring rule interactively will rewrite some existing date rules in the SCORE file. Expectedly not just entries created interactively, but any entries in the list regardless of how they were created. In my testing, I found this to be the case for all entries that are not using the new match types for dates (i.e, for `before', `after', and `at', not for `r', `<', or `>'.) I am perfectly happy to be overruled, I just think it will be confusing to the users. If however a patch for this is forthcoming quickly, I am OK with merging it. --=20 Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 May 2024 02:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171643264218888 (code B ref 70134); Thu, 23 May 2024 02:51:01 +0000 Received: (at 70134) by debbugs.gnu.org; 23 May 2024 02:50:42 +0000 Received: from localhost ([127.0.0.1]:58305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9yXR-0004ua-VR for submit@debbugs.gnu.org; Wed, 22 May 2024 22:50:42 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:46902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9yXO-0004uU-Nq for 70134@debbugs.gnu.org; Wed, 22 May 2024 22:50:40 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B4BEFFA01F; Thu, 23 May 2024 02:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1716432626; bh=NWemTCH9FhbZVXMOzyYlR8BTS/8nIBqEAMc7GtAycJ0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=yx9vB9DyVOpmfnnSYhZfJE7Jk0rX02nRE06dDZpAkfi928Kfd4kLne34e0HdZEFEK IKhQfB59908jhdRxv4J40BRTAPtXHUPjnzHDrCCCfYcsDvQ6o5cCDDhUV00jz994jI JET5hxA1CA+u0/aQo58KRdgRGNlFW+x/+VbQ6aL4= From: Eric Abrahamsen In-Reply-To: (Alex Bochannek's message of "Wed, 22 May 2024 16:30:07 -0700") References: <87v835edkg.fsf@kubajecminek.cz> Date: Wed, 22 May 2024 19:50:24 -0700 Message-ID: <87h6ep8cnj.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Alex Bochannek writes: > Jakub, > > Jakub Je=C4=8Dm=C3=ADnek writes: > >> Ping :). Is there anything else that needs to be resolved before this is >> installed? We can create different subtask for the bug that Alex pointed >> out. > > I did some testing again and the functionality you describe works > perfectly fine. I still would prefer the bug I pointed out to be fixed > before merging. > > My concern is that with the change applied, adding a new date-header > scoring rule interactively will rewrite some existing date rules in the > SCORE file. Expectedly not just entries created interactively, but any > entries in the list regardless of how they were created. In my testing, > I found this to be the case for all entries that are not using the new > match types for dates (i.e, for `before', `after', and `at', not for > `r', `<', or `>'.) > > I am perfectly happy to be overruled, I just think it will be confusing > to the users. If however a patch for this is forthcoming quickly, I am > OK with merging it. Can we maybe hoist the `copy-sequence` up into the caller, to get a similar effect? From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171673339116965 (code B ref 70134); Sun, 26 May 2024 14:24:02 +0000 Received: (at 70134) by debbugs.gnu.org; 26 May 2024 14:23:11 +0000 Received: from localhost ([127.0.0.1]:42250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBEmF-0004PZ-E5 for submit@debbugs.gnu.org; Sun, 26 May 2024 10:23:11 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]:29311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBEmD-0004P6-LV for 70134@debbugs.gnu.org; Sun, 26 May 2024 10:23:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1716733375; x=1716992575; bh=V1LqfDxlL4lTP8AsTLT+LwcQL7hmjYVTaH7eEFIs06Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=h/xcTnitO23SbOJYygF7VMUzh9zNPwH3bZax3RwnQlGEuTqPsIQjXGphDib5OUUTC pKQ8CYLiaoCG0csL0/SuzkDp66JhwaSaDiEeLxqpdCVaErSWc9pIak2IJoAuwFPA+f k4UutH07zdsJuAPlP6sfecCBOflvF0aPGl7vIkXMzojGP/nFYFNW7rxYBw4dFhJIYO kCCHiUkSFEJitadkzVyVdgzVPY0LXZu3zy5GeXow8MCGC40wARc5E7Cqr3ncFXDyDQ zAhoOH3zGNGFeebuvw6UeaSK4o3esR5YJpLCfwAu7KQr32V1UAReu+O25+I0tpIfvu Kxn4crDC5oUQQ== Date: Sun, 26 May 2024 14:22:51 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87cyp8ps94.fsf@kubajecminek.cz> In-Reply-To: <87h6ep8cnj.fsf@ericabrahamsen.net> References: <87v835edkg.fsf@kubajecminek.cz> <87h6ep8cnj.fsf@ericabrahamsen.net> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: c742b553f5535b783cedf997e5080572854f4a47 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) "Eric Abrahamsen" writes: > Can we maybe hoist the `copy-sequence` up into the caller, to get a > similar effect? We can strip the text properties right before the end of `gnus-score-date' function. What do you think? --=20 Kuba Je=C4=8Dm=C3=ADnek (http://kubajecminek.cz) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively References: <87edbovjvj.fsf@kubajecminek.cz> In-Reply-To: <87edbovjvj.fsf@kubajecminek.cz> Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 22:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.17167614033319 (code B ref 70134); Sun, 26 May 2024 22:11:01 +0000 Received: (at 70134) by debbugs.gnu.org; 26 May 2024 22:10:03 +0000 Received: from localhost ([127.0.0.1]:42676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBM42-0000rQ-Uj for submit@debbugs.gnu.org; Sun, 26 May 2024 18:10:03 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:24147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBM40-0000qn-2C for 70134@debbugs.gnu.org; Sun, 26 May 2024 18:10:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1716761385; x=1717020585; bh=h0NsnWkQXJIsNJbSGvjpPum8qvOnBvGQg++q5KL5h6k=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=kqBf3DdZ2dH2V/ho7sYP2SZpMbU4xO7HduF2jOVg2mM6jNEY6NbH0nNHdeBG7Qc0V OkSNy9DvVONfv/igAfdWXP+FNZliBfECir1PzKoJnzuR2obGo/4YJQGGNxijhNYv04 RjXpuknNakFCFgpiaxkm/nENPtd33YrsAirXHoTAIw6fHN/JBfYfHoRipCSf2nvosf kstOeCoseyhXPbT+BuCOmBxA49Vhfh4U4U2pCGz5+jYXXunwnFa65fPCE6K7bMfsbo xG3VtGZcVuCuBXamKFKJxJaa8ltCujNLKNWe1MJwEKVKZqforJ1crydoHQdRL3MrVJ PzbTVthMCLUtA== Date: Sun, 26 May 2024 22:09:40 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87zfscns2o.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 59b5c7afe35e2df71330ea38168ea0751b83cb09 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Jakub Je=C4=8Dm=C3=ADnek writes: > "Eric Abrahamsen" writes: > >> Can we maybe hoist the `copy-sequence` up into the caller, to get a >> similar effect? > > We can strip the text properties right before the end of > `gnus-score-date' function. What do you think? Oops, forgot to attach a patch. >From 2a8081c9a7b3d6ce6842f3559d15a8f1b7872b83 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D Date: Thu, 16 May 2024 21:38:01 +0200 Subject: [PATCH] Show all date options when adding Gnus scores interactivel= y * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename 'char-to-type' variable to 'char-to-types' and bind all legal types for date header. * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better default values for each scoring type and cast 'match' to number only if necessary. Co-authored-by: Alex Bochannek --- doc/misc/gnus.texi | 9 ++++++++ lisp/gnus/gnus-score.el | 48 +++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c5e4c885ccf..56f259db9a1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -20093,6 +20093,9 @@ Summary Score Commands @item date @table @kbd =20 +@item r +Regexp matching. + @item b Before date. =20 @@ -20101,6 +20104,12 @@ Summary Score Commands =20 @item n This date. + +@item < +Less than days. + +@item > +Greater than days. @end table =20 @item number diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 479b7496cf1..31ce1328e37 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -593,18 +593,18 @@ gnus-summary-increase-score =09 (?d "date" nil nil date) =09 (?f "followup" nil nil string) =09 (?t "thread" "message-id" nil string))) -=09 (char-to-type +=09 (char-to-types =09 '((?s s "substring" string) =09 (?e e "exact string" string) =09 (?f f "fuzzy string" string) -=09 (?r r "regexp string" string) +=09 (?r r "regexp string" string date) =09 (?z s "substring" body-string) =09 (?p r "regexp string" body-string) =09 (?b before "before date" date) =09 (?a after "after date" date) =09 (?n at "this date" date) -=09 (?< < "less than number" number) -=09 (?> > "greater than number" number) +=09 (?< < "less than number" number date) +=09 (?> > "greater than number" number date) =09 (?=3D =3D "equal to number" number))) =09 (current-score-file gnus-current-score-file) =09 (char-to-perm @@ -652,10 +652,9 @@ gnus-summary-increase-score =09 (let ((legal-types =09=09 (delq nil =09=09 (mapcar (lambda (s) -=09=09=09=09 (if (eq (nth 4 entry) -=09=09=09=09=09 (nth 3 s)) +=09=09=09=09 (if (member (nth 4 entry) (nthcdr 3 s)) =09=09=09=09 s nil)) -=09=09=09 char-to-type)))) +=09=09=09 char-to-types)))) (setq header-string (format "%s header `%s' with match type (%s?): " =09=09=09 (if increase "Increase" "Lower") @@ -894,12 +893,16 @@ gnus-summary-score-entry =09=09=09 header =09=09=09 (if (< score 0) "lower" "raise")) (cond ((numberp match) (int-to-string match)) + ;; Provide better defaults if we're scoring on da= te header ((string=3D header "date") - (int-to-string - (- - (/ (car (time-convert (current-time) 1)) 86400= ) - (/ (car (time-convert (gnus-date-get-time matc= h) 1)) - 86400)))) + (if (or (eq type '<) (eq type '>)) + ;; Determine the time difference in days bet= ween today + ;; and the article's date + (format-seconds "%d" + (time-subtract + (current-time) + (gnus-date-get-time match))= ) + (gnus-date-iso8601 match))) (t match))))) =20 ;; If this is an integer comparison, we transform from string to int. @@ -909,16 +912,13 @@ gnus-summary-score-entry (set-text-properties 0 (length match) nil match)) =20 ;; Modify match and type for article age scoring. - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) -=09(let ((age (string-to-number match))) -=09 (if (or (< age 0) -=09=09 (string=3D "0" match)) -=09 (user-error "Article age must be a positive number")) -=09 (setq match age -=09=09type (cond ((eq type 'after) -=09=09=09 '<) -=09=09=09 ((eq type 'before) -=09=09=09 '>))))) + (when (and (string=3D header "date") + (or (eq type '<) (eq type '>))) + (let ((age (string-to-number match))) + (if (or (< age 0) + (string=3D "0" match)) + (user-error "Article age must be a positive number")) + (setq match age))) =20 (unless (eq date 'now) ;; Add the score entry to the score file. @@ -1806,7 +1806,7 @@ gnus-score-date =09 ((eq type 'at) =09 (setq match-func 'string=3D =09=09 match (gnus-date-iso8601 (nth 0 kill)))) -=09 ((eq type 'regexp) +=09 ((or (eq type 'regexp) (eq type 'r)) =09 (setq match-func 'string-match =09=09 match (nth 0 kill))) =09 (t (error "Invalid match type: %s" type))) @@ -1833,6 +1833,8 @@ gnus-score-date =09=09 (gnus-score-set 'touched '(t) alist) =09=09 (setcdr entries (cdr rest)) =09=09 (setq rest entries))) + (when (stringp (nth 0 kill)) + (set-text-properties 0 1 nil (nth 0 kill))) =09 (setq entries rest))))) nil) =20 --=20 2.34.1 From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively References: <87edbovjvj.fsf@kubajecminek.cz> In-Reply-To: <87edbovjvj.fsf@kubajecminek.cz> Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 May 2024 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Alex Bochannek , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171701780927869 (code B ref 70134); Wed, 29 May 2024 21:24:01 +0000 Received: (at 70134) by debbugs.gnu.org; 29 May 2024 21:23:29 +0000 Received: from localhost ([127.0.0.1]:55227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCQlc-0007FP-Gy for submit@debbugs.gnu.org; Wed, 29 May 2024 17:23:29 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:22667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCQlZ-0007F7-Vg for 70134@debbugs.gnu.org; Wed, 29 May 2024 17:23:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1717017789; x=1717276989; bh=1s5symLv3rsj/v7MQYoeyKoNbT325519DzpD71Y5Wac=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=wznhNkV45WcXrbScRiLkCQMDo5Oprn0jCTl2I3ZX2EI4uNmXd7MQroXr3nYZ2dccF TvBDe3Lf0Qe3tJ0zFf9PZF2q0lc9XwXYGYHEmC6rsS0C1fYW/yDB6GWkrZc1LHi6iv io7yEw3Wojw7lXsSQsDDeFADYJCbTuiDDTXclTwxME9bG1+d9GAqnf35imMYeT0m8d gvlwNAMQWQcZHjzrAN9BGSV7RmAINq5KVBsEHJCslTXn7IVES5KJgwKCt931y81pcd FhcXbVSKiS2velIlOuBeea9LlLUhuSgP2oLZB3kP5A9wThGvvdZzJxOQG1YF6hjjON 2bU9EbOt7ZUCA== Date: Wed, 29 May 2024 21:23:03 +0000 From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Message-ID: <87fru0qpn0.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 24285abce3ad2680ae0f800cdfa8f07be4d50b6e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Ping. Jakub Je=C4=8Dm=C3=ADnek writes: > Jakub Je=C4=8Dm=C3=ADnek writes: > >> "Eric Abrahamsen" writes: >> >>> Can we maybe hoist the `copy-sequence` up into the caller, to get a >>> similar effect? >> >> We can strip the text properties right before the end of >> `gnus-score-date' function. What do you think? > > Oops, forgot to attach a patch. > >>>From 2a8081c9a7b3d6ce6842f3559d15a8f1b7872b83 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D > Date: Thu, 16 May 2024 21:38:01 +0200 > Subject: [PATCH] Show all date options when adding Gnus scores interactiv= ely > > * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename > 'char-to-type' variable to 'char-to-types' and bind all legal types > for date header. > > * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better > default values for each scoring type and cast 'match' to number only > if necessary. > > Co-authored-by: Alex Bochannek > --- > doc/misc/gnus.texi | 9 ++++++++ > lisp/gnus/gnus-score.el | 48 +++++++++++++++++++++-------------------- > 2 files changed, 34 insertions(+), 23 deletions(-) > > diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi > index c5e4c885ccf..56f259db9a1 100644 > --- a/doc/misc/gnus.texi > +++ b/doc/misc/gnus.texi > @@ -20093,6 +20093,9 @@ Summary Score Commands > @item date > @table @kbd > =20 > +@item r > +Regexp matching. > + > @item b > Before date. > =20 > @@ -20101,6 +20104,12 @@ Summary Score Commands > =20 > @item n > This date. > + > +@item < > +Less than days. > + > +@item > > +Greater than days. > @end table > =20 > @item number > diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el > index 479b7496cf1..31ce1328e37 100644 > --- a/lisp/gnus/gnus-score.el > +++ b/lisp/gnus/gnus-score.el > @@ -593,18 +593,18 @@ gnus-summary-increase-score > =09 (?d "date" nil nil date) > =09 (?f "followup" nil nil string) > =09 (?t "thread" "message-id" nil string))) > -=09 (char-to-type > +=09 (char-to-types > =09 '((?s s "substring" string) > =09 (?e e "exact string" string) > =09 (?f f "fuzzy string" string) > -=09 (?r r "regexp string" string) > +=09 (?r r "regexp string" string date) > =09 (?z s "substring" body-string) > =09 (?p r "regexp string" body-string) > =09 (?b before "before date" date) > =09 (?a after "after date" date) > =09 (?n at "this date" date) > -=09 (?< < "less than number" number) > -=09 (?> > "greater than number" number) > +=09 (?< < "less than number" number date) > +=09 (?> > "greater than number" number date) > =09 (?=3D =3D "equal to number" number))) > =09 (current-score-file gnus-current-score-file) > =09 (char-to-perm > @@ -652,10 +652,9 @@ gnus-summary-increase-score > =09 (let ((legal-types > =09=09 (delq nil > =09=09 (mapcar (lambda (s) > -=09=09=09=09 (if (eq (nth 4 entry) > -=09=09=09=09=09 (nth 3 s)) > +=09=09=09=09 (if (member (nth 4 entry) (nthcdr 3 s)) > =09=09=09=09 s nil)) > -=09=09=09 char-to-type)))) > +=09=09=09 char-to-types)))) > (setq header-string > (format "%s header `%s' with match type (%s?): " > =09=09=09 (if increase "Increase" "Lower") > @@ -894,12 +893,16 @@ gnus-summary-score-entry > =09=09=09 header > =09=09=09 (if (< score 0) "lower" "raise")) > (cond ((numberp match) (int-to-string match)) > + ;; Provide better defaults if we're scoring on = date header > ((string=3D header "date") > - (int-to-string > - (- > - (/ (car (time-convert (current-time) 1)) 864= 00) > - (/ (car (time-convert (gnus-date-get-time ma= tch) 1)) > - 86400)))) > + (if (or (eq type '<) (eq type '>)) > + ;; Determine the time difference in days b= etween today > + ;; and the article's date > + (format-seconds "%d" > + (time-subtract > + (current-time) > + (gnus-date-get-time match= ))) > + (gnus-date-iso8601 match))) > (t match))))) > =20 > ;; If this is an integer comparison, we transform from string to int= . > @@ -909,16 +912,13 @@ gnus-summary-score-entry > (set-text-properties 0 (length match) nil match)) > =20 > ;; Modify match and type for article age scoring. > - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) > -=09(let ((age (string-to-number match))) > -=09 (if (or (< age 0) > -=09=09 (string=3D "0" match)) > -=09 (user-error "Article age must be a positive number")) > -=09 (setq match age > -=09=09type (cond ((eq type 'after) > -=09=09=09 '<) > -=09=09=09 ((eq type 'before) > -=09=09=09 '>))))) > + (when (and (string=3D header "date") > + (or (eq type '<) (eq type '>))) > + (let ((age (string-to-number match))) > + (if (or (< age 0) > + (string=3D "0" match)) > + (user-error "Article age must be a positive number")) > + (setq match age))) > =20 > (unless (eq date 'now) > ;; Add the score entry to the score file. > @@ -1806,7 +1806,7 @@ gnus-score-date > =09 ((eq type 'at) > =09 (setq match-func 'string=3D > =09=09 match (gnus-date-iso8601 (nth 0 kill)))) > -=09 ((eq type 'regexp) > +=09 ((or (eq type 'regexp) (eq type 'r)) > =09 (setq match-func 'string-match > =09=09 match (nth 0 kill))) > =09 (t (error "Invalid match type: %s" type))) > @@ -1833,6 +1833,8 @@ gnus-score-date > =09=09 (gnus-score-set 'touched '(t) alist) > =09=09 (setcdr entries (cdr rest)) > =09=09 (setq rest entries))) > + (when (stringp (nth 0 kill)) > + (set-text-properties 0 1 nil (nth 0 kill))) > =09 (setq entries rest))))) > nil) From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 00:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Cc: Eric Abrahamsen , "70134@debbugs.gnu.org" <70134@debbugs.gnu.org>, Eli Zaretskii , "larsi@gnus.org" , Richard Stallman Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171702820521456 (code B ref 70134); Thu, 30 May 2024 00:17:03 +0000 Received: (at 70134) by debbugs.gnu.org; 30 May 2024 00:16:45 +0000 Received: from localhost ([127.0.0.1]:34788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCTTI-0005Zw-Bt for submit@debbugs.gnu.org; Wed, 29 May 2024 20:16:45 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:37251 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCTTF-0005Zh-C3 for 70134@debbugs.gnu.org; Wed, 29 May 2024 20:16:42 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4VqRcq2Z7Zz3qKd8; Wed, 29 May 2024 17:16:27 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: <87fru0qpn0.fsf@kubajecminek.cz> ("Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?="'s message of "Wed, 29 May 2024 21:23:03 +0000") References: <87fru0qpn0.fsf@kubajecminek.cz> Date: Wed, 29 May 2024 17:16:25 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Jakub, Jakub Je=C4=8Dm=C3=ADnek writes: > Ping. > > Jakub Je=C4=8Dm=C3=ADnek writes: > >> Oops, forgot to attach a patch. Tested it again against top-of-tree and this patch resolves the previous issue. I think it's ready to merge! I am curious if you think adding support of the `=3D' match type for the date header makes sense? As I was testing this change, I found myself reaching for that, but I am not entirely convinced it's actually a useful feature. Either way, please don't hold up this change for that. As I mentioned before, I would be happy to merge if someone points me at instructions. In the past, eliz and larsi have merged changes I have submitted. >>>>From 2a8081c9a7b3d6ce6842f3559d15a8f1b7872b83 Mon Sep 17 00:00:00 2001 >> From: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D >> Date: Thu, 16 May 2024 21:38:01 +0200 >> Subject: [PATCH] Show all date options when adding Gnus scores interacti= vely >> >> * lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename >> 'char-to-type' variable to 'char-to-types' and bind all legal types >> for date header. >> >> * lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better >> default values for each scoring type and cast 'match' to number only >> if necessary. >> >> Co-authored-by: Alex Bochannek >> --- >> doc/misc/gnus.texi | 9 ++++++++ >> lisp/gnus/gnus-score.el | 48 +++++++++++++++++++++-------------------- >> 2 files changed, 34 insertions(+), 23 deletions(-) >> >> diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi >> index c5e4c885ccf..56f259db9a1 100644 >> --- a/doc/misc/gnus.texi >> +++ b/doc/misc/gnus.texi >> @@ -20093,6 +20093,9 @@ Summary Score Commands >> @item date >> @table @kbd >>=20=20 >> +@item r >> +Regexp matching. >> + >> @item b >> Before date. >>=20=20 >> @@ -20101,6 +20104,12 @@ Summary Score Commands >>=20=20 >> @item n >> This date. >> + >> +@item < >> +Less than days. >> + >> +@item > >> +Greater than days. >> @end table >>=20=20 >> @item number >> diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el >> index 479b7496cf1..31ce1328e37 100644 >> --- a/lisp/gnus/gnus-score.el >> +++ b/lisp/gnus/gnus-score.el >> @@ -593,18 +593,18 @@ gnus-summary-increase-score >> (?d "date" nil nil date) >> (?f "followup" nil nil string) >> (?t "thread" "message-id" nil string))) >> - (char-to-type >> + (char-to-types >> '((?s s "substring" string) >> (?e e "exact string" string) >> (?f f "fuzzy string" string) >> - (?r r "regexp string" string) >> + (?r r "regexp string" string date) >> (?z s "substring" body-string) >> (?p r "regexp string" body-string) >> (?b before "before date" date) >> (?a after "after date" date) >> (?n at "this date" date) >> - (?< < "less than number" number) >> - (?> > "greater than number" number) >> + (?< < "less than number" number date) >> + (?> > "greater than number" number date) >> (?=3D =3D "equal to number" number))) >> (current-score-file gnus-current-score-file) >> (char-to-perm >> @@ -652,10 +652,9 @@ gnus-summary-increase-score >> (let ((legal-types >> (delq nil >> (mapcar (lambda (s) >> - (if (eq (nth 4 entry) >> - (nth 3 s)) >> + (if (member (nth 4 entry) (nthcdr 3 s)) >> s nil)) >> - char-to-type)))) >> + char-to-types)))) >> (setq header-string >> (format "%s header `%s' with match type (%s?): " >> (if increase "Increase" "Lower") >> @@ -894,12 +893,16 @@ gnus-summary-score-entry >> header >> (if (< score 0) "lower" "raise")) >> (cond ((numberp match) (int-to-string match)) >> + ;; Provide better defaults if we're scoring on= date header >> ((string=3D header "date") >> - (int-to-string >> - (- >> - (/ (car (time-convert (current-time) 1)) 86= 400) >> - (/ (car (time-convert (gnus-date-get-time m= atch) 1)) >> - 86400)))) >> + (if (or (eq type '<) (eq type '>)) >> + ;; Determine the time difference in days = between today >> + ;; and the article's date >> + (format-seconds "%d" >> + (time-subtract >> + (current-time) >> + (gnus-date-get-time matc= h))) >> + (gnus-date-iso8601 match))) >> (t match))))) >>=20=20 >> ;; If this is an integer comparison, we transform from string to in= t. >> @@ -909,16 +912,13 @@ gnus-summary-score-entry >> (set-text-properties 0 (length match) nil match)) >>=20=20 >> ;; Modify match and type for article age scoring. >> - (if (string=3D "date" (nth 0 (assoc header gnus-header-index))) >> - (let ((age (string-to-number match))) >> - (if (or (< age 0) >> - (string=3D "0" match)) >> - (user-error "Article age must be a positive number")) >> - (setq match age >> - type (cond ((eq type 'after) >> - '<) >> - ((eq type 'before) >> - '>))))) >> + (when (and (string=3D header "date") >> + (or (eq type '<) (eq type '>))) >> + (let ((age (string-to-number match))) >> + (if (or (< age 0) >> + (string=3D "0" match)) >> + (user-error "Article age must be a positive number")) >> + (setq match age))) >>=20=20 >> (unless (eq date 'now) >> ;; Add the score entry to the score file. >> @@ -1806,7 +1806,7 @@ gnus-score-date >> ((eq type 'at) >> (setq match-func 'string=3D >> match (gnus-date-iso8601 (nth 0 kill)))) >> - ((eq type 'regexp) >> + ((or (eq type 'regexp) (eq type 'r)) >> (setq match-func 'string-match >> match (nth 0 kill))) >> (t (error "Invalid match type: %s" type))) >> @@ -1833,6 +1833,8 @@ gnus-score-date >> (gnus-score-set 'touched '(t) alist) >> (setcdr entries (cdr rest)) >> (setq rest entries))) >> + (when (stringp (nth 0 kill)) >> + (set-text-properties 0 1 nil (nth 0 kill))) >> (setq entries rest))))) >> nil) > --=20 Alex. From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 09:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Alex Bochannek Cc: "70134-done@debbugs.gnu.org" <70134@debbugs.gnu.org>, Richard Stallman , Eric Abrahamsen , Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , "larsi@gnus.org" , Eli Zaretskii Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.1717059702565 (code B ref 70134); Thu, 30 May 2024 09:02:01 +0000 Received: (at 70134) by debbugs.gnu.org; 30 May 2024 09:01:42 +0000 Received: from localhost ([127.0.0.1]:53716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCbfK-000092-Eh for submit@debbugs.gnu.org; Thu, 30 May 2024 05:01:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCbfH-00008a-J3 for 70134@debbugs.gnu.org; Thu, 30 May 2024 05:01:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCbey-00015f-9A; Thu, 30 May 2024 05:01:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=yMuBiN5d+8ORQxxMeDKHBWtW0k98VmZPSf1RlEZy3qE=; b=bCZ7tHcpOqzgMOwiDjBp B+Jz1PyLTMSG5qHQGUwowwzjvD2k5pvEgLo7wyzci0XziVyCF3g4vt3DSZdoEXpkE9chus3k8Jamx VWBdcfvPIqll3vfxu2l4PAc3pMUPlgCCBRUHCAPgLkrgTNhZS0XudztkNjla9Ft1UL1qiq+3K6lg2 JZDiKo+GlBXVHMH7ztoeNBSg1fpjrvVYw3QkrZuIg46nSRwtGhzAZj6jzJisVbxXO4PZLyRfmoqco ANt0ZxxxV0X6g/euYwUz2bTB7DVUr9XahAkyddfzzuZqp4nqRYpkqDk8eqhglcIhwyqRneAsPXPpz hSdZ5KAeqpB2vQ==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sCbep-00058S-QH; Thu, 30 May 2024 05:01:11 -0400 From: Andrea Corallo In-Reply-To: (Alex Bochannek's message of "Wed, 29 May 2024 17:16:25 -0700") References: <87fru0qpn0.fsf@kubajecminek.cz> Date: Thu, 30 May 2024 05:01:11 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Alex Bochannek writes: > Jakub, > > Jakub Je=C4=8Dm=C3=ADnek writes: > >> Ping. >> >> Jakub Je=C4=8Dm=C3=ADnek writes: >> >>> Oops, forgot to attach a patch. > > Tested it again against top-of-tree and this patch resolves the previous > issue. I think it's ready to merge! > > I am curious if you think adding support of the `=3D' match type for the > date header makes sense? As I was testing this change, I found myself > reaching for that, but I am not entirely convinced it's actually a > useful feature. Either way, please don't hold up this change for that. > > As I mentioned before, I would be happy to merge if someone points me at > instructions. In the past, eliz and larsi have merged changes I have > submitted. I've installed the patch so I'm closing this. Alex do you have write access? Thanks Andrea From unknown Mon Aug 18 15:41:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70134 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Andrea Corallo Cc: "70134-done@debbugs.gnu.org" <70134@debbugs.gnu.org>, Richard Stallman , Eric Abrahamsen , Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , "larsi@gnus.org" , Eli Zaretskii Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171708666322264 (code B ref 70134); Thu, 30 May 2024 16:32:02 +0000 Received: (at 70134) by debbugs.gnu.org; 30 May 2024 16:31:03 +0000 Received: from localhost ([127.0.0.1]:45785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCigA-0005n1-E1 for submit@debbugs.gnu.org; Thu, 30 May 2024 12:31:02 -0400 Received: from ns.lapseofthought.com ([50.0.39.240]:58584 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCig8-0005mW-TH for 70134@debbugs.gnu.org; Thu, 30 May 2024 12:31:01 -0400 Received: from awb-mbp.local (c-24-23-131-202.hsd1.ca.comcast.net [24.23.131.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4VqsDH6v50z3ps6k; Thu, 30 May 2024 09:30:07 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek In-Reply-To: (Andrea Corallo's message of "Thu, 30 May 2024 05:01:11 -0400") References: <87fru0qpn0.fsf@kubajecminek.cz> Date: Thu, 30 May 2024 09:30:06 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Andrea Corallo writes: > I've installed the patch so I'm closing this. > > Alex do you have write access? I don't believe I do, no. -- Alex. From unknown Mon Aug 18 15:41:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Subject: bug#70134: closed (Re: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively) Message-ID: References: <877ccsw0bi.fsf@kubajecminek.cz> <87edbovjvj.fsf@kubajecminek.cz> X-Gnu-PR-Message: they-closed 70134 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 70134@debbugs.gnu.org Date: Wed, 07 Aug 2024 20:23:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1723062181-6105-1" This is a multi-part message in MIME format... ------------=_1723062181-6105-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #70134: [PATCH] Show all date options when adding Gnus scores interactively which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 70134@debbugs.gnu.org. --=20 70134: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D70134 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1723062181-6105-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 70134-done) by debbugs.gnu.org; 7 Aug 2024 20:22:44 +0000 Received: from localhost ([127.0.0.1]:35138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbnBD-0001Zv-TB for submit@debbugs.gnu.org; Wed, 07 Aug 2024 16:22:44 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:11055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbnBA-0001Zg-9N for 70134-done@debbugs.gnu.org; Wed, 07 Aug 2024 16:22:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail2; t=1723062127; x=1723321327; bh=oco2GKTZR0t95YWEjczbFdtF2KdQYPQBNyf8dzIpdXk=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=M2C0wQK89m2teGXyhApfcMjXC81/7yNHMCLeZlI73pvdPLjTympV07SGhoOIOOpP4 ZTHMdtxrmrueo8NKILe/IiJtiXlz7IQ7DeubdomiokuCOUf4eQiEf/3gqK668r4Ond 6Q0kYc2I1DY37eqXDiLxgpnon8W5dlitHIaO8uC7RVXsYDp99quXj072RsGr+qAJiL RgYK9qOMGY+Ygw6O1rYTsI6k49y6rL1XRdKtG5YXjAwaFPCXrT5/53FsHKFEzjD4WQ T0EDVdcORNfZmDjLVipVMFNrJbqXAI4qh1o2nuRNzVOzb7Hixhzp74A+ANZSO5YsxW mfHW6sSZXVxOQ== Date: Wed, 07 Aug 2024 20:22:03 +0000 To: 70134-done@debbugs.gnu.org From: =?utf-8?Q?Jakub_Je=C4=8Dm=C3=ADnek?= Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Message-ID: <877ccsw0bi.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton X-Pm-Message-ID: 4440813d33f2d8aa10d8f318ec644aaddbf4e835 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70134-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Commited as 39b704e36e308783dcec791d333fca317c6a5202 so I'm closing this. ------------=_1723062181-6105-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Apr 2024 21:44:33 +0000 Received: from localhost ([127.0.0.1]:51881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrPSC-0001A6-Gg for submit@debbugs.gnu.org; Mon, 01 Apr 2024 17:44:33 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrPS7-00019o-Lc for submit@debbugs.gnu.org; Mon, 01 Apr 2024 17:44:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrPRx-0006zw-Va for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 17:44:18 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrPRv-0004qR-7e for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 17:44:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz; s=protonmail; t=1712007851; x=1712267051; bh=z5oaDUxN0JigaxzeIr/fqZjKAVQexc1sm44A7A0SNcw=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=HU0tAClsxwv6/GLQFRaE1XED2MESdnj5j+QFUDLgitM5AeSEEMnuQGCwPDoDVO33D sD5Rtacfz4EjYKjK4btVr5bVO0g6yuFx/q3ezSi+BiCEOA8W+HTs4JEqdmho4V1BcC bLaSimxGegnccrvEZf4AReBJs6I7CTmTlIdsuVBR0tucN25E/pa2iOKpSK0i5Mk7Zl wGSW3l1XMxIYtX72XdqYaEUaVgSvSaYqxMF+6C14QgAKW8amXgsWH4rifMHD1NpK28 v7joT/UkgICC/HlgSt2lkoDAiKZOi0JsCXvTLtmLtRDeybfO05+xhZZ5mMN81K94QK 8cjMd8L0rUQrQ== Date: Mon, 01 Apr 2024 21:44:04 +0000 To: bug-gnu-emacs@gnu.org From: =?utf-8?Q?Jakub_Je=C4=8Dm=C3=ADnek?= Subject: [PATCH] Show all date options when adding Gnus scores interactively Message-ID: <87edbovjvj.fsf@kubajecminek.cz> Feedback-ID: 98803324:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c" Received-SPF: pass client-ip=185.70.43.23; envelope-from=kuba@kubajecminek.cz; helo=mail-4323.proton.ch X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tags: patch Hello, I'm attaching a patch that enhances user experience when adding Gnus scores interactively based on date header. This patch does multiple things: 1. `char-to-type' variable is renamed to `char-to-types' and we allow it to be mapped to multiple types. This is useful because date header supports all these types for scoring - '<, '>, 'r, 'after, ' [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: kubajecminek.cz] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: kubajecminek.cz] X-Debbugs-Envelope-To: submit Cc: Eric Abrahamsen , larsi@gnus.org, Alex Bochannek X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) This is a multi-part message in MIME format. --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Hello, I'm attaching a patch that enhances user experience when adding Gnus scores interactively based on date header. This patch does multiple things: 1. `char-to-type' variable is renamed to `char-to-types' and we allow it to be mapped to multiple types. This is useful because date header supports all these types for scoring - '<, '>, 'r, 'after, 'before, 'at but only the last three were previously offered to the user when using interactive scoring. 2. `gnus-summary-score-entry' now provides sensible defaults for each date scoring type - if we're scoring based on integer value ('<, '>) we offer number of days between now and entry at point (revised version of what was introduced in bug#61002) and if we're scoring based on string value ('after, 'before, 'at, 'r) we provide valid date string. 3. If the user scores articles based on date strings ('before, 'after, 'at, 'r), `gnus-summary-score-entry' will no longer cast the type to the integer type. 4. `gnus-score-date' catches 'r type as well. I'm also Cc'ing Alex who was the original author of '< '> date scoring types. Please let me know what you think. 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-23 built on kuba-ThinkPad-T14-Gen-3 Repository revision: 7e32e8392ab77f9df08a1f11831cbba2242d721f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12201001 System Description: Ubuntu 22.04.4 LTS --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c Content-Type: text/patch; name=0001-Show-all-date-options-when-adding-Gnus-scores-interactively.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-Show-all-date-options-when-adding-Gnus-scores-interactively.patch RnJvbSA2NDY1OWQ2NWMzYjQzOTYwYmMwMzQ3ZDViZTAzNWVjNjQ3NzliMGFkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogPT9VVEYtOD9xP0pha3ViPTIwSmU9QzQ9OERtPUMzPUFEbmVr Pz0gPGt1YmFAa3ViYWplY21pbmVrLmN6Pg0KRGF0ZTogU2F0LCAzMCBNYXIgMjAyNCAwMDozNDow NyArMDEwMA0KU3ViamVjdDogW1BBVENIXSBTaG93IGFsbCBkYXRlIG9wdGlvbnMgd2hlbiBhZGRp bmcgR251cyBzY29yZXMgaW50ZXJhY3RpdmVseQ0KDQoqIGxpc3AvZ251cy9nbnVzLXNjb3JlLmVs IChnbnVzLXN1bW1hcnktaW5jcmVhc2Utc2NvcmUpOiBSZW5hbWUNCidjaGFyLXRvLXR5cGUnIHZh cmlhYmxlIHRvICdjaGFyLXRvLXR5cGVzJyBhbmQgYWxsb3cgbXVsdGlwbGUgdHlwZXMNCmZvciBl YWNoIGNoYXIuDQoNCiogbGlzcC9nbnVzL2dudXMtc2NvcmUuZWwgKGdudXMtc3VtbWFyeS1zY29y ZS1lbnRyeSk6IFByb3ZpZGUgYmV0dGVyDQpkZWZhdWx0IHZhbHVlcyBmb3IgZWFjaCBzY29yaW5n IHR5cGUgYW5kIGNhc3QgJ21hdGNoJyB0byBudW1iZXIgb25seQ0KaWYgbmVjZXNzYXJ5Lg0KLS0t DQogbGlzcC9nbnVzL2dudXMtc2NvcmUuZWwgfCA1NSArKysrKysrKysrKysrKysrKysrKy0tLS0t LS0tLS0tLS0tLS0tLS0tLQ0KIDEgZmlsZSBjaGFuZ2VkLCAyNyBpbnNlcnRpb25zKCspLCAyOCBk ZWxldGlvbnMoLSkNCg0KZGlmZiAtLWdpdCBhL2xpc3AvZ251cy9nbnVzLXNjb3JlLmVsIGIvbGlz cC9nbnVzL2dudXMtc2NvcmUuZWwNCmluZGV4IDQ3OWI3NDk2Y2YxLi5kNzM0NjU4MWYyZiAxMDA2 NDQNCi0tLSBhL2xpc3AvZ251cy9nbnVzLXNjb3JlLmVsDQorKysgYi9saXNwL2dudXMvZ251cy1z Y29yZS5lbA0KQEAgLTU5MywxOCArNTkzLDE4IEBAIGN1cnJlbnQgc2NvcmUgZmlsZS4iDQogCSAg ICAoP2QgImRhdGUiIG5pbCBuaWwgZGF0ZSkNCiAJICAgICg/ZiAiZm9sbG93dXAiIG5pbCBuaWwg c3RyaW5nKQ0KIAkgICAgKD90ICJ0aHJlYWQiICJtZXNzYWdlLWlkIiBuaWwgc3RyaW5nKSkpDQot CSAoY2hhci10by10eXBlDQorCSAoY2hhci10by10eXBlcw0KIAkgICcoKD9zIHMgInN1YnN0cmlu ZyIgc3RyaW5nKQ0KIAkgICAgKD9lIGUgImV4YWN0IHN0cmluZyIgc3RyaW5nKQ0KIAkgICAgKD9m IGYgImZ1enp5IHN0cmluZyIgc3RyaW5nKQ0KLQkgICAgKD9yIHIgInJlZ2V4cCBzdHJpbmciIHN0 cmluZykNCisJICAgICg/ciByICJyZWdleHAgc3RyaW5nIiBzdHJpbmcgZGF0ZSkNCiAJICAgICg/ eiBzICJzdWJzdHJpbmciIGJvZHktc3RyaW5nKQ0KIAkgICAgKD9wIHIgInJlZ2V4cCBzdHJpbmci IGJvZHktc3RyaW5nKQ0KIAkgICAgKD9iIGJlZm9yZSAiYmVmb3JlIGRhdGUiIGRhdGUpDQogCSAg ICAoP2EgYWZ0ZXIgImFmdGVyIGRhdGUiIGRhdGUpDQogCSAgICAoP24gYXQgInRoaXMgZGF0ZSIg ZGF0ZSkNCi0JICAgICg/PCA8ICJsZXNzIHRoYW4gbnVtYmVyIiBudW1iZXIpDQotCSAgICAoPz4g PiAiZ3JlYXRlciB0aGFuIG51bWJlciIgbnVtYmVyKQ0KKwkgICAgKD88IDwgImxlc3MgdGhhbiBu dW1iZXIiIG51bWJlciBkYXRlKQ0KKwkgICAgKD8+ID4gImdyZWF0ZXIgdGhhbiBudW1iZXIiIG51 bWJlciBkYXRlKQ0KIAkgICAgKD89ID0gImVxdWFsIHRvIG51bWJlciIgbnVtYmVyKSkpDQogCSAo Y3VycmVudC1zY29yZS1maWxlIGdudXMtY3VycmVudC1zY29yZS1maWxlKQ0KIAkgKGNoYXItdG8t cGVybQ0KQEAgLTY1MiwxMCArNjUyLDkgQEAgY3VycmVudCBzY29yZSBmaWxlLiINCiAJICAobGV0 ICgobGVnYWwtdHlwZXMNCiAJCSAoZGVscSBuaWwNCiAJCSAgICAgICAobWFwY2FyIChsYW1iZGEg KHMpDQotCQkJCSAoaWYgKGVxIChudGggNCBlbnRyeSkNCi0JCQkJCSAobnRoIDMgcykpDQorCQkJ CSAoaWYgKG1lbWJlciAobnRoIDQgZW50cnkpIChjZGRkciBzKSkNCiAJCQkJICAgICBzIG5pbCkp DQotCQkJICAgICAgIGNoYXItdG8tdHlwZSkpKSkNCisJCQkgICAgICAgY2hhci10by10eXBlcykp KSkNCiAgICAgICAgICAgICAoc2V0cSBoZWFkZXItc3RyaW5nDQogICAgICAgICAgICAgICAgICAg KGZvcm1hdCAiJXMgaGVhZGVyIGAlcycgd2l0aCBtYXRjaCB0eXBlICglcz8pOiAiDQogCQkJICAo aWYgaW5jcmVhc2UgIkluY3JlYXNlIiAiTG93ZXIiKQ0KQEAgLTg3NSwxMCArODc0LDE4IEBAIElm IG9wdGlvbmFsIGFyZ3VtZW50IGBFWFRSQScgaXMgbm9uLW5pbCwgaXQncyBhIG5vbi1zdGFuZGFy ZCBvdmVydmlldyBoZWFkZXIuIg0KICAgKHdoZW4gKGVxIHR5cGUgdCkNCiAgICAgKHNldHEgdHlw ZSAncikpDQogICA7OyBTaW1wbGlmeSBtYXRjaGVzLi4uDQotICAoY29uZCAoKG9yIChlcSB0eXBl ICdyKSAoZXEgdHlwZSAncykgKGVxIHR5cGUgbmlsKSkNCisgIChjb25kICgob3IgKGFuZCAoZXEg dHlwZSAncikgKG5vdCAoc3RyaW5nPSBoZWFkZXIgImRhdGUiKSkpIChlcSB0eXBlICdzKSAoZXEg dHlwZSBuaWwpKQ0KIAkgKHNldHEgbWF0Y2ggKGlmIG1hdGNoIChnbnVzLXNpbXBsaWZ5LXN1Ympl Y3QtcmUgbWF0Y2gpICIiKSkpDQogCSgoZXEgdHlwZSAnZikNCi0JIChzZXRxIG1hdGNoIChnbnVz LXNpbXBsaWZ5LXN1YmplY3QtZnV6enkgbWF0Y2gpKSkpDQorCSAoc2V0cSBtYXRjaCAoZ251cy1z aW1wbGlmeS1zdWJqZWN0LWZ1enp5IG1hdGNoKSkpDQorICAgICAgICA7OyBQcm92aWRlIGJldHRl ciBkZWZhdWx0IHZhbHVlcyBpZiB3ZSdyZSBzY29yaW5nIG9uIGRhdGUgaGVhZGVyDQorICAgICAg ICAoKHN0cmluZz0gaGVhZGVyICJkYXRlIikNCisgICAgICAgICAoc2V0cSBtYXRjaCAoaWYgKG9y IChlcSB0eXBlICc8KSAoZXEgdHlwZSAnPikpDQorICAgICAgICAgICAgICAgICAgICAgICAgIChm b3JtYXQtc2Vjb25kcyAiJWQiDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAodGltZS1zdWJ0cmFjdA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChjdXJyZW50LXRpbWUpDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGdudXMtZGF0ZS1nZXQtdGltZSBtYXRjaCkpKQ0KKyAgICAgICAgICAgICAgICAg ICAgICAgKHN1YnN0cmluZy1uby1wcm9wZXJ0aWVzIChnbnVzLWRhdGUtaXNvODYwMSBtYXRjaCkp KSkpKQ0KICAgKGxldCAoKHNjb3JlIChnbnVzLXNjb3JlLWRlbHRhLWRlZmF1bHQgc2NvcmUpKQ0K IAkoaGVhZGVyIChkb3duY2FzZSBoZWFkZXIpKQ0KIAluZXcpDQpAQCAtODkzLDE0ICs5MDAsOSBA QCBJZiBvcHRpb25hbCBhcmd1bWVudCBgRVhUUkEnIGlzIG5vbi1uaWwsIGl0J3MgYSBub24tc3Rh bmRhcmQgb3ZlcnZpZXcgaGVhZGVyLiINCiAJCQkJICh0ICJwZXJtYW5lbnQiKSkNCiAJCQkgICBo ZWFkZXINCiAJCQkgICAoaWYgKDwgc2NvcmUgMCkgImxvd2VyIiAicmFpc2UiKSkNCi0gICAgICAg ICAgICAgICAgICAgKGNvbmQgKChudW1iZXJwIG1hdGNoKSAoaW50LXRvLXN0cmluZyBtYXRjaCkp DQotICAgICAgICAgICAgICAgICAgICAgICAgICgoc3RyaW5nPSBoZWFkZXIgImRhdGUiKQ0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgKGludC10by1zdHJpbmcNCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAoLQ0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoLyAoY2FyICh0aW1l LWNvbnZlcnQgKGN1cnJlbnQtdGltZSkgMSkpIDg2NDAwKQ0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoLyAoY2FyICh0aW1lLWNvbnZlcnQgKGdudXMtZGF0ZS1nZXQtdGltZSBtYXRjaCkg MSkpDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg2NDAwKSkpKQ0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAodCBtYXRjaCkpKSkpDQorCQkgICAoaWYgKG51bWJlcnAgbWF0Y2gp DQorCQkgICAgICAgKGludC10by1zdHJpbmcgbWF0Y2gpDQorCQkgICAgIG1hdGNoKSkpKQ0KIA0K ICAgICA7OyBJZiB0aGlzIGlzIGFuIGludGVnZXIgY29tcGFyaXNvbiwgd2UgdHJhbnNmb3JtIGZy b20gc3RyaW5nIHRvIGludC4NCiAgICAgKGlmIChlcSAobnRoIDIgKGFzc29jIGhlYWRlciBnbnVz LWhlYWRlci1pbmRleCkpICdnbnVzLXNjb3JlLWludGVnZXIpDQpAQCAtOTA5LDE2ICs5MTEsMTMg QEAgSWYgb3B0aW9uYWwgYXJndW1lbnQgYEVYVFJBJyBpcyBub24tbmlsLCBpdCdzIGEgbm9uLXN0 YW5kYXJkIG92ZXJ2aWV3IGhlYWRlci4iDQogICAgICAgKHNldC10ZXh0LXByb3BlcnRpZXMgMCAo bGVuZ3RoIG1hdGNoKSBuaWwgbWF0Y2gpKQ0KIA0KICAgICA7OyBNb2RpZnkgbWF0Y2ggYW5kIHR5 cGUgZm9yIGFydGljbGUgYWdlIHNjb3JpbmcuDQotICAgIChpZiAoc3RyaW5nPSAiZGF0ZSIgKG50 aCAwIChhc3NvYyBoZWFkZXIgZ251cy1oZWFkZXItaW5kZXgpKSkNCi0JKGxldCAoKGFnZSAoc3Ry aW5nLXRvLW51bWJlciBtYXRjaCkpKQ0KLQkgIChpZiAob3IgKDwgYWdlIDApDQotCQkgIChzdHJp bmc9ICIwIiBtYXRjaCkpDQotCSAgICAgICh1c2VyLWVycm9yICJBcnRpY2xlIGFnZSBtdXN0IGJl IGEgcG9zaXRpdmUgbnVtYmVyIikpDQotCSAgKHNldHEgbWF0Y2ggYWdlDQotCQl0eXBlIChjb25k ICgoZXEgdHlwZSAnYWZ0ZXIpDQotCQkJICAgICc8KQ0KLQkJCSAgICgoZXEgdHlwZSAnYmVmb3Jl KQ0KLQkJCSAgICAnPikpKSkpDQorICAgICh3aGVuIChhbmQgKHN0cmluZz0gImRhdGUiIChudGgg MCAoYXNzb2MgaGVhZGVyIGdudXMtaGVhZGVyLWluZGV4KSkpDQorICAgICAgICAgICAgICAgKG9y IChlcSB0eXBlICc8KSAoZXEgdHlwZSAnPikpKQ0KKyAgICAgIChsZXQgKChhZ2UgKHN0cmluZy10 by1udW1iZXIgbWF0Y2gpKSkNCisgICAgICAgIChpZiAob3IgKDwgYWdlIDApDQorICAgICAgICAg ICAgICAgIChzdHJpbmc9ICIwIiBtYXRjaCkpDQorICAgICAgICAgICAgKHVzZXItZXJyb3IgIkFy dGljbGUgYWdlIG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIiKSkNCisgICAgICAgIChzZXRxIG1h dGNoIGFnZSkpKQ0KIA0KICAgICAodW5sZXNzIChlcSBkYXRlICdub3cpDQogICAgICAgOzsgQWRk IHRoZSBzY29yZSBlbnRyeSB0byB0aGUgc2NvcmUgZmlsZS4NCkBAIC0xODA2LDcgKzE4MDUsNyBA QCBzY29yZSBpbiBgZ251cy1uZXdzZ3JvdXAtc2NvcmVkJyBieSBTQ09SRS4iDQogCSAgICgoZXEg dHlwZSAnYXQpDQogCSAgICAoc2V0cSBtYXRjaC1mdW5jICdzdHJpbmc9DQogCQkgIG1hdGNoIChn bnVzLWRhdGUtaXNvODYwMSAobnRoIDAga2lsbCkpKSkNCi0JICAgKChlcSB0eXBlICdyZWdleHAp DQorCSAgICgob3IgKGVxIHR5cGUgJ3JlZ2V4cCkgKGVxIHR5cGUgJ3IpKQ0KIAkgICAgKHNldHEg bWF0Y2gtZnVuYyAnc3RyaW5nLW1hdGNoDQogCQkgIG1hdGNoIChudGggMCBraWxsKSkpDQogCSAg ICh0IChlcnJvciAiSW52YWxpZCBtYXRjaCB0eXBlOiAlcyIgdHlwZSkpKQ0KLS0gDQoyLjM5LjMg KEFwcGxlIEdpdC0xNDUpDQoNCg== --b1_BnNPGPrd73OV57uR4CO0TYdniUXGNqeedEUBD18c-- ------------=_1723062181-6105-1--