From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12463: 24.2; pos-visible-in-window-p gets slower over time Date: Fri, 21 Sep 2012 10:34:05 +0300 Message-ID: <83pq5fyglu.fsf@gnu.org> References: <87wqzs1a4c.fsf@queen.i-did-not-set--mail-host-address--so-tickle-me> <83mx0n22p0.fsf@gnu.org> <87d31jcqce.fsf@gnu.org> <4023344.MyoQPQRfcJ@queen> <87sjac1185.fsf@gnu.org> <878vc4ylr6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1348212888 30587 80.91.229.3 (21 Sep 2012 07:34:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2012 07:34:48 +0000 (UTC) Cc: lekktu@gmail.com, jwalt@garni.ch, 12463@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 09:34:51 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TExl8-0001gu-0B for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 09:34:46 +0200 Original-Received: from localhost ([::1]:41789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TExl3-0004NX-Jb for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 03:34:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TExkw-0004Lb-6V for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 03:34:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TExkp-0004eS-GP for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 03:34:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TExkp-0004eL-D9 for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 03:34:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TExmM-0001Aq-74 for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 03:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Sep 2012 07:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12463 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12463-submit@debbugs.gnu.org id=B12463.13482129314474 (code B ref 12463); Fri, 21 Sep 2012 07:36:02 +0000 Original-Received: (at 12463) by debbugs.gnu.org; 21 Sep 2012 07:35:31 +0000 Original-Received: from localhost ([127.0.0.1]:46068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TExlq-0001A6-MG for submit@debbugs.gnu.org; Fri, 21 Sep 2012 03:35:31 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:42397) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TExln-00019x-Ch for 12463@debbugs.gnu.org; Fri, 21 Sep 2012 03:35:28 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAO00E00VHT6T00@a-mtaout22.012.net.il> for 12463@debbugs.gnu.org; Fri, 21 Sep 2012 10:33:50 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAO00D7HVODRPA0@a-mtaout22.012.net.il>; Fri, 21 Sep 2012 10:33:50 +0300 (IDT) In-reply-to: <878vc4ylr6.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64677 Archived-At: > From: Chong Yidong > Date: Fri, 21 Sep 2012 13:42:53 +0800 > Cc: J=C3=B6rg Walter , 12463@debbugs.gnu.org >=20 > Please take a look at the following patch, which moves all the work= done > by Finit_image_library into lookup_image_type. This requires addin= g a > LIBRARIES argument to lookup_image_type, with the same meaning as > Finit_image_library and defaulting to Vdynamic_library_alist. Then > Finit_image_library would be a rather simple wrapper around > lookup_image_type. Other callers to lookup_image_type, such as > redisplay looking up an image, would be unaffected. Thanks. Some comments below. > /* Define a new image type from TYPE. This adds a copy of TYPE t= o > image_types and caches the loading status of TYPE. */ The LIBRARIES argument should be documented in the commentary. > ! static struct image_type * > ! define_image_type (struct image_type *type, Lisp_Object libraries= ) > { Since LIBRARIES could now be Qnil, but this function cannot tolerate that, there should be an assertion to that effect, either here or in every type->init function. > ! #ifdef HAVE_NTGUI > ! /* If we failed to load the library before, don't try again= . */ > ! Lisp_Object tested =3D Fassq (target_type, Vlibrary_cache); > ! if (CONSP (tested) && NILP (XCDR (tested))) > ! =09type_valid =3D 0; > ! else > ! #endif > ! =09{ > ! =09 /* If the load failed, avoid trying again. */ > ! =09 type_valid =3D (*type->init)(libraries); > ! =09 CACHE_IMAGE_TYPE (target_type, type_valid); > ! =09} > ! } What will happen if 'tested' is not a cons cell? > of `dynamic-library-alist', which see). */) > (Lisp_Object type, Lisp_Object libraries) > { > ! struct image_type *p =3D lookup_image_type (type, libraries); > ! return p ? *p->type : Qnil; > ! } This changes the return value of init-image-library; is there a good reason for not returning Qt here instead of the type symbol? > ! /* Look up image type SYMBOL, and return a pointer to its image_t= ype > ! structure. Value is null if SYMBOL is not a known image type.= */ Again, LIBRARIES is not documented. Also, I believe we use NULL in caps elsewhere. And finally, the argument is called TYPE, not SYMBOL= . > ! static struct image_type * > ! lookup_image_type (Lisp_Object type, Lisp_Object libraries) > ! { > ! if (NILP (libraries)) > ! libraries =3D Vdynamic_library_alist; I can't say I like this "default". Why not always call lookup_image_type with Vdynamic_library_alist? For that matter, why not make lookup_image_type always use Vdynamic_library_alist without passing it through the call parameters?