From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Pixel-based display functions Date: Fri, 06 Feb 2015 20:47:40 +1100 Message-ID: <87bnl7jrr7.fsf@building.gnus.org> References: <83bnlgkl1s.fsf@gnu.org> <837fw3l7uz.fsf@gnu.org> <54CD4B27.4080201@gmx.at> <874mr6qvi5.fsf@building.gnus.org> <87sieqpfxh.fsf@building.gnus.org> <54CDE908.7050908@gmx.at> <87ioflq0dz.fsf@building.gnus.org> <54CE2187.9070003@gmx.at> <83lhkhiq8t.fsf@gnu.org> <54CE54A3.1020707@gmx.at> <838ughilmo.fsf@gnu.org> <54CE6BD2.8000402@gmx.at> <8361bliin0.fsf@gnu.org> <83386piiby.fsf@gnu.org> <87oap9yoti.fsf@building.gnus.org> <874mqzvnwo.fsf@building.gnus.org> <83h9uzeb4a.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423216150 16515 80.91.229.3 (6 Feb 2015 09:49:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2015 09:49:10 +0000 (UTC) Cc: rudalics@gmx.at, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 10:49:09 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YJfX7-0002cw-5u for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 10:49:05 +0100 Original-Received: from localhost ([::1]:47399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfX6-0005S2-Fe for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 04:49:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfX2-0005Rw-VQ for emacs-devel@gnu.org; Fri, 06 Feb 2015 04:49:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJfX1-0005Jn-Tt for emacs-devel@gnu.org; Fri, 06 Feb 2015 04:49:00 -0500 Original-Received: from smtp.syd.comcen.com.au ([203.23.236.77]:1216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfWw-0005FV-2q; Fri, 06 Feb 2015 04:48:54 -0500 Original-Received: from building.gnus.org ([27.96.197.126]) by smtp.syd.comcen.com.au (8.13.4/8.12.9) with ESMTP id t169lii0002899; Fri, 6 Feb 2015 20:47:45 +1100 (EST) In-Reply-To: <83h9uzeb4a.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Feb 2015 09:45:57 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-comcen-MailScanner-Information: Please contact the ISP for more information X-comcen-MailScanner: Found to be clean X-comcen-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.12, required 4, AWL 0.03, BAYES_20 -0.01, RDNS_NONE 0.10) X-comcen-MailScanner-From: larsi@gnus.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.23.236.77 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182510 Archived-At: Eli Zaretskii writes: >> So, basically, folding 1500 lines takes 1.24s, of which 1.17s is spent >> in `vertical-motion' (plus function call overhead). (It's called a lot >> of times because the lines are very long and need to be filled more than >> once.) > > Can you explain why you need to call vertical-motion so many times? shr inserts text as long lines into the buffer, and I then use `vertical-motion' to go to the desired width, and then backtracking finding a fill point using the kinsuko algorithm. Then a newline is inserted, and we repeat until the line is completely filled. >> But it's all kinda moot since `window-text-pixel-size' doesn't work on >> non-displayed buffers (yet). > > window-text-pixel-size is equivalent to vertical-motion, so I don't > understand why you need both. Can you explain? `window-text-pixel-size' tells me what width I ended up with, while `vertical-motion' goes to an approximate fill point. >> I wonder whether a faster interface would be to have a version of >> `window-text-pixel-size' that returns a vector of glyph sizes. > > ??? Isn't that font-get-glyphs that you already tried? If not, why > not? What API would you like to have for that hypothetical function? I though we established pretty thoroughly that for `font-get-glyphs' to be a solution, we'd have to reimplement too much of the redisplay algorithm in Emacs Lisp (what with segmenting on scripts and faces, and then having to see whether a script uses multiple fonts, etc). And it was too slow during my testing. >> Of course, computing the vector may be unreasonably slow. > > It is again equivalent to vertical-motion and font-get-glyphs, so it's > not slow. But I don't yet see the issue clearly enough to tell what > could be done for you, so please post more information about what you > are trying to do. It would be equivalent to a `window-text-pixel-size' that advances one character at a time (since we'd avoid the entire `font-at' problem), and returns an vector of pixel points (instead of calling move_it_to just once). I haven't played with `window-text-pixel-size' at that level, since Martin seems to feel that it's not possible to get it to work on undisplayed buffers? But I may be misunderstanding what Martin was saying... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/