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: Thu, 29 Jan 2015 11:37:50 +1100 Message-ID: <87pp9ypgkh.fsf@building.gnus.org> References: <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> <83sievncxa.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422492062 21856 80.91.229.3 (29 Jan 2015 00:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2015 00:41:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 29 01:41:02 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 1YGdAL-00066A-QI for ged-emacs-devel@m.gmane.org; Thu, 29 Jan 2015 01:41:02 +0100 Original-Received: from localhost ([::1]:57150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGdAL-00073J-2C for ged-emacs-devel@m.gmane.org; Wed, 28 Jan 2015 19:41:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGdAC-0006vX-C1 for emacs-devel@gnu.org; Wed, 28 Jan 2015 19:40:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGdA8-0002XG-I2 for emacs-devel@gnu.org; Wed, 28 Jan 2015 19:40:52 -0500 Original-Received: from smtp.syd.comcen.com.au ([203.23.236.77]:4506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGdA1-0002Tw-2l; Wed, 28 Jan 2015 19:40:41 -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 t0T0bsn4004542; Thu, 29 Jan 2015 11:37:56 +1100 (EST) In-Reply-To: <83sievncxa.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 28 Jan 2015 17:27:13 +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.101, required 4, AWL 0.00, 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:181952 Archived-At: Eli Zaretskii writes: >> 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))) Isn't that one of those functions that says what redisplay has already computed? So it's kinda useless. (with-temp-buffer (insert (propertize "hello" 'face 'variable-pitch)) (car (nth 2 (posn-at-point)))) => nil >> 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)) Is that another one of those that only work after redisplay? >> 3) A pixel equivalent of `string-width' > > Didn't we just go through using font-get-glyphs for that? Yes, and it's too slow to use. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/