From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#28402: 25.2; shr.el uses shr-tag-img despite set shr-external-rendering-functions Date: Thu, 05 Oct 2017 12:18:40 +0200 Message-ID: <877ew9vqwv.fsf@mouse.gnus.org> References: <83poaxrzl1.fsf@gnu.org> <20170913172232.7jwwomyfmy567nrx@odonien.localdomain> <83lglio36q.fsf@gnu.org> <20170924131050.6erv6sshvz23dlbu@odonien.localdomain> <838tgy9d18.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507198755 1004 195.159.176.226 (5 Oct 2017 10:19:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Oct 2017 10:19:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Vasilij Schneidermann , 28402@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 05 12:19:09 2017 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 1e03FA-0007F3-JL for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Oct 2017 12:19:04 +0200 Original-Received: from localhost ([::1]:38898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e03FG-0003mD-AR for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Oct 2017 06:19:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e03FB-0003m6-Fd for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e03F8-0004QR-8O for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e03F8-0004QI-54 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e03F7-000188-Vl for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2017 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28402-submit@debbugs.gnu.org id=B28402.15071987264318 (code B ref 28402); Thu, 05 Oct 2017 10:19:01 +0000 Original-Received: (at 28402) by debbugs.gnu.org; 5 Oct 2017 10:18:46 +0000 Original-Received: from localhost ([127.0.0.1]:49782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e03Es-00017a-93 for submit@debbugs.gnu.org; Thu, 05 Oct 2017 06:18:46 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:37424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e03Eq-00017P-Mc for 28402@debbugs.gnu.org; Thu, 05 Oct 2017 06:18:45 -0400 Original-Received: from cm-84.209.243.26.getinternet.no ([84.209.243.26] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e03Em-0004Po-6g; Thu, 05 Oct 2017 12:18:42 +0200 In-Reply-To: <838tgy9d18.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Sep 2017 10:31:15 +0300") 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:137954 Archived-At: Eli Zaretskii writes: > If no objections are voiced in a few days, I will push to the emacs-26 > branch. Sorry; I didn't have a look at this before you applied. It mostly looks fine, but this bit isn't: (defun shr-descend (dom) - (let ((function - (intern (concat "shr-tag-" (symbol-name (dom-tag dom))) obarray)) - ;; Allow other packages to override (or provide) rendering - ;; of elements. - (external (cdr (assq (dom-tag dom) shr-external-rendering-functions))) + (let ((tag-name (dom-tag dom)) (style (dom-attr dom 'style)) (shr-stylesheet shr-stylesheet) (shr-depth (1+ shr-depth)) @@ -490,12 +498,7 @@ shr-descend (setq style nil))) ;; If we have a display:none, then just ignore this part of the DOM. (unless (equal (cdr (assq 'display shr-stylesheet)) "none") - (cond (external - (funcall external dom)) - ((fboundp function) - (funcall function dom)) - (t - (shr-generic dom))) + (shr-indirect-call tag-name dom) shr rendering of deep HTML structures uses a lot of stack, and we see this in practice sometimes, where shr refuses to render HTML because it's too deeply nested (and runs into the Emacs max-depth stack thing). This indirect call will make the stack 30% deeper, I think? As well as slower, since it's an extra funcall for each and every HTML node. So this part should be reverted. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no