unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59458: [PATCH] Fix tracing for advanced scoring
@ 2022-11-21 21:30 Łukasz Stelmach
  2022-11-24  9:24 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Łukasz Stelmach @ 2022-11-21 21:30 UTC (permalink / raw)
  To: 59458; +Cc: Łukasz Stelmach

* lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
code outside of if so it's executed for both branches.
---
 lisp/gnus/gnus-logic.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
index c1b559ba6f4..346d8a28910 100644
--- a/lisp/gnus/gnus-logic.el
+++ b/lisp/gnus/gnus-logic.el
@@ -71,11 +71,11 @@
 		    (+ (cdr score) new-score))
 	  (push (cons (mail-header-number gnus-advanced-headers)
 		      new-score)
-		gnus-newsgroup-scored)
-	  (when trace
-	    (push (cons "A file" rule)
-		  ;; Must be synced with `gnus-score-edit-file-at-point'.
-		  gnus-score-trace)))))))
+		gnus-newsgroup-scored))
+	(when trace
+	  (push (cons "A file" rule)
+		;; Must be synced with `gnus-score-edit-file-at-point'.
+		gnus-score-trace))))))
 
 (defun gnus-advanced-score-rule (rule)
   "Apply RULE to `gnus-advanced-headers'."
-- 
2.30.2






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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2022-11-21 21:30 bug#59458: [PATCH] Fix tracing for advanced scoring Łukasz Stelmach
@ 2022-11-24  9:24 ` Eli Zaretskii
  2022-11-24 19:39   ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-11-24  9:24 UTC (permalink / raw)
  To: Łukasz Stelmach, Lars Ingebrigtsen, Eric Abrahamsen; +Cc: 59458

> Cc: Łukasz Stelmach <stlman@poczta.fm>
> From: Łukasz Stelmach <stlman@poczta.fm>
> Date: Mon, 21 Nov 2022 22:30:55 +0100
> 
> * lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
> code outside of if so it's executed for both branches.
> ---
>  lisp/gnus/gnus-logic.el | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
> index c1b559ba6f4..346d8a28910 100644
> --- a/lisp/gnus/gnus-logic.el
> +++ b/lisp/gnus/gnus-logic.el
> @@ -71,11 +71,11 @@
>  		    (+ (cdr score) new-score))
>  	  (push (cons (mail-header-number gnus-advanced-headers)
>  		      new-score)
> -		gnus-newsgroup-scored)
> -	  (when trace
> -	    (push (cons "A file" rule)
> -		  ;; Must be synced with `gnus-score-edit-file-at-point'.
> -		  gnus-score-trace)))))))
> +		gnus-newsgroup-scored))
> +	(when trace
> +	  (push (cons "A file" rule)
> +		;; Must be synced with `gnus-score-edit-file-at-point'.
> +		gnus-score-trace))))))
>  
>  (defun gnus-advanced-score-rule (rule)
>    "Apply RULE to `gnus-advanced-headers'."
> -- 
> 2.30.2

Lars, Eric,

Any comments?  Is this good to go in?

Thanks.





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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2022-11-24  9:24 ` Eli Zaretskii
@ 2022-11-24 19:39   ` Eric Abrahamsen
  2023-09-07 21:07     ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2022-11-24 19:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Lars Ingebrigtsen, 59458, Łukasz Stelmach

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: Łukasz Stelmach <stlman@poczta.fm>
>> From: Łukasz Stelmach <stlman@poczta.fm>
>> Date: Mon, 21 Nov 2022 22:30:55 +0100
>> 
>> * lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
>> code outside of if so it's executed for both branches.

I'm not very familiar with this code (this is actually the first I'm
hearing of gnus-logic.el), so I hope Lars will chime in. It makes sense
that tracing should happen whether or not the rule matched? But what
about the sexp before that? Would we be pushing the mail-header-number
and new score to `gnus-newsgroup-score' only if the rule *wasn't*
successful?

I think this one should wait for Lars. If we don't hear from him and
it's holding things up, I can look more closely.





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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2022-11-24 19:39   ` Eric Abrahamsen
@ 2023-09-07 21:07     ` Stefan Kangas
  2023-09-08  6:04       ` Eli Zaretskii
  2023-09-12  0:07       ` Eric Abrahamsen
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Kangas @ 2023-09-07 21:07 UTC (permalink / raw)
  To: Eric Abrahamsen
  Cc: Eli Zaretskii, Lars Ingebrigtsen, 59458, Łukasz Stelmach

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> Cc: Łukasz Stelmach <stlman@poczta.fm>
>>> From: Łukasz Stelmach <stlman@poczta.fm>
>>> Date: Mon, 21 Nov 2022 22:30:55 +0100
>>>
>>> * lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
>>> code outside of if so it's executed for both branches.
>
> I'm not very familiar with this code (this is actually the first I'm
> hearing of gnus-logic.el), so I hope Lars will chime in. It makes sense
> that tracing should happen whether or not the rule matched? But what
> about the sexp before that? Would we be pushing the mail-header-number
> and new score to `gnus-newsgroup-score' only if the rule *wasn't*
> successful?
>
> I think this one should wait for Lars. If we don't hear from him and
> it's holding things up, I can look more closely.

Eric,

It would be great if you could help review this.  Thanks in advance.





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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2023-09-07 21:07     ` Stefan Kangas
@ 2023-09-08  6:04       ` Eli Zaretskii
  2023-09-12  0:07       ` Eric Abrahamsen
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-09-08  6:04 UTC (permalink / raw)
  To: Stefan Kangas, Andrew Cohen; +Cc: eric, larsi, 59458, stlman

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Thu, 7 Sep 2023 14:07:57 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>, 59458@debbugs.gnu.org, 
> 	Łukasz Stelmach <stlman@poczta.fm>
> 
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> 
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> >>> Cc: Łukasz Stelmach <stlman@poczta.fm>
> >>> From: Łukasz Stelmach <stlman@poczta.fm>
> >>> Date: Mon, 21 Nov 2022 22:30:55 +0100
> >>>
> >>> * lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
> >>> code outside of if so it's executed for both branches.
> >
> > I'm not very familiar with this code (this is actually the first I'm
> > hearing of gnus-logic.el), so I hope Lars will chime in. It makes sense
> > that tracing should happen whether or not the rule matched? But what
> > about the sexp before that? Would we be pushing the mail-header-number
> > and new score to `gnus-newsgroup-score' only if the rule *wasn't*
> > successful?
> >
> > I think this one should wait for Lars. If we don't hear from him and
> > it's holding things up, I can look more closely.
> 
> Eric,
> 
> It would be great if you could help review this.  Thanks in advance.

Adding Andrew, in case he could have some ideas or comments.





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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2023-09-07 21:07     ` Stefan Kangas
  2023-09-08  6:04       ` Eli Zaretskii
@ 2023-09-12  0:07       ` Eric Abrahamsen
  2023-09-12  0:32         ` Stefan Kangas
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2023-09-12  0:07 UTC (permalink / raw)
  To: Stefan Kangas
  Cc: Eli Zaretskii, Lars Ingebrigtsen, 59458, Łukasz Stelmach


On 09/07/23 14:07 PM, Stefan Kangas wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> Cc: Łukasz Stelmach <stlman@poczta.fm>
>>>> From: Łukasz Stelmach <stlman@poczta.fm>
>>>> Date: Mon, 21 Nov 2022 22:30:55 +0100
>>>>
>>>> * lisp/gnus/gnus-logic.el (gnus-score-advanced): Move the tracing
>>>> code outside of if so it's executed for both branches.
>>
>> I'm not very familiar with this code (this is actually the first I'm
>> hearing of gnus-logic.el), so I hope Lars will chime in. It makes sense
>> that tracing should happen whether or not the rule matched? But what
>> about the sexp before that? Would we be pushing the mail-header-number
>> and new score to `gnus-newsgroup-score' only if the rule *wasn't*
>> successful?
>>
>> I think this one should wait for Lars. If we don't hear from him and
>> it's holding things up, I can look more closely.
>
> Eric,
>
> It would be great if you could help review this.  Thanks in advance.

I've taken a closer look, and I do think this is okay. The `when' after
the `dolist' only fires if the rule matches, the `if' is only there to
see if this article has been previously scored or not. So moving the
"(when trace" up to the top-level of the containing `when' (ie, out of the
`if') does look like the right thing to do.

