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 YJg3Byt8gGXtnwAAkFu2QA (envelope-from ) for ; Mon, 18 Dec 2023 18:06:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 2MXoACt8gGWXwQAAe85BDQ (envelope-from ) for ; Mon, 18 Dec 2023 18:06:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iW7Kh0xV; 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=1702919210; 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=gOR7G+J386dGvMh4dEOMNzqpSZaxXsv4rd02/YFZZrM=; b=dkQ3tppy65W1V6jgboam4Rl1LsNOtJd71Y132uUmO4EKWlvRlU1XIEwuISuPX5BAIy9CQ/ 59yT9qa1iyareRRf0w/cZ20z4JuMuIAkzcxnADzu8LmpOV4n487hfmitKbUkje4v6MsRSH suMaPXbtwoNqNtHzj9VpAYOyjGNaozw9cJEM2wCe4JIatpBrquz97ur0VkFS2aKdavrXzh Bo/vbtt2oBlJDA2uKQ1Pd8Dm8+ZEsEBIiliQnlRYJUDoQenlthbqsNU2I+BErzVmSxnvOp V+ZlUAiCKKnDy2kK5XARAjOs32NCac2eQofdpjs9OG0nZUSFYkN+5AA3VxnqzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iW7Kh0xV; 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-Seal: i=1; s=key1; d=yhetil.org; t=1702919210; a=rsa-sha256; cv=none; b=cIUkaWY5bUsLy/+udVqCb3we+WNL+Wtbw7XTfZ9MmlDdNvYBPfA9G+mB+l8o426c1U7oET 2+0r/fJDHIjr4BXw4gx7Z0jyUWV7S5/N/Er501e9H9R7LE5y10kWBv+dsP8TYGQXl+guun MxqJ3i37X/IROEv4/fboSppkNvMPeS5n6XeNvQEIqgMjL5YNhmkb1PhmhN97nf6OLYOda1 jih5sBZMvq7cL4TU4rmqwnyL8Vqb36prX5a2Z+6xYKg5PdCEf6CFxApIBwDUvzAHgSb3R9 B0ueMdA7JMBMXrqihjIW7H/28M67DTl3MsYkjSNlK1CvmfLtFxAX4R8gx33cEw== 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 A60F412CA6 for ; Mon, 18 Dec 2023 18:06:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFH3Q-0008TM-1g; Mon, 18 Dec 2023 12:05:20 -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 1rFH3B-0008RE-GX for emacs-orgmode@gnu.org; Mon, 18 Dec 2023 12:05:06 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFH32-0006GT-VM for emacs-orgmode@gnu.org; Mon, 18 Dec 2023 12:05:05 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BF81A240103 for ; Mon, 18 Dec 2023 18:04:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702919093; bh=Qayc1k7Q82Vo7s7BJ0oB8p08BqmeNQxYifHp+LCyTPA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=iW7Kh0xVZJq/N5JSr+GMiz3c/wr3Nl8dMjkBF/bJW3rUeex0LTvc1QOuHR3DFXpi1 +l/pnHHqppiP333ZiVerSGAyxnxA3gJ3SdpHHxL96QWMtEcferm4vRr9bS2ZP/t5nq t4lH4oA6oyvoAG6gJETnyS9nUSw93+TVdovlXBYo/HQYlNi6jxYBlbKgtGojWLRJu8 1xSBZ31wQRq0ZB8yiYkeIPeQm3QL6KWizPLVpTkt/QFjfJUiUZBoeTH7GYW7VdMba0 RcT3QX8j147vgvgsOmk0UuPWvjXPHW4n+QdlXjf7JP/Jvdt5ulEYEHpT2/mLgXeFN7 MWFb1uMPD0GlQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Sv5m50Kx3z6twL; Mon, 18 Dec 2023 18:04:53 +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: <87zfy71mmu.fsf@gmail.com> References: <87zfy71mmu.fsf@gmail.com> Date: Mon, 18 Dec 2023 17:07:58 +0000 Message-ID: <87y1drphg1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de 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, 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.08 X-Spam-Score: -4.08 X-Migadu-Queue-Id: A60F412CA6 X-TUID: LMMKzELA0S1A Karthik Chikmagalur writes: >> This will not work when the image paragraph is indented: > > * This is test > #+attr_org: :align center > [[file:~/Downloads/wallpaper.png]] > > - Is there a better way to address this than checking if there is only > whitespace behind the link until the start of the paragraph? I can only suggest something like (equal (org-element-begin link) (save-excursion (goto-char (org-element-contents-begin paragraph)) (skip-chars-forward "\t ") (point))) (equal (org-element-end link) (save-excursion (goto-char (org-element-contents-end paragraph)) (skip-chars-backward "\t ") (point))) > - Does org-element provide a property that can help here? I tried > :pre-blank but it was nil, I'm not sure what it does. :pre-blank is for blank lines before contents. Leading whitespace is considered a part of the paragraph: (paragraph (...) " " (link ...) "\n") -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at