Subject: bug#77713: closed (Re: bug#77713: 30.1; bug in proced-filter function in ./lisp/proced.el)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 13 Apr 2025 09:42:05 +0000

Your bug report

#77713: 30.1; bug in proced-filter function in ./lisp/proced.el

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 [email-masked].

-- 
77713: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77713
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77713: 30.1; bug in proced-filter function in ./lisp/proced.el
From: Eli Zaretskii <[email-masked]>
To: Armin Darvish <[email-masked]>
Cc: [email-masked]
Date: Sun, 13 Apr 2025 12:40:58 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Armin Darvish <[email-masked]>
> Date: Thu, 10 Apr 2025 10:50:15 -0700
> 
> I was trying to use the function proced-filter and pass a filter-list to it and I noticed that there is a bug in
> the function.
> 
> According to the documentation the filter-list can be a list of cons in the format (function . FUN) and in this
> case FUN should be applied to the attribute list of each process. However, if you look at the lines 1185-1188 in
> ./lisp/proced.el, instaed of applying the (cdr filter), (car filter) is passed to funcall which creates an
> error.
> 
> The (if (funcall (car filter) (cdr process)) on line 1187 should be (if (funcall (cdr
> filter) (cdr process)).

Thanks, now fixed on the emacs-30 branch, and closing the bug.

Subject: 30.1; bug in proced-filter function in ./lisp/proced.el
From: Armin Darvish <[email-masked]>
To: [email-masked]
Date: Thu, 10 Apr 2025 10:50:15 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I was trying to use the function `proced-filter' and pass a filter-list to it and I noticed that there is a bug in the function.

According to the documentation the filter-list can be a list of cons in the format `(function . FUN)' and in this case `FUN' should be applied to the attribute list of each process. However, if you look at the lines 1185-1188 in ./lisp/proced.el, instaed of applying the `(cdr filter)', `(car filter)' is passed to funcall which creates an error.

The `(if (funcall (car filter) (cdr process))' on line 1187 should be `(if (funcall (cdr filter) (cdr process))'.

-- 

Best Regards,

*Armin Darvish*
------------------------------------------------------------------------
[www.armindarvish.com]

[www.armindarvish.com] <https://www.armindarvish.com/>