GNU bug report logs - #28573
Improving gnus-treat-predicate

Previous Next

Package: gnus;

Reported by: Geoff Kuenning <geoff <at> cs.hmc.edu>

Date: Sun, 24 Sep 2017 01:19:01 UTC

Severity: normal

Found in version 5.13

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28573 in the body.
You can then email your comments to 28573 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bugs <at> gnus.org:
bug#28573; Package gnus. (Sun, 24 Sep 2017 01:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geoff Kuenning <geoff <at> cs.hmc.edu>:
New bug report received and forwarded. Copy sent to bugs <at> gnus.org. (Sun, 24 Sep 2017 01:19:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Geoff Kuenning <geoff <at> cs.hmc.edu>
To: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: Improving gnus-treat-predicate
Date: Sat, 23 Sep 2017 18:17:57 -0700
Gnus-treat-predicate isn't as flexible as it could be, because 
you're limited to a preset list of predicates.  The following 
version adds two lines that allow the predicate to be a callable 
function.  The two lines are:

      ((functionp pred)
	(funcall pred))

The full (revised) function is:

(defun gnus-treat-predicate (val)
 (cond
  ((null val)
   nil)
  (gnus-treat-condition
   (eq gnus-treat-condition val))
  ((and (listp val)
	 (stringp (car val)))
   (apply 'gnus-or (mapcar `(lambda (s)
			       (string-match s ,(or 
			       gnus-newsgroup-name "")))
			    val)))
  ((listp val)
   (let ((pred (pop val)))
     (cond
      ((eq pred 'or)
	(apply 'gnus-or (mapcar 'gnus-treat-predicate val)))
      ((eq pred 'and)
	(apply 'gnus-and (mapcar 'gnus-treat-predicate val)))
      ((eq pred 'not)
	(not (gnus-treat-predicate (car val))))
      ((eq pred 'typep)
	(equal (car val) gnus-treat-type))
      ((functionp pred)
	(funcall pred))
      (t
	(error "%S is not a valid predicate" pred)))))
  ((eq val t)
   t)
  ((eq val 'head)
   nil)
  ((eq val 'first)
   (eq part-number 1))
  ((eq val 'last)
   (eq part-number total-parts))
  ((numberp val)
   (< gnus-treat-length val))
  (t
   (error "%S is not a valid value" val))))

Gnus v5.13
GNU Emacs 24.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.20.10)
of 2017-07-05 on cloud131

-- 
   Geoff Kuenning   geoff <at> cs.hmc.edu 
   http://www.cs.hmc.edu/~geoff/

An Internet that is not Open represents a potentially grave risk 
to
freedoms of many sorts -- freedom of speech and other civil 
liberties,
freedom of commerce, and more -- and that openness is what we must 
so
diligently work to both preserve and expand.
		-- Lauren Weinstein




Information forwarded to bugs <at> gnus.org:
bug#28573; Package gnus. (Wed, 11 Apr 2018 21:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 28573 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Geoff Kuenning <geoff <at> cs.hmc.edu>
Cc: 28573 <at> debbugs.gnu.org
Subject: Re: bug#28573: Improving gnus-treat-predicate
Date: Wed, 11 Apr 2018 23:38:34 +0200
Geoff Kuenning <geoff <at> cs.hmc.edu> writes:

> Gnus-treat-predicate isn't as flexible as it could be, because you're
> limited to a preset list of predicates.  The following version adds
> two lines that allow the predicate to be a callable function.  The two
> lines are:
>
>       ((functionp pred)
> 	(funcall pred))

Sounds good.  Could you send a complete patch that also includes
documentation for this new feature and a NEWS entry?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bugs <at> gnus.org:
bug#28573; Package gnus. (Fri, 27 Sep 2019 15:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 28573 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Geoff Kuenning <geoff <at> cs.hmc.edu>
Cc: 28573 <at> debbugs.gnu.org
Subject: Re: bug#28573: Improving gnus-treat-predicate
Date: Fri, 27 Sep 2019 17:28:55 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Geoff Kuenning <geoff <at> cs.hmc.edu> writes:
>
>> Gnus-treat-predicate isn't as flexible as it could be, because you're
>> limited to a preset list of predicates.  The following version adds
>> two lines that allow the predicate to be a callable function.  The two
>> lines are:
>>
>>       ((functionp pred)
>> 	(funcall pred))
>
> Sounds good.  Could you send a complete patch that also includes
> documentation for this new feature and a NEWS entry?

This change was applied in 2013, I see now, so I'm closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 28573 <at> debbugs.gnu.org and Geoff Kuenning <geoff <at> cs.hmc.edu> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Sep 2019 15:30:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Oct 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.