From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iERaAXbzYGcWOwAAe85BDQ:P1 (envelope-from ) for ; Tue, 17 Dec 2024 03:43:50 +0000 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 iERaAXbzYGcWOwAAe85BDQ (envelope-from ) for ; Tue, 17 Dec 2024 04:43:50 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=TEDjFFOc; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734407029; 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=/azLvCno9h08ncmkoMr83sI2JUyD3fZVjmzENluU+fw=; b=LJ2yCdv2dzeW77MBUZcZIFSqGu2Ks0HvA/M1c6nnNOg0AB0c2/2bvB6vEKPwa2CXJf8T/i y7xNlIAJibObkW21z9IQI5tLnn+fb1wJv2sGSZKA2/Qj5+1SB41mGPrtIYQROcQI0fNlL1 hzcMVSonmiDtDe1m4+5k5gS9nQwwCW+BrKuP/myoDdwEAYaMIlKGWnTKfsulrr1ighInW2 PeCdKYNe4lMdJ95aU+f0UMZ8zdJqYqs8sXh+LDQQpvqC4DL/r3qs88KtTcUQL0CenqFpCy KZMuqIADdbNcnZ13HnXvYffH98hil594AOzFId/X5bOGZcdvQcCz6j7QcP6dgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=TEDjFFOc; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734407029; a=rsa-sha256; cv=none; b=lbBMOK4vQBKDvGcJAyF42ntzH6MXpOXHKMdiL2/mnkDyAlAfQem3rLPq+uNebBhEjBrFAr aETxwxwBCvCHstCnc1PFBhmHGa0Me88tHWRzPjO04Zqa26Y9U1SXL0se41vLgG7QMnL2Nm N9DZFRWvmmsgUbL2PtW+NcOWrKtFMe6lXw8Xqa4IanJPu6q8h9yGS0E3tApVxHXBHGXDMK s2fwCTY8BQG/qGOKxjpUlWfh5g1vZ7WkSG+iZLbMqb7I1Eeq+tUJ5NcIvRwCz5T8NPO2RX LVfFQqph5dlhk6KnQisPDu6dpdVJLHwscHwKdeEu5mRbnFN8xAQrUAC1Pv2SWw== 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 E21C76954 for ; Tue, 17 Dec 2024 04:43:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNOTx-00074t-4H; Mon, 16 Dec 2024 22:42:49 -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 1tNOTu-00074Y-Ky for emacs-orgmode@gnu.org; Mon, 16 Dec 2024 22:42:47 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNOTt-0002Up-3S for emacs-orgmode@gnu.org; Mon, 16 Dec 2024 22:42:46 -0500 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-725ecc42d43so4097560b3a.3 for ; Mon, 16 Dec 2024 19:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734406962; x=1735011762; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=/azLvCno9h08ncmkoMr83sI2JUyD3fZVjmzENluU+fw=; b=TEDjFFOcCnpn7LKwHximgncVKSPeCrsCioYK1mSv4kOxzmmY3EpS9AT1tD5oMSWCjF a0ILzyU7pyOjeGZ1/wZr3XCqAsipJcSZoi//0ce9ojWCknKtF4vDT9nU1pFule0fB9qB fMRk0ur/bgDvfE+pJiXpqk7I/WGqZJVOhF2GgtWNvbAAIa/HoqKKVr4gKdMGvBfXn+R2 6t2E36nfdzXN6ii0nyoEO0Q4+NVVBc1C5S7qd9x4J9TolpY2lWK1bAkmwXXhFrldODRk EdgZ+Tzpx221qUrEk8S0nA/KygsZ8x57nf2bcRnfjOJ3i1nwGyu0BzfuRV5crmZ/Wk3T GOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734406962; x=1735011762; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/azLvCno9h08ncmkoMr83sI2JUyD3fZVjmzENluU+fw=; b=NeDT4ytsyZQJDUiJJbbqitRbswiAS9/6S+fS803Kuk0npe/sa7v96s2U7CjgsNn7N+ 156tm2vWIENwZAD+N2B0V5RbOHsQQvmOIjyG55ykMc1Wjh/q4IsjhGhgoR41l9rGKF/5 MF6cAucacsLytHzTvxCj1hfOfVAaL2vMzdK5e+L3os6lbowi1cOf5BVN+0eJgOfYSfB3 iAZNsKW0Un1lOrj5freLGYkDRQfMK84Ih0RjZu/JsnXCKSbI53UlXSeqha8gMIEBBSVw IJMVJqJb+7sRnmM4p50jAVnhFxYADlSuf/mcaNRRLloZ5qsaLCb+1xMppzVIbA49mguB bKTQ== X-Gm-Message-State: AOJu0YyzGecLS7ObX37FTHo2BnqhPJyOAxgbgPNsPOCrezkuRYet1uxv szbtcMKRb5EM7WS5Reyk0VFfvd/qoVnMNgvfaBs9yjQf50/dPrKSgQfeMA== X-Gm-Gg: ASbGncvD7H3Di82+rwuyFboki2jOL0MSt/kc3XGmiU5q8MsVtmPMrnMwR1OyE5h4EzJ bVZ6eVN7kE7GO1ba07gu6s8Y1/UiFVcL8SR4FXPAeJNOQay3XuKPXdwN6cC3MtGHV+qr85TSaxS L3pVKtMw4mDtbhWxVFQrfnj4UZbBmoCXer/xGG7gLBsVdqOIeYVb+0/m9q/jX2U7j9xC6pvnItk FLc25ckKw3a8YBLXFLqPyNL05+i26O8086hwmombKH7gk7yCF9gQqFOufPVxWRqC+KAPw== X-Google-Smtp-Source: AGHT+IEwaHCPBMCxd4myTok/5cKlRdApFzE+4c0rTcBfQlzhiWcZcyuzWEf1WGw6TRbnBePLvlNd9A== X-Received: by 2002:a05:6a00:8019:b0:725:ef4d:c1bd with SMTP id d2e1a72fcca58-7290c248bdemr20561769b3a.19.1734406961638; Mon, 16 Dec 2024 19:42:41 -0800 (PST) Received: from localhost ([2600:8802:5726:2500:c7df:7cbb:70a2:bda7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918af1040sm5565729b3a.83.2024.12.16.19.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 19:42:40 -0800 (PST) From: Karthik Chikmagalur To: Ihor Radchenko , =?utf-8?Q?Bj=C3=B6rn?= Bidar Cc: emacs-orgmode@gnu.org Subject: Re: Link preview generation with new link preview property In-Reply-To: <87pllug2y4.fsf@localhost> References: <6755f138.0c0a0220.40388.51fbSMTPIN_ADDED_BROKEN@mx.google.com> <874j382kue.fsf@gmail.com> <87pllug2y4.fsf@localhost> Date: Mon, 16 Dec 2024 19:42:39 -0800 Message-ID: <87ldwfnff4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=karthikchikmagalur@gmail.com; helo=mail-pf1-x436.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.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-Queue-Id: E21C76954 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.68 X-Spam-Score: -5.68 X-TUID: yGpPThCD6bWB >> Would it be possible to also handle image data in the function or >> refactor the org-link-preview-file function in a way that the geometry >> handling is done in a helper function which can be reused by other >> handlers. > > There is such function: `org-display-inline-image--width'. > We may consider exposing it as public function. This will not be enough, we will also have to expose `org-image--align' and the alignment code: (when align (overlay-put ov 'before-string (propertize " " 'face 'default 'display (pcase align ("center" `(space :align-to (- center (0.5 . ,image)))) ("right" `(space :align-to (- right ,image))))))) I don't think we can expect third party packages to figure out and reimplement Org's image alignment logic. Considering this, it might be better to just split `org-link-preview-file' into two public functions, where the "inside" function accepts an image instead of a file. Karthik