Eric





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

* bug#59458: [PATCH] Fix tracing for advanced scoring
  2023-09-12  0:07       ` Eric Abrahamsen
@ 2023-09-12  0:32         ` Stefan Kangas
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2023-09-12  0:32 UTC (permalink / raw)
  To: Eric Abrahamsen
  Cc: Eli Zaretskii, 59458-done, Lars Ingebrigtsen,
	Łukasz Stelmach

Version: 30.1

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> On 09/07/23 14:07 PM, Stefan Kangas wrote:
>
>> Eric,
>>
>> It would be great if you could help review this.  Thanks in advance.
>
> I've taken a closer look, and I do think this is okay. The `when' after
> the `dolist' only fires if the rule matches, the `if' is only there to
> see if this article has been previously scored or not. So moving the
> "(when trace" up to the top-level of the containing `when' (ie, out of the
> `if') does look like the right thing to do.

Thanks.  Installed it on master as commit e25ad6e2a30.





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

end of thread, other threads:[~2023-09-12  0:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 21:30 bug#59458: [PATCH] Fix tracing for advanced scoring Łukasz Stelmach
2022-11-24  9:24 ` Eli Zaretskii
2022-11-24 19:39   ` Eric Abrahamsen
2023-09-07 21:07     ` Stefan Kangas
2023-09-08  6:04       ` Eli Zaretskii
2023-09-12  0:07       ` Eric Abrahamsen
2023-09-12  0:32         ` Stefan Kangas

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

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

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