From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#29489: Obsolete gnus-remove-if and gnus-remove-if-not Date: Tue, 28 Nov 2017 16:07:03 -0800 Message-ID: <87a7z6c5i0.fsf@ericabrahamsen.net> References: <87o9nmgwue.fsf@ericabrahamsen.net> <87r2sim0je.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511914099 3096 195.159.176.226 (29 Nov 2017 00:08:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2017 00:08:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 29489@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 29 01:08:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJpv7-0008Ub-0G for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Nov 2017 01:08:09 +0100 Original-Received: from localhost ([::1]:40624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJpvE-0007yt-7L for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 19:08:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJpv5-0007yU-Ak for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:08:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJpv1-0003vM-8O for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:08:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJpv1-0003vH-5F for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:08:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eJpuz-0000tk-Sz; Tue, 28 Nov 2017 19:08:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87o9nmgwue.fsf@ericabrahamsen.net> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 29 Nov 2017 00:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29489 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15119140553416 (code B ref -1); Wed, 29 Nov 2017 00:08:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2017 00:07:35 +0000 Original-Received: from localhost ([127.0.0.1]:35332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJpuZ-0000t2-5d for submit@debbugs.gnu.org; Tue, 28 Nov 2017 19:07:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJpuY-0000sq-29 for submit@debbugs.gnu.org; Tue, 28 Nov 2017 19:07:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJpuS-0003dl-1U for submit@debbugs.gnu.org; Tue, 28 Nov 2017 19:07:28 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJpuR-0003db-Ub for submit@debbugs.gnu.org; Tue, 28 Nov 2017 19:07:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJpuQ-0007we-PU for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:07:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJpuM-0003bS-PF for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:07:26 -0500 Original-Received: from [195.159.176.226] (port=38776 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJpuM-0003av-In for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 19:07:22 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eJpu7-0004bq-UI for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 01:07:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+hv328HPfBUngQu8K87lPHhRT1A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140512 Archived-At: Noam Postavsky writes: > Eric Abrahamsen writes: > >> Here's another one of these. >> >> I've replaced these with `seq-remove' and `seq-filter', and I suppose >> someone might object to that -- the other option would be `cl-remove-if' >> and `cl-remove-if-not'. I don't believe there's much practical difference. > > Neither the seq nor cl functions handle hash tables right? > >> - (gnus-remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb t) >> + (seq-filter 'gnus-valid-move-group-p gnus-active-hashtb) >> nil prefix nil default)) >> ((= 1 (length split-name)) >> (gnus-group-completing-read >> prom >> - (gnus-remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb t) >> + (seq-filter 'gnus-valid-move-group-p gnus-active-hashtb) >> nil prefix 'gnus-group-history (car split-name))) > >> -(defun gnus-remove-if (predicate sequence &optional hash-table-p) >> - "Return a copy of SEQUENCE with all items satisfying PREDICATE removed. >> -SEQUENCE should be a list, a vector, or a string. Returns always a list. >> -If HASH-TABLE-P is non-nil, regards SEQUENCE as a hash table." > > Although the docstring claims "hash table", while the code says... > >> - (if hash-table-p >> - (mapatoms (lambda (symbol) >> - (unless (funcall predicate symbol) >> - (push symbol out))) >> - sequence) > > obarray? Shhh, that's my next patch to Gnus! Turning its "hash tables" into actual hash tables. The obarrays are an impressive and horrible hack. For this version of the patch, `seq-filter' works on vectors. In the next patch, it's replaced by seq-filter->map-keys. Eric