From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Split `simple.el'? Date: Thu, 5 Apr 2018 14:56:01 -0700 (PDT) Message-ID: References: <5f1e960c-483f-4902-b4c2-b7a4ca3b04f4@default> <10c96362-297f-db97-d4a9-da3d66d4dd34@cs.ucla.edu> <83in974gwf.fsf@gnu.org> <83zi2j2hp4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1522965256 8850 195.159.176.226 (5 Apr 2018 21:54:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Apr 2018 21:54:16 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 05 23:54:11 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4Cpd-00029M-LL for ged-emacs-devel@m.gmane.org; Thu, 05 Apr 2018 23:54:09 +0200 Original-Received: from localhost ([::1]:57413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Cri-0006D2-WA for ged-emacs-devel@m.gmane.org; Thu, 05 Apr 2018 17:56:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Crb-0006CW-Os for emacs-devel@gnu.org; Thu, 05 Apr 2018 17:56:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4CrY-0004lT-NE for emacs-devel@gnu.org; Thu, 05 Apr 2018 17:56:11 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:39844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4CrY-0004js-Ch for emacs-devel@gnu.org; Thu, 05 Apr 2018 17:56:08 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w35LRnjr082936; Thu, 5 Apr 2018 21:56:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=xgtOemM5cbfdYA+htl+3qf+awqZR2S85I2FKwQ0uKp8=; b=jpbzkI/Xx2pjxLFyvGCk6Yqqm4y/pKjTiyjGaZDI2Y5n8bx4cQ77WF/mrIDf/vyPk/fj 5Qwq3kALL1YmQb7DPjkqRitSxwJgyLcjywKDWLOb+Xl1ev92zukn4NXhGaaTJdW+dqIL b3ksvT6MznjA6WQoCQ8UBT7UC1BAqRHzUUDNQrXsNFkLl/iyB9DIpK6BS6VA0FVlBQIr gQyfXSoeoEvw+t0NU5KyjoewUC/I0TduFIpiH8b33XzQzGraIaQ8VFRH2deeL1MursZY uS6jDj54Nbwbc2dn362Dstx6iWxrBA5kDUufMxMG1v/cqZg2sqfkcWSY6x2zFHlazuYX Fg== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2h5kc6affj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Apr 2018 21:56:06 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w35Lu4fW004430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Apr 2018 21:56:05 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w35Lu2gm022745; Thu, 5 Apr 2018 21:56:04 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8854 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=559 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804050213 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:224376 Archived-At: > > The frame-fitting code moves point through the buffer, > > at eol (`end-of-line'), within a `save-excursion', to > > get the longest line length. That movement presumably > > means that fonts are looked for to render the chars in > > each line. >=20 > The movement doesn't care about the chars themselves (it's just looking > for an end-of-line). So it's probably the computation of the > line-length which triggers it. You can probably avoid the problem by > using another way to compute the "length" (one which doesn't care about > fonts). So far, I've wanted to take the apparent (i.e., rendered) char width into account. I've just been counting columns, to do that: (while (not (eobp)) (end-of-line) (setq max-win-width (max (current-column) max-win-width)) (when (zerop (forward-line 1)) (setq max-win-height (1+ max-win-height)))) (The file is here, if you want a bigger picture: https://www.emacswiki.org/emacs/download/fit-frame.el) `current-column' "is calculated by adding together the widths of all the displayed representations of the character between the start of the previous line and point (e.g., control characters will have a width of 2 or 4, tabs will have a variable width)." That's TRT, I think: take into account rendered char widths. But maybe I need an option, to calculate line width without regard to rendering in some cases. Even so, other than a user choosing yes/no in general, I don't see a way for code to tell whether or where it might makes sense to skip requiring rendering.