From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +C/KNZONi2BXYwEAgWs5BA (envelope-from ) for ; Fri, 30 Apr 2021 06:54:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wNCmMZONi2D+KAAA1q6Kng (envelope-from ) for ; Fri, 30 Apr 2021 04:54:43 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 353F51252C for ; Fri, 30 Apr 2021 06:54:43 +0200 (CEST) Received: from localhost ([::1]:49022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcLAn-00071A-Go for larch@yhetil.org; Fri, 30 Apr 2021 00:54:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcLAL-0006z1-9A for emacs-orgmode@gnu.org; Fri, 30 Apr 2021 00:54:14 -0400 Received: from out2.migadu.com ([188.165.223.204]:43094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcLAF-0005d3-Vd for emacs-orgmode@gnu.org; Fri, 30 Apr 2021 00:54:13 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1619758442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=poVs5OZTsjXynpaE5O2axVtaTrP/c8mdiEOmi6oIOGo=; b=e0eYFnvrHXQgtviCQgPheK1JJXHazLm1J1r2r2migt/bnYhYkgW26QAaYKoS0rK7lLE04l d7KPWLBeXEgduRn1VQTjXijemMSdzwoNms0eYUw7z4GTMinyStei/ItnJRhzWhZ/dm5gIJ UvTnBkElrT5gzc4JkaTRjHDV1ACmyWraKN+5sxjglqf0eqUUlYGl4wIhHeQ++nPU0RvwJF u0uAOU3fUi8UUVWs+lSwGarZGhbkbhUsfmdKbRgtyS8C8ntt95Bx+EUmBpmd9vnHZxN04Z DGai7EqtdL7qd2syASYIoAOchdx3RitBn+Z2lCEyD7jaJKjikh7toMaaml5ltg== From: Kyle Meyer To: Pablo Barraza Cornejo Subject: Re: [PATCH] Fix numbering of captioned images In-Reply-To: <87mttgiiuy.fsf@gmail.com> References: <87mttgiiuy.fsf@gmail.com> Date: Fri, 30 Apr 2021 00:54:00 -0400 Message-ID: <87k0oks787.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=188.165.223.204; envelope-from=kyle@kyleam.com; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619758483; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=poVs5OZTsjXynpaE5O2axVtaTrP/c8mdiEOmi6oIOGo=; b=BoDxKwSQzlrk9EL6D34foza/7jUr15tlb6CSmIzBWlmrxAbHpWCC9hOOj6Z+qo5qM/q0hI LQVy7PpRt8oPFpAMjDAmzjqI+JJVC8MRUCZdW1jDutAVyfbPLITs8+FQ7jn3QsYZTIisos yZe/IAjJG46D0grXlYzf0SqkmKpWWfNrmz3UrPwGTO46ziP+20djqBuDesxCtxwik8r6lS hoh0Yu1A21BqhDmXEBRhCnWr8jvhDd5uFHZfVvVk+6XxVYjjQCX3aRAmihm/wzcwzM6IVI 8S2DkIrWh08iVlX8PYrCzXjlHJ/qngdverK08IparzkmbCIcCch3jBkeHSegIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619758483; a=rsa-sha256; cv=none; b=qxPQ4aCg/7gf6zOz3edg0c0xnQoSV0s3kEMr7UWxRHDpfuj5aW7wdI/tUbKx3NwfowCll/ JCUojIW1QM7EctNwJAusNmI1WL91ymgIpDvm0RDuYkEOYmaayp6HGhFVwPApn/zbAouRQT /szs6o+eP1yWxFSKNKajFwhNaVu1DKf6t/nO+skgme4mtzKgf/wxmwGkor72sfUnmBvnzC JA7dot0xjrmxitwno/165KgyILg0umWCUUutvqrGej+nVSmNM6LI+BqhpperwmIzGNk0LL 8urEH0Jm6AlzFo2sa3soNydFQI31W+ZaiinuUSaWF4R9kRqP6dloUbaM0Wxkww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=e0eYFnvr; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.66 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=e0eYFnvr; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 353F51252C X-Spam-Score: -2.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: hySjNFvswjpW Pablo Barraza Cornejo writes: > When exporting to HTML, the exporter is supposed to check if there > are additional constraints over a paragraph using > `org-html-standalone-image-predicate'. A misplaced quote causes > `org-html-standalone-image-p' to not apply them. Thanks for catching the issue and for sending a patch. This looks like a regression introduced way back in 8.2.7 by ab1ce2a75 (ox-html: Fix spurious "figure" divs on empty paragraphs, 2014-05-15). > Subject: [PATCH] ox-html.el/inline-image export: Fix caption numbering. The convention in this project is to leave off the trailing period from the subject. > * lisp/ox-html.el (org-html-standalone-image-p): Remove quote which > causes `org-html-standalone-image-p' to not check if `org-html-standalone-image-predicate' is bound. Please fill this line to ~70 characters (set in the repo's .dir-locals.el). > (and (eq (org-element-type paragraph) 'paragraph) > - (or (not (fboundp 'org-html-standalone-image-predicate)) > + (or (not (fboundp org-html-standalone-image-predicate)) > (funcall org-html-standalone-image-predicate paragraph)) This quote will indeed result in the fboundp call always returning nil: (let ((org-html-standalone-image-predicate #'org-html--has-caption-p)) (fboundp 'org-html-standalone-image-predicate)) ; => nil (let ((org-html-standalone-image-predicate #'org-html--has-caption-p)) (fboundp org-html-standalone-image-predicate)) ; => t However, the proposed change will introduce another issue. org-html-standalone-image-predicate is defined as (defvar org-html-standalone-image-predicate) That means it's left uninitialized: (defvar my/foo) ; => my/foo (boundp 'my/foo) ; => nil (fboundp my/foo) ; error: (void-variable my/foo) What about returning to the boundp/fboundp combination that was in place before ab1ce2a75? (and (boundp 'my/foo) (fboundp my/foo)) ; => nil (let ((my/foo #'ignore)) (and (boundp 'my/foo) (fboundp my/foo))) ; => t