From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32281: shr.el align support patch Date: Tue, 07 Aug 2018 20:19:00 +0300 Message-ID: <83r2jap01n.fsf@gnu.org> References: <6177421532613989@iva7-bd007c44f58e.qloud-c.yandex.net> <87wot4xl3g.fsf@gmail.com> <83bmafsf3l.fsf@gnu.org> <4760541533603112@sas1-890ba5c2334a.qloud-c.yandex.net> <83bmaeqkop.fsf@gnu.org> <2042111533660898@iva4-406defa25fee.qloud-c.yandex.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1533662286 6909 195.159.176.226 (7 Aug 2018 17:18:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Aug 2018 17:18:06 +0000 (UTC) Cc: npostavs@gmail.com, 32281@debbugs.gnu.org To: Bad Blue Bull Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 07 19:18:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fn5cP-0001e1-Bg for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Aug 2018 19:18:01 +0200 Original-Received: from localhost ([::1]:40162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn5eV-0000Cw-Sx for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Aug 2018 13:20:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn5eP-0000Cg-8i for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2018 13:20:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fn5eM-0001aI-0n for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2018 13:20:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fn5eL-0001a3-SJ for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2018 13:20:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fn5eL-0002Oj-In for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2018 13:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Aug 2018 17:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32281 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32281-submit@debbugs.gnu.org id=B32281.15336623539154 (code B ref 32281); Tue, 07 Aug 2018 17:20:01 +0000 Original-Received: (at 32281) by debbugs.gnu.org; 7 Aug 2018 17:19:13 +0000 Original-Received: from localhost ([127.0.0.1]:43880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fn5dY-0002Na-OW for submit@debbugs.gnu.org; Tue, 07 Aug 2018 13:19:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fn5dW-0002NN-NN for 32281@debbugs.gnu.org; Tue, 07 Aug 2018 13:19:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fn5dO-0000qY-BJ for 32281@debbugs.gnu.org; Tue, 07 Aug 2018 13:19:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn5dO-0000qJ-6V; Tue, 07 Aug 2018 13:19:02 -0400 Original-Received: from [176.228.60.248] (port=2685 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fn5dN-00013h-GK; Tue, 07 Aug 2018 13:19:01 -0400 In-reply-to: <2042111533660898@iva4-406defa25fee.qloud-c.yandex.net> (message from Bad Blue Bull on Tue, 07 Aug 2018 19:54:58 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149326 Archived-At: > From: Bad Blue Bull > Cc: "npostavs@gmail.com" , > "32281@debbugs.gnu.org" <32281@debbugs.gnu.org> > Date: Tue, 07 Aug 2018 19:54:58 +0300 > > I've escaped using of paragraph separator symbol by using narrowing That's also fine. > (can't just use constant position as > fill-region-as-paragraph will change the text before it and it won't correspond the end of paragraph anymore). We have markers for that. But if narrowing solves your problem, it's okay to use that. > Using a marker symbol to mark line breaks is still necessary, any attempt to avoid it would lead to ridicously > complicated solution. Can you explain why? I still don't think I understand. > fill-region-as-paragraph disregards fill-collumn when aligns pic, all I can do is not to justify images at all (but I'm > really puzzled how to do it, I could use other marker just to determine where image starts and ends and skip > that region, but since you're against such approach... ) > Justification is badly implemented in fill, it's useless for proportional fonts and you can see it's bad for images > too. TBH would be good to make fill.el just ignore justify in such cases (maybe giving a warning message). To support proportional fonts, we need: . convert all the calculations to work in pixels instead of in columns (or, equivalently, in units of the canonical character width, in which case you then must use floating-point values) . put on some (or all?) SPC characters a :width display property, with the suitably calculated width in pixels The infrastructure for all of that already exists, it's just a matter of coding.