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 17:42:08 -0800 Message-ID: <87609tdfnz.fsf@ericabrahamsen.net> References: <87o9nmgwue.fsf@ericabrahamsen.net> <87r2sim0je.fsf@users.sourceforge.net> <87a7z6c5i0.fsf@ericabrahamsen.net> <87mv35nchc.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511919804 12570 195.159.176.226 (29 Nov 2017 01:43:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2017 01:43:24 +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 02:43:12 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 1eJrP4-0002XS-L7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Nov 2017 02:43:11 +0100 Original-Received: from localhost ([::1]:40857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJrPB-0002pb-7J for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 20:43:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJrP0-0002oF-1S for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:43:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJrOw-0004QM-U5 for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:43:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJrOw-0004QC-QN for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eJrOv-00038f-Uj; Tue, 28 Nov 2017 20:43: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 01:43: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.151191975212032 (code B ref -1); Wed, 29 Nov 2017 01:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2017 01:42:32 +0000 Original-Received: from localhost ([127.0.0.1]:35366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJrOR-000380-TS for submit@debbugs.gnu.org; Tue, 28 Nov 2017 20:42:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJrOP-00037i-3i for submit@debbugs.gnu.org; Tue, 28 Nov 2017 20:42:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJrOI-00047y-K0 for submit@debbugs.gnu.org; Tue, 28 Nov 2017 20:42:23 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJrOI-00047o-HE for submit@debbugs.gnu.org; Tue, 28 Nov 2017 20:42:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJrOH-0002XK-8X for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:42:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJrOE-00046C-0K for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:42:21 -0500 Original-Received: from [195.159.176.226] (port=35186 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJrOD-00045W-P7 for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 20:42:17 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eJrO3-0006s4-HD for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 02:42:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:rFshlwEbMlUZhIkZz81JaPKIlSE= 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:140517 Archived-At: Noam Postavsky writes: > Eric Abrahamsen writes: > >>> 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. > > Hmm, seq-filter works on vectors, but it's not reliable for obarrays: > > (let ((list nil) > (ob (make-vector 3 0))) > (intern "foo" ob) > (intern "bar" ob) > (intern "xxx" ob) > (seq-filter (lambda (_) t) ob)) ;=> (xxx 0 0) For the interim, all that matters is consistency: (let ((list nil) (ob (make-vector 3 0))) (intern "foo" ob) (intern "bar" ob) (intern "xxx" ob) (gnus-remove-if-not (lambda (_) t) ob)) ;=> (xxx 0 0) The goal of this patch series is to get Gnus into a state where behavior is at-a-glance comprehensible.