From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Variable-width font indentation (was: What improvements would be truly useful?) Date: Mon, 05 Mar 2018 21:58:21 +0200 Message-ID: <83lgf6s3aa.fsf@gnu.org> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <0b1dd3fa-e0b0-ed20-a256-dd92d1c1826f@dancol.org> <8bc3c4c7-dfc7-987a-95e7-bd309e2326c6@cs.ucla.edu> <03118DC0-39DA-4AB5-980E-A33809B9A5EE@raeburn.org> <83vaeas8uz.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1520279836 8006 195.159.176.226 (5 Mar 2018 19:57:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Mar 2018 19:57:16 +0000 (UTC) Cc: emacs-devel@gnu.org, raeburn@raeburn.org, dancol@dancol.org, rms@gnu.org, eggert@cs.ucla.edu To: dancol@dancol.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 05 20:57:12 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 1eswER-0001Vh-DI for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2018 20:57:11 +0100 Original-Received: from localhost ([::1]:51309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eswGT-0008OR-VP for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2018 14:59:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eswFw-0008Gc-F3 for emacs-devel@gnu.org; Mon, 05 Mar 2018 14:58:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eswFt-0000VR-1U for emacs-devel@gnu.org; Mon, 05 Mar 2018 14:58:44 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eswFs-0000VN-US; Mon, 05 Mar 2018 14:58:40 -0500 Original-Received: from [176.228.60.248] (port=1102 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eswFl-00038C-WB; Mon, 05 Mar 2018 14:58:34 -0500 In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:223296 Archived-At: > Date: Mon, 5 Mar 2018 11:32:30 -0800 > From: dancol@dancol.org > Cc: rms@gnu.org, > raeburn@raeburn.org, > eggert@cs.ucla.edu, > dancol@dancol.org, > emacs-devel@gnu.org > > Well, say you want to align the following code: > > 1: void foo(int a, > 2: int b) > 3: { > 4: ... > > How is any generic indentation system supposed to know that the "i" on > line 2 is supposed to line up with the "i" on line 1? How does it know that today, when we only support well the fixed-pitch fonts? Or are you talking about a different problem? > You'd need to communicate all indentation intent to the generic > system in the form of positions relative to some > anchor. (Presumably, it could cache pixel offsets per-line.) While > that's doable, it's a ton of work, and I don't think it's > worthwhile. Maybe I still misunderstand you, but the pixel position of a character on display is trivial to obtain, and I see no reason why we'd need to cache them. Again, the current fixed-pitch column-wise indentation machinery doesn't, AFAIK.