From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Pixel-based display functions Date: Wed, 28 Jan 2015 17:27:13 +0200 Message-ID: <83sievncxa.fsf@gnu.org> References: <87k31fwwyv.fsf@ferrier.me.uk> <87bnmq9ibf.fsf@ferrier.me.uk> <87lhlrx5fc.fsf@building.gnus.org> <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org> <87fvbyagaw.fsf@building.gnus.org> <83iogujvbq.fsf@gnu.org> <87tx0ee7rf.fsf@building.gnus.org> <83egricpvg.fsf@gnu.org> <87zj97vic8.fsf@building.gnus.org> <83wq4argjp.fsf@gnu.org> <87iofui8vo.fsf@building.gnus.org> <838ugqqczp.fsf@gnu.org> <877fw9dndz.fsf@building.gnus.org> <83a914ozsh.fsf@gnu.org> <874mrb1t62.fsf_-_@building.gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422458875 7767 80.91.229.3 (28 Jan 2015 15:27:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2015 15:27:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 28 16:27:51 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 1YGUX0-0003iy-GX for ged-emacs-devel@m.gmane.org; Wed, 28 Jan 2015 16:27:50 +0100 Original-Received: from localhost ([::1]:54188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUWz-0000rU-Ph for ged-emacs-devel@m.gmane.org; Wed, 28 Jan 2015 10:27:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUWd-0000lw-Bx for emacs-devel@gnu.org; Wed, 28 Jan 2015 10:27:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGUWX-00026V-TO for emacs-devel@gnu.org; Wed, 28 Jan 2015 10:27:27 -0500 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:49368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUWX-00025P-KD for emacs-devel@gnu.org; Wed, 28 Jan 2015 10:27:21 -0500 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NIW0040082R0B00@mtaout28.012.net.il> for emacs-devel@gnu.org; Wed, 28 Jan 2015 17:25:29 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NIW00N5Y86HZY50@mtaout28.012.net.il>; Wed, 28 Jan 2015 17:25:29 +0200 (IST) In-reply-to: <874mrb1t62.fsf_-_@building.gnus.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 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:181912 Archived-At: > From: Lars Ingebrigtsen > Date: Wed, 28 Jan 2015 14:27:17 +1100 > > shr needs three functions to be kind-of fast to work: > > 1) A pixel equivalent of `current-column' You already have it: (car (nth 2 (posn-at-point))) > 2) A pixel equivalent of `move-to-column' (which will be imprecise, of > course, but that's OK) You already have it (albeit not necessarily where you'd look ;-): (vertical-motion (cons (/ PIXELS (frame-char-width)) 0)) > 3) A pixel equivalent of `string-width' Didn't we just go through using font-get-glyphs for that? Or just insert the string into the current buffer and use posn-at-point to see how many pixels it took. Do the above fix your problems?