From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Pushing the `gnus-range-*' functions down into the C layer Date: Thu, 09 Sep 2010 14:01:00 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <8739ti68sz.fsf@lifelogs.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284058892 6798 80.91.229.12 (9 Sep 2010 19:01:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Sep 2010 19:01:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 09 21:01:30 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OtmNC-0006pS-PZ for ged-emacs-devel@m.gmane.org; Thu, 09 Sep 2010 21:01:27 +0200 Original-Received: from localhost ([127.0.0.1]:52981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtmNC-0006BQ-7D for ged-emacs-devel@m.gmane.org; Thu, 09 Sep 2010 15:01:26 -0400 Original-Received: from [140.186.70.92] (port=40455 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtmN3-0006BG-0r for emacs-devel@gnu.org; Thu, 09 Sep 2010 15:01:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtmMy-0002ds-0V for emacs-devel@gnu.org; Thu, 09 Sep 2010 15:01:16 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:51937) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtmMx-0002dZ-S7 for emacs-devel@gnu.org; Thu, 09 Sep 2010 15:01:11 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OtmMw-0006ca-1n for emacs-devel@gnu.org; Thu, 09 Sep 2010 21:01:10 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Sep 2010 21:01:10 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Sep 2010 21:01:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:lDHnL9xIY67bpRGuLx6pfTnzDKc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:129829 Archived-At: On Thu, 09 Sep 2010 17:16:56 +0200 Lars Magne Ingebrigtsen wrote: LMI> Would anyone mind if I implemented the `gnus-range-*' functions in C for LMI> Emacs 24? Gnus spends significant time on group entry/exit doing range LMI> handling/compressing/etc, and I think the functions are (slightly) LMI> generally useful. LMI> Gnus addresses articles by their number, so you have things like the LMI> "marked" list of articles that looks like LMI> (3 4 5 6 7 11 14 15 16 17 18) LMI> (or something). To save loading/saving time, these are stored in the LMI> .newsrc.eld file as range structures, which look like this: LMI> ((3 . 7) 11 (14 . 18)) LMI> To handle this, Gnus has a set of functions for computing LMI> intersections/differences/etc on the range structures. However, Emacs LMI> Lisp isn't really fast at doing this, so if you exit from a group that LMI> needs lots (I mean *lots*) of range handling, you get an annoying wait LMI> while it sits there computing. LMI> So I'm proposing implementing a set of useful functions in C, like LMI> `range-memq', `range-add', `range-intersection' and stuff. I think it's a good idea. We've seen IMAP article numbers overflow native Emacs ints at least once and it's been discussed a few times, e.g.: http://article.gmane.org/gmane.emacs.gnus.general/65390/match=overflow so maybe this API needs to support true 32-bit ints (perhaps through doubles) as per RFC 3501. Ted