From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rahguzar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66676: 29.1; Should some aspects of shr rendering be configurable Date: Sun, 22 Oct 2023 12:26:53 +0200 Message-ID: <87r0lnx7kx.fsf@zohomail.eu> References: <87v8azxek4.fsf@zohomail.eu> <83o7groufg.fsf@gnu.org> Reply-To: Rahguzar Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17317"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.7; emacs 29.1 Cc: 66676@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 22 12:43:02 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1quVvC-0004Jv-5I for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Oct 2023 12:43:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quVum-0005ew-Kr; Sun, 22 Oct 2023 06:42:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quVuk-0005XX-7h for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 06:42:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quVuj-0004bg-Mh for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 06:42:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quVvB-0003XA-Vk for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 06:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rahguzar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2023 10:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66676 X-GNU-PR-Package: emacs Original-Received: via spool by 66676-submit@debbugs.gnu.org id=B66676.169797133913516 (code B ref 66676); Sun, 22 Oct 2023 10:43:01 +0000 Original-Received: (at 66676) by debbugs.gnu.org; 22 Oct 2023 10:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:45510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quVuU-0003Vw-PN for submit@debbugs.gnu.org; Sun, 22 Oct 2023 06:42:19 -0400 Original-Received: from sender11-pp-o91.zoho.eu ([31.186.226.249]:25195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quVuQ-0003Vm-Mh for 66676@debbugs.gnu.org; Sun, 22 Oct 2023 06:42:17 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1697971297; cv=none; d=zohomail.eu; s=zohoarc; b=e+ZErEY9UtmmUURAg2cCqvYNvRWj/Wc/QfgLzthnXGouHf1lJ1igrSt86nWEMMAudlIhQeDxypAF4/WjkQZHKOLrBrBI+CDymCMUvXEtEVy1pLTz5aES6x6AP6PP+VzVnfM2apHQV1UBMEtpUO2kCGnPwihdO5OhwenpP5ejFnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1697971297; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=WxRHsxNTD7lEMWzevuGG6VB8tFNoWk7ohWxgBOhQjv0=; b=F0r05lnczen+qOTRVPsiZAJIbo5CajsMrrltFTWnyRJWWJxb0wjLJwz1WKqTe1joePbDZBblcAz2sz305OTD7BQ/QmsOBha4R/VPX9vOr3PFVs0gacmHSu8/Hq4fVPZiIkZQpwN6SvUcyLm8e8b4Sf6oiZOikrhOhg+UaMBpFY0= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=zohomail.eu; spf=pass smtp.mailfrom=rahguzar@zohomail.eu; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1697971297; s=zoho; d=zohomail.eu; i=rahguzar@zohomail.eu; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=WxRHsxNTD7lEMWzevuGG6VB8tFNoWk7ohWxgBOhQjv0=; b=OyifnRYBWQuItQsQFvpztkzvJYrKLM3fOrHDfzZ54oMMlYV+sBqCAtBnq1lXwjWE cWyyxyzrN8zbNdKtm/zRicHU17SdA3OKn5QMnnpZbpH1PZS3fVcbbAyhriv2Bh15nxw fJwVP/X8ik/Enp3J7d9pGFj64Rol4syUSk4HgeEo= Original-Received: from localhost (78-73-246-128-no600.tbcn.telia.com [78.73.246.128]) by mx.zoho.eu with SMTPS id 169797129619753.13090559050579; Sun, 22 Oct 2023 12:41:36 +0200 (CEST) In-reply-to: <83o7groufg.fsf@gnu.org> X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272969 Archived-At: Hi Eli, Eli Zaretskii writes: >> 1) Using `visual-line-mode` for line wrapping. I think this is more >> natural for html and makes resizing windows work more nicely. > > AFAIR, there were good reasons for the decision to fill text in shr. > So this could be an optional feature, but not the default. > I was thinking of an optional feature too. I am not at all confident that visual-line-mode will be good enough for tables for example. > shr breaks lines on images because Emacs is incapable of displaying an > image without making the line of surrounding text high enough to allow > the image to be displayed. I agree with this too, but the images I was thinking of are typically around the same height as the surrounding text and I think these newlines should be the responsibility of `shr-put-image-function`. The default value `shr-put-image` already checks if image is more than 400 pixel wide and in that case inserts it into a new line. So I propose adding a new `shr-max-inline-image-size` variable which a cons of `WIDTH` and `HEIGHT` and images are inserted into a new line only if one of its dimensions is bigger than the ones specified in shr-max-inline-image-size. >> 3) shr uses 0.2 and -0.2 as value of raise property for superscripts and >> subscripts. I think it makes sense to make these values customizable. >> For me 0.2 for superscripts was too low and 0.4 worked much better. > > No objection to making this customizable. > >> 4) shr uses 100 as the value of :ascent when creating an image. For me >> this makes the inline images appear off centered. I fiddled with it a >> bit and found 60 to be a good value for me. I wonder if it makes sense >> to makes the value of :ascent to be customizable? My instinct is no >> since I think the correct value can probably be computed from image >> height and the average height of default face. > > I think it could be customizable even if it's computed from the image. I will start with just making it customizable then since that is simpler and send a patch adding the customizations listed above somewhat soon. Thanks, Rahguzar