From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0K+COZ6BgWUuGwAAkFu2QA (envelope-from ) for ; Tue, 19 Dec 2023 12:42:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oLa7M56BgWVyfQEAe85BDQ (envelope-from ) for ; Tue, 19 Dec 2023 12:42:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gHWy0S9g; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702986142; 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=i3N0C7UxIh8YjYrx2G6tnK/I35h0qy4lMRkJwFq9Hf0=; b=FdgiFOfNwih8mhaYJQ1JDyPs7mRI6m45LCzhBj+mrii6K5EREFamvJEUc4r6JHAE5cgjbg FzM4xm8GKocJgFKoH59YAoBvYJXi1E0ZXygoa5ETpU7LdL2dsYpcqpTbjHQPiSm0o3KKSz bVnbiNbSqpf5bk52ntRdb/2PzTUkhZ4UHE7HXCFLjrtZAlR14Z49OR2nsioln+0liYlgZw VdKvSPsovDQhyGpANNHc/gz5h145FtQAZgXfcMYDdRQYlmLqexHeujQnT0kvGqjSDe8zWE ES+Nq+GSn1C50YAE7NFNr+6LlQIdq0X9uEk34fu8qooWHLqULNY/29bGcFNTug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702986142; a=rsa-sha256; cv=none; b=LNeYDytmNNAqg3RLuJ1mrn8JQyGBJXd3Fbkb9sj4Zkk3rx33Hx3P0QsP9op+XxUgCqIMfL tFvhWokFumd7JrqtEqDL+mnB55ld0k93kU4iI3BxAwZMLjSwHtuOAsXI1hPguMtX6c0h+S nTWMSjrYt+Etu4X0a85sePusTdPOcVGSqI5Qm5X2dPv0fBFfUQnGEyRtcc/DlEbNuKCrjJ zKRUQlBtQcU8nFng6oJSMh1a9rONt1WQLwVelSMmonMPxC6XFBdrvJrhRtZAgQ7k7vsd/a YiEnR/3W/KWS49zGiOe5WZjmwQT3mI7MyLhAHT/mQrZokUSiD4/soHS2dhOnbw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gHWy0S9g; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net 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 5F8C61A658 for ; Tue, 19 Dec 2023 12:42:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFYTb-000427-KE; Tue, 19 Dec 2023 06:41:31 -0500 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 1rFYTX-00041l-9b for emacs-orgmode@gnu.org; Tue, 19 Dec 2023 06:41:27 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFYTU-0000QQ-7u for emacs-orgmode@gnu.org; Tue, 19 Dec 2023 06:41:27 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 331C4240029 for ; Tue, 19 Dec 2023 12:41:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702986080; bh=FtKBWj4hbGdgR7mUmH92bggmCqW0sD531ZlzMuseNF0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=gHWy0S9g3gR8oRMiQerrKzlA8MjyYKVRTNITzQNZjJ6lTEt7aJzd7FkLeyRcC+nYf RGrtbZbGmZbEIFLjfctN/fpa1cWDP804xX/BJf6eQ7pt8yuO7IxZbarNOCyPLXOcJ9 w6dBNT7dZzlO7VEc1MWGID7cNy0ZRX+XgLJ8zBprLM9QW4d1xBeC577PtRi0xARoVW DIF8lt/bVD3aS2DNOXlIIv61bSW4AB2mdOWCxsGaonFI3yNhZbVEUKgc9JNe+IfzK4 wiYFWyid/eLofFTjLrx5QNjcm8xFAB3NOoG+FqO4rsbGV/vgNUZozryEA0XPO80XaH W3Qdncuf5uu6w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SvZXH32qGz6ty2; Tue, 19 Dec 2023 12:41:19 +0100 (CET) From: Ihor Radchenko To: Karthik Chikmagalur Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Justify/align image previews in org-mode In-Reply-To: <87r0jj0vz4.fsf@gmail.com> References: <87r0jj0vz4.fsf@gmail.com> Date: Tue, 19 Dec 2023 11:44:25 +0000 Message-ID: <87o7empgbq.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.44 X-Spam-Score: -9.44 X-Migadu-Queue-Id: 5F8C61A658 X-Migadu-Scanner: mx12.migadu.com X-TUID: Zcz4dos/Dsh2 Karthik Chikmagalur writes: > I've incorporated the following suggestions: > > - Order of precedence: > + #+attr_org overrides #+attr_html and #+attr_latex > + `:center t' overrides `:align ...' Why only html and latex? I think that it will be more consistent to follow what we do in `org-display-inline-image--width' - any #+attr_* attribute. And apart from html/latex, we have beamer/hugo/koma-letter/what not is implemented or will be implemented deriving from html/latex backend or with support of :center attribute. > - Add a checker for `:align nil' to org-lint. `:align nil' is not > supported. I meant :align being not supported in #+attr_org. Not just nil. > + #+vindex: org-image-align > + Org mode can left-align, center or right-align the display of inline > + images. This setting is controlled (globally) by ~org-image-align~. > + Only standalone links, /i.e/ links with no surrounding text in their Maybe "standalone images"? Also, please avoid i.e - this is a general Emacs documentation guideline to avoid specialized language like i.e., e.g., and iff. > + paragraphs (except whitespace) are affected. Its value can be the > + following: > + - (default) nil, insert the image where the link appears in the > + buffer. Why not simply setting the default to 'left and not having nil at all? > + - The symbol ~left~, which is the same as nil. > + - The symbol ~center~, which will preview standalone links centered > + in the Emacs window. > + - The symbol ~right~, which will preview standalone links > + right-aligned in the Emacs window. "standalone" links is redundant here - you already mentioned that > + Inline image alignment can be specified for each link using the > + =#+ATTR.*= keyword if it matches an alignment specification like: > + #+begin_example > + ,#+ATTR_HTML: :align center > + #+end_example > + Supported values for =:align= are =left=, =center= and =right=. I think that we do not need to specify the supported values here - they are the same as for `org-image-align' just above. > + Inline image display can also be centered using =:center=, as in I'd explain that inline image adjustment is also taken from :center attribute supported by some export backends (like HTML, LaTeX, and Beamer), when #+attr_org is not set. > + #+begin_example > + ,#+ATTR_HTML: :center t > + #+end_example > + Org will use the alignment specification from any =#+ATTR.*= > + keyword, such as =#+ATTR_HTML= or =#+ATTR_LATEX=, but =#+ATTR_ORG= > + (if present) will override the others. For instance, this link > + #+begin_example > + ,#+ATTR_HTML: :align right > + ,#+ATTR_ORG: :align center > + [[/path/to/image/file.png]] > + #+end_example > + will be displayed centered. ... "but exported right-aligned to HTML" > +(defun org-lint-invalid-image-alignment (ast) > + (org-element-map ast 'paragraph > + (lambda (p) > + (let ((bad-align-re ":align[[:space:]]+nil") > + (keyword-string (mapconcat > + (lambda (attr) > + (or (car-safe (org-element-property attr p)) "")) > + '(:attr_org :attr_latex :attr_html) " "))) :align nil is perfectly valid for HTML. I thought to warn only about using anything but :align left/right/center in #+attr_org. And about :center in #+attr_org. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at