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:58:23 +1100 Message-ID: <877fvvjr9c.fsf@building.gnus.org> References: <87vbjowlqv.fsf@building.gnus.org> <83oapglbx6.fsf@gnu.org> <83lhkkl23i.fsf@gnu.org> <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> <54CE4D8A.5040201@gmx.at> <87zj8wy79g.fsf@building.gnus.org> <87k2zxynvk.fsf@building.gnus.org> <54D33A2C.1060603@gmx.at> <837fvwfigd.fsf@gnu.org> <54D46D0B.1050402@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423216864 28850 80.91.229.3 (6 Feb 2015 10:01:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2015 10:01:04 +0000 (UTC) Cc: Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 11:01:00 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 1YJfid-0008FA-Dg for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 11:00:59 +0100 Original-Received: from localhost ([::1]:47422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfic-0000Gm-Nd for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 05:00:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfiV-0000GO-QJ for emacs-devel@gnu.org; Fri, 06 Feb 2015 05:00:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJfiS-0005OI-Qo for emacs-devel@gnu.org; Fri, 06 Feb 2015 05:00:51 -0500 Original-Received: from smtp.syd.comcen.com.au ([203.23.236.77]:4476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJfiB-00058j-84; Fri, 06 Feb 2015 05:00:31 -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 t169wSYT004731; Fri, 6 Feb 2015 20:58:28 +1100 (EST) In-Reply-To: <54D46D0B.1050402@gmx.at> (martin rudalics's message of "Fri, 06 Feb 2015 08:28:11 +0100") 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.126, required 4, AWL 0.03, BAYES_50 0.00, 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:182513 Archived-At: martin rudalics writes: > We can do that. But it's hardly cheaper than > > (save-window-excursion > (set-window-buffer nil ...) > (window-text-pixel-size ...) > ...) > > especially when packing multiple `window-text-pixel-size' calls into > the same excursion. Ok; I can try doing that and see what the results are. Another possible interface function just occurred to me, though. :-) (Many ways to skin a ... fill...) I haven't looked closely at the code, but I think in all (or most) instances where I need to know the pixel width I ended up with in a column, what I really need to know is the width of the longest line. So a `window-text-pixel-width' function that loops over all the lines in the specified region, and return the maximum width, might be what I really need here. Hm... Yeah, I think that might be a fast and handy function? It doesn't really solve the problem of `vertical-motion' being too slow, really, when finding fill points in large HTML documents. Hm... so many approaches... Hm. A `window-text-glyphs-pixel-widths' that returns all the pixel widths for all the glyphs in the region, segmented by line? That would avoid calling `vertical-motion' at all, but may not be any faster than calling `vertical-motion'. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/