From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tick Reduction Date: Wed, 24 Nov 2021 19:41:20 +0200 Message-ID: <83bl298n9b.fsf@gnu.org> References: <87bl2hyzca.fsf@gnus.org> <87wnl1jnfa.fsf@gnus.org> <83czmtqnl7.fsf@gnu.org> <87h7c5jmbg.fsf@gnus.org> <838rxhqmqv.fsf@gnu.org> <878rxhjlot.fsf@gnus.org> <874k85jlmq.fsf@gnus.org> <87v90khaa8.fsf@gnus.org> <83zgpwp7v2.fsf@gnu.org> <87tug4fdn7.fsf@gnus.org> <83pmqsp0m7.fsf@gnu.org> <87k0gzyy8k.fsf@gnus.org> <835ysjoupv.fsf@gnu.org> <8735nnyob1.fsf@gnus.org> <83y25fneeh.fsf@gnu.org> <87pmqrx7rh.fsf@gnus.org> <83tug3ndaj.fsf@gnu.org> <874k81vmlf.fsf@gnus.org> <83sfvl8wjw.fsf@gnu.org> <87o869y0v2.fsf@gnus.org> <83fsrl8owz.fsf@gnu.org> <87o869wkcx.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14853"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, stefankangas@gmail.com, dgutov@yandex.ru To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 24 18:42:40 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpwI4-0003iU-1E for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Nov 2021 18:42:40 +0100 Original-Received: from localhost ([::1]:43722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpwI2-0005zo-Qy for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Nov 2021 12:42:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpwGp-0004Mx-0Q for emacs-devel@gnu.org; Wed, 24 Nov 2021 12:41:23 -0500 Original-Received: from [2001:470:142:3::e] (port=40018 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpwGn-0003Dd-La; Wed, 24 Nov 2021 12:41:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wTvjsppxwwth5tLK19lAyW0xOjuRCjLaCIEhNunvm+4=; b=gO60JIztAaqq V8BGfqvoGl1y6esfyJvfFtq+Hh/3vonAMyTPmRKicxR9cmLUatKqlimJ+J0fEEFaeEKl6yNi3sAsn fB9f8zQ2OTvU6Tf9sT3rZxhMUUPsdB61EsKdHHDXE07Hu6xlgm8oNxML044VukSmD2K9Yt+vD7odv ePJWqKm4AuIAq+xCKc3nzAvHhDgnQL9oUaiF1TO9aKtQdBo8zpmFNCovBJVcp3WmbpBpsHl3k+QHF 9z+gC6LfeGNFmrrHKkTU4QJvM7CCqe4jD5s9HoN3MAgWzkXN+CuhC/oVCWCO2It86meYwcg3LnnST szB/xIRoft/1qAJweAUNJg==; Original-Received: from [87.69.77.57] (port=4347 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpwGn-0002Ux-CE; Wed, 24 Nov 2021 12:41:21 -0500 In-Reply-To: <87o869wkcx.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 24 Nov 2021 18:10:06 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280032 Archived-At: > From: Lars Ingebrigtsen > Cc: dgutov@yandex.ru, stefankangas@gmail.com, emacs-devel@gnu.org > Date: Wed, 24 Nov 2021 18:10:06 +0100 > > Eli Zaretskii writes: > > > Btw, why don't you just record in the iterator the position where it > > ends when you first see the property, instead of trying to identify > > that by comparing property values? The iterator structure has a > > member called 'position' for this purpose. > > Hm... how do I know where it ends when I see the start? There's the display_prop_end function we normally use for that. > > In any case, can you please explain what the test bufpos == 0 tries to > > test? I'd like to understand the logic there. > > I may well have misunderstood something, but my bufpos == 0 test is > testing whether I'm really being called from display_string. If it not > 0, I'm assuming I'm being called while displaying a buffer. I guessed that much, but again: if you just want to test that you are called from display_string, the test STRINGP (object) should be enough. And I'm confused by the fact that for buffers you test if (bufpos > BEGV && EQ (FOO, BAR)) whereas for a string you test if (bufpos == 0 && !EQ (FOO, BAR)) The equivalent of BEGV in strings is zero, so I'd expect if (bufpos > 0 and also why is the first case tests equality, whereas the second one tests INequality? IOW, the issue here AFAIU is that you might be called to display buffer text with this property or to display a Lisp string with this property, so the tests should be equivalent, and the only difference between strings and buffers is that text starts at BEGV in buffers but at zero in strings. So why there are more differences that that? What am I missing?