From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#70134: [PATCH] Show all date options when adding Gnus scores interactively Date: Thu, 09 May 2024 16:59:33 -0700 Message-ID: <87bk5esfiy.fsf@ericabrahamsen.net> References: <87edbovjvj.fsf@kubajecminek.cz> <86bk6dr8wi.fsf@gnu.org> <87jzkqjclv.fsf@ericabrahamsen.net> <87le4tz61f.fsf@kubajecminek.cz> <87bk5eu78m.fsf@kubajecminek.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39096"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70134@debbugs.gnu.org, Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= , eliz@gnu.org, larsi@gnus.org, Richard Stallman To: Alex Bochannek Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 10 02:00:46 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s5Dgr-0009zT-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 May 2024 02:00:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5DgE-0004DW-Pa; Thu, 09 May 2024 20:00:06 -0400 Original-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 1s5DgC-0004DF-VW for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 20:00:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5DgC-0005nQ-EE for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 20:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5DgA-0003Vf-0t for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 20:00:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 70134-submit@debbugs.gnu.org id=B70134.171529918313447 (code B ref 70134); Fri, 10 May 2024 00:00:01 +0000 Original-Received: (at 70134) by debbugs.gnu.org; 9 May 2024 23:59:43 +0000 Original-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 Original-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 Original-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= 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") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284785 Archived-At: 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?