|
From: | Paul Eggert |
Subject: | Re: Variable-width font indentation |
Date: | Mon, 5 Mar 2018 18:04:05 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 03/05/2018 05:40 PM, Clément Pit-Claudel wrote:
I've tested it on two files: src/termcap.c and lisp/dabbrev.el. To try it out, open one of these files in emacs -Q, then run M-x ~/variable-pitch-indent, and then M-x variable-pitch-mode. I do agree that it doesn't look too bad, and presumably a C implementation of the algorithm above would be very fast, since it could build the "spine" above during redisplay.
Thanks, that was fast! Yes, it should work fast.I saw one easily-fixable minor glitch (on my screen lisp/dabbr.el line 533 had the wrong indent, presumably since the "user-error" on the previous line was in a fatter-than usual font). The biggest trickier minor glitch was that indenting of #if and #else subparts were annoyingly different because the "#" violates the usual indentation rule. Personally I've always thought that we should indent "#" like anything else -- the only reason we don't is that it didn't work with K&R C and so we got used to bad style -- but even if we stick with the bad "#if" indenting it still looks pretty reasonable.
[Prev in Thread] | Current Thread | [Next in Thread] |